-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Description
When a subroutine with singleTurn: true completes (e.g., question-answer), Claude returns subtype: "error_max_turns" because it hit the maxTurns=1 limit. However, the handleProcedureCompletion() method treats any non-"success" subtype as an error and returns early, preventing the result from being posted to Linear.
Steps to Reproduce
- Create an issue and mention the agent with a question
- Agent routes to
simple-questionprocedure →question-investigation→question-answer question-answerruns withsingleTurn: true(converted tomaxTurns=1)- Claude generates a response and the session completes with
subtype: "error_max_turns" - Result is NOT posted to Linear
- Session appears to hang indefinitely in Linear UI
Expected Behavior
- Claude's response should be posted to Linear as a comment/activity
- Session should be marked as complete
- Linear UI should show the session as finished
Actual Behavior
- Response is generated but never posted to Linear
- Session stays in "active/running" state in Linear
- No visible output from the agent
(Potential) Root Cause
In AgentSessionManager.ts, handleProcedureCompletion() (around line 269):
// Check if error occurred
if (resultMessage.subtype !== "success") {
console.log(
`[AgentSessionManager] Subroutine completed with error, not triggering next subroutine`,
);
return; // <-- Early return prevents addResultEntry() from being called
}The addResultEntry() at line 415 that posts results to Linear is only reached if there's no early return.
Environment
- Running on a local machine via tmux with cloudflared tunnel
- Linear integration with agent sessions
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels