Never leave the agent stranded in a working state #66

Merged
dongar merged 2 commits from no-stranded-states into main 2026-09-29 17:21:43 +00:00
Showing only changes of commit b077906631 - Show all commits
+6 -1
View File
@@ -16,6 +16,7 @@ from nisse_dev.control import (
AWAIT_INPUT,
AWAIT_MILESTONE_SIGNOFF,
EXECUTING,
PR_OPEN,
Orchestrator,
)
from nisse_dev.executor import LLMExecutor
@@ -45,7 +46,9 @@ def _drive_to_execution(
if state.state == AWAIT_INPUT:
transport.receive("don", "Use your best judgement and proceed.")
elif state.state == AWAIT_MILESTONE_SIGNOFF and gate.get("approved"):
# The milestone runs to completion inside this command.
transport.receive("don", "start milestone 1")
return
elif state.state in (AWAIT_ARCH_SIGNOFF, AWAIT_MILESTONE_SIGNOFF):
transport.receive("don", "approve")
else:
@@ -85,7 +88,9 @@ def test_plan_approve_execute_produces_a_real_file(
state = store.get_state()
assert state is not None
assert state.state in (EXECUTING, AWAIT_INPUT)
# Never EXECUTING at rest: with no publisher a finished milestone waits in
# PR_OPEN, and one that stopped short waits for the operator.
assert state.state in (PR_OPEN, AWAIT_INPUT)
created = list(workspace.root.rglob("*.py"))
assert created, f"executor created no Python file; said: {transport.outbound[-1]}"