Repository navigation
fix(prompt_agent): a re-run closes the conversations a dead run of the step left active - #937
psinghal20 wants to merge 1 commit into
Conversation
|
🤖 Automated Claude routine — Env Pod PR Context Review. This is a bot, not Edgar Arakelyan; not a human review. Context from a newer open PR: #951 ( Generated by Claude Code |
…e step left active A step without context_id mints a new conversation id on every run, so when its worker dies and the step is re-run, the earlier conversation stays active and reopen never finds it. The record now carries the step_id that created it, and the step closes the active conversations an earlier run of it left for the same task instance before anything reaches the agent (close_active_for_step). A step with context_id shares its conversation across runs and is left to reopen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
73e19d8 to
cbc10d5
Compare
Stacked on #951, which closes a prompt step's conversation however the step ends and
reopens it on a re-run with the same conversation id.A step without
context_idmints a new conversation id on every run. When its worker dies mid-step, nothing in that process closes the conversation, and the re-run'sreopennever finds it, so it staysactiveand pending in the hub worklist.The record now carries the
step_idthat created it, and the step closes the active conversations an earlier run of it left for the same task instance (close_active_for_step) at the start of_execute, before anything reaches the agent, so a re-run that fails early still closes them. A step withcontext_idshares its conversation across runs, gets nostep_idand is left to #951'sreopen. Records written before this have nostep_idand are never swept.Not covered: a worker that dies with no later run of the step, and cancelling the earlier agent turn. An earlier run that is stuck but alive when the step is re-run has its conversation closed, and #951's guard refuses its next turn.
Validation: 3 step tests (re-run closes the leftover, a re-run failing before its own conversation still closes it,
context_idnot swept), the first two failing with the sweep disabled; 2 store tests; with #951's 11 conversation tests, 16 pass;ruff checkclean. Thetst/unit/task_step,a2a_agentandstoresuites pass except 6 failures incomputer_exec_test.pyandtest_mcp_cli_builder.pythat also fail onmain.Once #951 lands, this branch is rebased onto
main.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues remain.Summary
Adds
step_idto conversations owned byprompt_agentand closes active leftovers before a new attempt contacts the agent.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Start prompt step] --> B{Fixed context_id?} B -->|No| C[Close active leftovers for this task instance and step] B -->|Yes| D[Keep shared conversation behavior] C --> E[Configure agent and start conversation] D --> EReviews (3) · Last reviewed commit: "fix(prompt_agent): a re-run closes the c..." · Reviewed by Greptile