Skip to content

agentHost: allow turns with unavailable subagent transcripts - #334312

Merged
roblourens merged 2 commits into
microsoft:mainfrom
roblourens:roblou/agents/fix-session-start-message-issue
Sep 3, 2026
Merged

agentHost: allow turns with unavailable subagent transcripts#334312
roblourens merged 2 commits into
microsoft:mainfrom
roblourens:roblou/agents/fix-session-start-message-issue

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

  • allow a parent turn to proceed when duplicate turn-ID validation encounters a restored subagent whose transcript is not available yet
  • keep unavailable child transcripts unresolved and retryable while preserving fail-closed behavior for other peer-chat resolution errors
  • add unit and whole-host E2E coverage for the original restore/send failure
  • document and gate the separate Copilot runtime custom-agent displayName/tools contract mismatch until the runtime fix is bundled

Root cause

A failed custom subagent left a restored child-chat summary without any child turns. Starting a later parent turn eagerly resolved every peer chat to validate turn-ID uniqueness. The empty child resolver threw, causing the otherwise unrelated parent chat/turnStarted action to be rejected before provider dispatch.

Validation

  • npm run typecheck-client
  • npm run transpile-client
  • targeted Copilot Agent Host E2E replay: 1 passing, 1 intentionally pending known-issue test
  • targeted AgentService unit tests: 3 passing

(Written by Copilot)

Do not reject a parent turn when restored subagent history is temporarily unavailable during duplicate turn-id validation. Keep the child resolver retryable and preserve strict validation for other peer-chat failures.\n\nAdd unit and whole-host E2E coverage for the recovery path, plus a gated test for the Copilot runtime custom-agent displayName contract mismatch.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 3, 2026 16:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused exception preserves retryability and fail-closed behavior, with appropriate unit and end-to-end coverage.

Review tier: Balanced
Findings: None

What changed in this PR

Allows parent turns to continue when a restored subagent transcript is temporarily unavailable, while retaining strict handling for other resolution failures.

Changes:

  • Introduces a retryable transcript-unavailable error path.
  • Adds unit and Copilot end-to-end regression coverage.
  • Documents the related runtime contract mismatch.
File Description
agentService.ts Skips unavailable subagent transcripts during turn-ID validation.
agentService.test.ts Tests parent dispatch and later transcript retry.
subagentSuite.ts Adds custom-subagent restore scenarios.
KNOWN_ISSUES.md Documents the Copilot runtime mismatch.
copilotcli-restored-…yaml Records the regression scenario’s model exchanges.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after current-head Copilot Code Review and GPT Luna found no security issue in the full PR patch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after manual review

@roblourens
roblourens enabled auto-merge (squash) September 3, 2026 17:02
@roblourens
roblourens merged commit 7949faf into microsoft:main Sep 3, 2026
30 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 3, 2026
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.

3 participants