Skip to content

fix(agent): stop follow-up turns after In Review / Merging (MT-247)#61

Merged
ivanzzeth merged 3 commits into
developfrom
fix/mt-247-agent-handoff-states
May 9, 2026
Merged

fix(agent): stop follow-up turns after In Review / Merging (MT-247)#61
ivanzzeth merged 3 commits into
developfrom
fix/mt-247-agent-handoff-states

Conversation

@ivanzzeth
Copy link
Copy Markdown
Owner

Summary

tracker.active_states includes In Review and Merging so the orchestrator keeps polling those issues. AgentRunner reused the same rule to decide multi-turn continuation, so after the first completed turn—when the agent moved the ticket to In Review—the runner still treated the issue as "active" and scheduled another turn. That contradicts the WORKFLOW handoff (In Review waits on humans; no further coding in the same run).

Changes

  • Continue multi-turn runs only when the refreshed state is active and follow_up_turn_allowed? passes (excludes In Review and Merging, case-insensitive).
  • Document the split between orchestrator polling vs agent continuation in AgentRunner moduledoc.
  • Add regression tests with WORKFLOW-shaped active_states.

Validation

  • mix format on touched files.
  • Local mix test test/symphony_elixir/agent_runner_test.exs could not be completed in this environment: application boot timed out reaching api.linear.app via Finch. CI should run the full suite.

Linear: MT-247

Made with Cursor

ivanzzeth and others added 2 commits May 9, 2026 15:09
Cursor stream-json may emit camelCase sessionId without snake_case session_id.
Mirror Claude adapter resolution so AgentRunner passes a real --resume id on
continuation turns after the issue stays active (MT-247).

Adds regression test with init payload using sessionId only.

Co-authored-by: Cursor <cursoragent@cursor.com>
Tracker active_states include In Review and Merging for orchestrator polling,
but those handoff states must not trigger another coding-agent turn in the
same run. Gate continuation on follow_up_turn_allowed?/1.

Adds regression tests for In Review and Merging with WORKFLOW-shaped active_states.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ivanzzeth ivanzzeth added the symphony Symphony orchestration related changes label May 9, 2026
Copy link
Copy Markdown
Owner Author

@ivanzzeth ivanzzeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: PR #61 — MT-247 stop follow-up turns after In Review / Merging

Summary

Stops agent follow-up turns when the refreshed issue state is "In Review" or "Merging". The orchestrator continues polling these states, but the agent runner does not dispatch another turn.

Analysis

  • follow_up_turn_allowed?/1 correctly distinguishes "active for polling" from "active for agent turns"
  • normalize_issue_state is already used by active_issue_state? — the same normalization applied to "In Review"/"Merging" is consistent
  • Tests cover both In Review and Merging cases with FakeCodingAgent
  • This PR includes the same cursor adapter fix as PR #58 (camelCase sessionId) — if both merge, there will be a conflict. Recommend closing PR #58 and keeping this one since it has both fixes for MT-247.

Recommendation: Approve — correct logic, good tests, but coordinate with PR #58 (same MT-247 fix, same cursor adapter change).

Copy link
Copy Markdown
Owner Author

@ivanzzeth ivanzzeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by human. Approved.

Resolved conflict in agent_runner.ex: combined develop's active_issue_state?
opts arity with HEAD's follow_up_turn_allowed? guard
@ivanzzeth ivanzzeth merged commit 3e8edaa into develop May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

symphony Symphony orchestration related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant