Keep review agent Working (red dot) while background agents run#116
Open
0101 wants to merge 1 commit into
Open
Keep review agent Working (red dot) while background agents run#1160101 wants to merge 1 commit into
0101 wants to merge 1 commit into
Conversation
A session running the `review` skill launches background review-runner agents, then ends its turn to wait for them, which freezes the events-file mtime. The forward fold treated `assistant.turn_end` as Done, so past the 15s grace window the worktree showed a blue Done dot and dropped out of the Overview band's Reviewing group even though the agent was still working. Track outstanding background agents in the session scan: a `task` call with `mode: background` adds its agent id, a `system.notification` of kind `agent_idle` removes it. `turn_end` now yields Done only when none are still running, otherwise Working (depth-0 gated like skill detection).
There was a problem hiding this comment.
Pull request overview
Keeps Copilot review sessions marked Working while background review agents remain active.
Changes:
- Tracks outstanding background-agent launches and idle notifications.
- Gates
turn_endstatus on outstanding agents. - Adds regression tests and documentation.
Show a summary per file
| File | Description |
|---|---|
src/Server/CopilotDetector.fs |
Adds background-agent state and status handling. |
src/Tests/CopilotDetectorTests.fs |
Tests launch, completion, nesting, freshness, and incremental folding. |
docs/spec/worktree-monitor.md |
Documents background-agent status detection. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Medium
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
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.
Problem
A session running the
reviewskill launches backgroundreview-runneragents, then ends its turn to wait for them. Ending the turn freezes the events-file mtime, and the forward fold treatedassistant.turn_endasDone. Past the 15s grace window the worktree showed a blue Done dot and dropped out of the Overview band's Reviewing group — even though the review agent was still actively working.Fix
Track outstanding background agents during the session scan in
CopilotDetector.fs:taskcall withmode: backgroundadds its agent id to the outstanding set.system.notificationof kindagent_idleremoves it.turn_endnow yieldsDoneonly when no background agents are still running; otherwise it yieldsWorking(depth-0 gated, same as skill detection).This keeps the red Working dot lit while background agents run, so the worktree stays in the Reviewing group.
Changes
src/Server/CopilotDetector.fs— track outstanding background agents; gateturn_endDone/Working on whether any remain.src/Tests/CopilotDetectorTests.fs— coverage for background-agent tracking and the turn_end Working/Done transitions.docs/spec/worktree-monitor.md— document the behavior.Tests
Added tests in
CopilotDetectorTests.fscovering the new tracking logic and turn_end gating.