-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix: correctly set isComplete in metadata #9683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sestinj
wants to merge
6
commits into
main
Choose a base branch
from
nate/fix-iscomplete
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+62
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
✅ Review Complete Code Review Summary |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
Fixes issue where agent sessions stay stuck in "running" state forever
because the isComplete metadata field is never set.
Changes:
- Status tool now calls updateAgentMetadata({ isComplete: true }) when
status is "DONE" or "FAILED"
- reportFailure tool now marks agent as complete before reporting failure
- exit tool now marks agent as complete before exiting
- Added debug logging to track inactivity timeout progress and lastActivity
updates
This ensures the UI can properly detect when an agent has finished and
display the correct state instead of showing "running" indefinitely.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Addresses code review feedback to use shared logger instead of console.debug
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>
Instead of always setting isComplete=true after every turn, now check if the last message has tool calls. Only mark as complete if there are no pending tool calls. This prevents marking agents as complete when they still have work to do, while ensuring they are marked complete when giving final responses.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
[ What changed? Feel free to be brief. ]
AI Code Review
@continue-reviewChecklist
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
Powered by Continue
Summary by cubic
Correctly mark agent sessions as complete by setting isComplete in metadata after final assistant responses and when tools finish or fail. This prevents sessions from staying stuck in “running”.
Written for commit 3106a8c. Summary will update on new commits.