Skip to content

Conversation

@sestinj
Copy link
Contributor

@sestinj sestinj commented Jan 26, 2026

When an agent completes a turn with a final response (no tool calls), we now correctly set isComplete=true in the metadata. Previously, isComplete was only set when Exit, ReportFailure, or Status tools were called, or when the server shut down. This caused agents that gave final responses to remain in 'running' state indefinitely.

The fix checks the last message in history after each turn - if it's from the assistant and has no tool_calls, the agent is marked as complete.

Description

[ What changed? Feel free to be brief. ]

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Continue Tasks: ▶️ 2 queued — View all


Summary by cubic

Mark agents as complete when they finish with a final assistant response (no tool calls), preventing sessions from getting stuck in “running.” Metadata is updated immediately after each turn.

  • Bug Fixes
    • Checks the last chat message after each turn and computes isComplete.
    • Sends { history, isComplete } to updateAgentMetadata; no longer depends on Exit/ReportFailure/Status calls or shutdown.

Written for commit ebc81a6. Summary will update on new commits.

When an agent completes a turn with a final response (no tool calls), we now
correctly set isComplete=true in the metadata. Previously, isComplete was only
set when Exit, ReportFailure, or Status tools were called, or when the server
shut down. This caused agents that gave final responses to remain in 'running'
state indefinitely.

The fix checks the last message in history after each turn - if it's from the
assistant and has no tool_calls, the agent is marked as complete.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sestinj sestinj requested a review from a team as a code owner January 26, 2026 04:42
@sestinj sestinj requested review from Patrick-Erichsen and removed request for a team January 26, 2026 04:42
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 26, 2026
@sestinj sestinj merged commit d90c5f8 into main Jan 26, 2026
31 of 37 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Jan 26, 2026
@github-actions
Copy link

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

@sestinj sestinj deleted the fix/agent-iscomplete-metadata branch January 26, 2026 04:42
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2026
@sestinj
Copy link
Contributor Author

sestinj commented Jan 26, 2026

🎉 This PR is included in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants