[cherry-pick] agentHost: Fix sessions stuck in progress - #334876
Closed
Benjamin Christopher Simmonds (benibenj) wants to merge 2 commits into
Closed
[cherry-pick] agentHost: Fix sessions stuck in progress#334876Benjamin Christopher Simmonds (benibenj) wants to merge 2 commits into
Benjamin Christopher Simmonds (benibenj) wants to merge 2 commits into
Conversation
Match subagent stop hooks by invocation ID when the SDK provides the agent identity only in the start event input. Reuse the existing completion path so finished follow-up turns do not keep the session in progress. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix the Compile & Hygiene failure by checking that SDK hook input is a non-null, non-array object before reading agentId. Cover missing, primitive, array, and non-string inputs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Benjamin Christopher Simmonds (benibenj)
September 7, 2026 09:33
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed fix has no unresolved approval-blocking issues.
Review tier: Balanced
Findings: None
What changed in this PR
Cherry-picks a fix preventing resumed subagent sessions from remaining in progress.
Changes:
- Correlates stop-hook events by invocation ID.
- Validates hook input and reuses existing completion handling.
- Adds regression tests for malformed, overlapping, and duplicate events.
| File | Description |
|---|---|
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Adds regression coverage for correlation, malformed input, and duplicate completion. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Correlates subagent stop hooks and completes resumed turns. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge (squash)
September 7, 2026 15:39
auto-merge was automatically disabled
September 7, 2026 15:42
Pull request was closed
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.
Summary
Cherry-picks #334781 to
release/1.137.subagentStophook start and end events by invocation ID when the SDK omits the subagent ID from the end event.agentIdand cover overlapping and duplicate completion events.Validation
npm run transpile-client.\scripts\test.bat --run src\vs\platform\agentHost\test\node\copilotAgentSession.test.ts(432 passing)npm run eslint -- src\vs\platform\agentHost\node\copilot\copilotAgentSession.ts src\vs\platform\agentHost\test\node\copilotAgentSession.test.tsgit diff --check origin/release/1.137..HEAD