Skip to content

fix(agent_loop): continue on StopReason::Length and expose stop_reason in TurnOutcome#4

Open
endless-bot wants to merge 1 commit into
mainfrom
endless/prod-task-340
Open

fix(agent_loop): continue on StopReason::Length and expose stop_reason in TurnOutcome#4
endless-bot wants to merge 1 commit into
mainfrom
endless/prod-task-340

Conversation

@endless-bot

Copy link
Copy Markdown
Collaborator

🤖 Auto-generated by Endless task #340.
Initiated by: guimin.jiang@longbridge-inc.com
Worker agent: Claude Code (claude_code · anthropic · claude-sonnet-4-6)

Commits

  • fix(agent_loop): continue on StopReason::Length and expose stop_reason in TurnOutcome
    • Add stop_reason: StopReason field to TurnOutcome (crate-private), populated
      from assistant.stop_reason in run_one_turn()
    • In run_until_done(), detect StopReason::Length after the queued-message check
      and inject AgentMessage::User("Continue.") so truncated turns are resumed
      instead of silently exiting (Bug A fix)

…n in TurnOutcome

- Add `stop_reason: StopReason` field to `TurnOutcome` (crate-private), populated
  from `assistant.stop_reason` in `run_one_turn()`
- In `run_until_done()`, detect `StopReason::Length` after the queued-message check
  and inject `AgentMessage::User("Continue.")` so truncated turns are resumed
  instead of silently exiting (Bug A fix)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Co-authored-by: 员外 (Jiang Guimin) <guimin.jiang@longbridge-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant