Repository navigation
[Perf] agentHost: reduce Mission Control relay overhead - #341223
Merged
Merged
Conversation
Pipeline up to four fragments of one relay payload while preserving acknowledgement barriers between whole messages, connection generations, bounded outstanding bytes and failure handling. Add typed publication diagnostics and host-wide performance/error summaries limited to one event every five minutes across relay reconnects. Include background mirroring while connected to Mission Control, keep idle periods silent, and reuse existing MC client identity telemetry. Cover ordering, out-of-order acknowledgements, timeouts, queue accounting, failure handling, service lifecycle and telemetry-rate limits with focused regressions. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The timing-sensitive transport and telemetry lifecycle changes warrant human review despite strong focused coverage.
0 open findings
What changed in this PR
Pipelines Mission Control payload fragments while preserving payload ordering and adds bounded publication diagnostics and telemetry.
Changes:
- Allows four fragments within a 4 MiB in-flight window.
- Adds queue, acknowledgement, failure, and connection telemetry.
- Expands protocol, telemetry, identity, and lifecycle tests.
| File | Description |
|---|---|
connectionDiagnostics.ts |
Supports typed diagnostic observers. |
missionControlProtocolServer.ts |
Implements fragment pipelining and diagnostics. |
missionControlEnvironment.ts |
Forwards current-server diagnostics. |
missionControlHost.ts |
Aggregates and emits publish telemetry. |
MISSION_CONTROL.md |
Documents pipelining and telemetry behavior. |
missionControlProtocolServer.test.ts |
Tests scheduling, limits, failures, and diagnostics. |
missionControlHost.test.ts |
Tests telemetry aggregation and emission budgets. |
protocolServerHandler.test.ts |
Verifies Mission Control client identity telemetry. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Compare active-client snapshots without undefined object properties at both reconciliation boundaries, preserving actual metadata changes and array ordering. Omit absent bundler metadata and cover optimistic updates, JSON echoes, and unacknowledged publications. Co-authored-by: Copilot <[email protected]>
roblourens
marked this pull request as ready for review
October 13, 2026 16:05
roblourens
enabled auto-merge (squash)
October 13, 2026 16:05
Anthony Kim (anthonykim1)
approved these changes
Oct 13, 2026
Don Jayamanne (DonJayamanne)
added a commit
that referenced
this pull request
Oct 13, 2026
…xploration-vscode * origin/main: (40 commits) MSRC fixes (#341342) chat: render input attachments for the input model's session (#341350) chat: center subagent tool activity hooks (#341258) Manage Copilot plugin marketplaces through Agent Host (#341301) fix: linux setuid sandbox helper permissions (#341292) agentHost: resolve #chat chips on the host of the chat that shows them (#341332) [Perf] agentHost: limit archived sessions over Mission Control (#341327) Remember expanded state for "Other Models" in model picker (#341335) Offer Stop for copilot detached background shells (#341310) agentHost: allow inherited peer chats to move workspaces (#341317) [Perf] agentHost: reduce Mission Control relay overhead (#341223) Fix Customizations modal spacing (#341144) Fix dependency cycle in QuickInputService and EditorResolverService (#341321) Fix Explorer refresh on restoring deleted workspace root folder (#341323) chat: Share and rate-limit core utility model requests (#340100) agentHost: open #chat chips on the connection that owns the chat (#341313) Fix flaky StorageMainService tests by awaiting storage warm-up (#341305) agentHost: record the default chat role instead of reading the default chat URI shape (#341293) welcome: preserve tab icon color with Modern Icons Fix flaky test in diskFileSystemProvider.test.ts (#341304) ... # Conflicts: # src/vs/platform/agentHost/node/agentService.ts # src/vs/platform/agentHost/node/protocolServerHandler.ts # src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts # src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts
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
Pipeline fragments of one Mission Control relay payload instead of waiting for a Web PubSub acknowledgement after every fragment. Up to four fragments can be in flight within a 4 MiB window. The next whole payload still waits for every fragment's acknowledgement, preserving ordering across response/notification groups, closure notices, and connection generations. Outstanding queue limits include in-flight frames and bytes, and acknowledgement timeouts follow the oldest outstanding frame.
Add metadata-only trace diagnostics and
agentHost.missionControlPublishSummarytelemetry. Summaries aggregate publication bytes/counts, queue wait, acknowledgement latency, queue high-water marks, and bounded failure/backpressure counters. There is one shared five-minute emission budget per host across clients, mirroring, errors, and reconnects. Performance is eligible while connected to the MC service, including background mirroring; idle periods emit nothing. Errors may report without a connection under the same cap. No payloads, paths, group names, credentials, or client/session identifiers are included.Existing
agentHost.clientConnectiontelemetry is reused for MC client identity; regression coverage verifies the transport-observed MC route and optional declared names. This does not add iOS identification: clients must supplyclientInfofor that.Fix a redundant
session/activeClientSetpublication loop discovered during the live soak. Reconciliation compares both the echoed host snapshot and the last published snapshot with scoped equality that recursively ignores undefined object properties, as JSON does, while preserving null, actual values, and ordered arrays. Object-key insertion order does not affect equality. Global object equality and protocol schemas are unchanged. The customization bundler also omits absent_meta; actual standalone/MCP metadata is retained. Correctness no longer depends on each producer omitting every optional property.No associated issue. Per-client scheduling, mirror batching, and mobile lazy/concurrent file fetching are out of scope.
Performance evidence
A controlled read-only comparison exercised the baseline and candidate publisher against real relay service acknowledgements using an inert 8 MiB payload: 13 fragments, approximately 11.19 MB of serialized relay traffic, three interleaved samples per implementation.
This measures publication through service acceptance, not mobile receipt/rendering. It does not demonstrate that chunk pipelining alone fixes the original mobile changes-loading delay.
Live reliability soak
Collected 90.13 minutes of measured workloads using two isolated Code OSS instances, real Copilot sessions, and two read-only relay load clients: a 65-minute baseline/candidate comparison, a 15-minute experimental duplicate-suppression phase, and a 10-minute confirmation running the actual bundler source fix with experimental suppression removed.
The primary comparison changed the fragment window between one and four on the same production publisher at payload boundaries, not between complete old/new application builds. The repeated changes workload loaded 17 synthetic files totaling approximately 7.32 MB per complete batch. Phase counts were unequal; latency distributions include only complete batches, while failures remain in reliability counters.
The subsequent reconciliation-boundary hardening is covered by failed-before/passed-after tests; another long live soak was not run after adding that comparator.
Validation
The original relay change was rebased onto
origin/main; its signed commit and pre-commit hygiene passed. Its Code OSS CI run also passed.npm run transpile-client— passed after rebase and again for the reconciliation follow-up.The following relay suites — 558 passed, 4 pending after rebase:
Relay changed-TypeScript lint — passed:
Telemetry extractor check — passed after rebase: verified owner, exact field set, and all 19 numeric measurement classifications.
git diff --check origin/main...HEAD— passed for the original relay change;git diff --check— passed for the reconciliation follow-up.npm run typecheck-client— passed before rebase. Standard local invocation after rebase and at follow-up remained blocked by the pre-existing shared SDK mismatch: upstream launcher code/tests requireimageGenerationfields absent from the shared installed SDK.npm run build-fast -- --client-only— blocked by the same pre-existing dependency mismatch: this checkout declares Copilot runtime1.0.96-2; the current shared SDK bundles1.0.95-0. Shared dependencies were not changed.Reconciliation follow-up validation
These boundary regressions failed before the comparator fix for both optimistic local state and last-published state, then passed after:
./scripts/test.sh \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts \ --grep 'active-client reconciliation' --reporter dotAffected customization/tool suites — 157 passed:
./scripts/test.sh \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostClientTools.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/syncedCustomizationBundler.test.ts \ --grep 'AgentHostChatContribution customizations|AgentHostClientTools|SyncedCustomizationBundler' \ --reporter dotFull client typecheck — passed with SDK
1.0.20-preview.2installed only in an isolated temporary directory. The temporary config extendedsrc/tsconfig.json, retained the Electron paths, setrootDirtosrc, and mapped the two Copilot SDK imports to the matching isolated declarations:Follow-up changed-TypeScript lint — passed:
Tests cover bounded fragment pipelining, out-of-order/duplicate ACKs, whole-message ordering, failures/timeouts, connection replacement, queue/mirror limits, service connection eligibility, idle suppression, 10,000 publishes, and repeated error/reconnect storms without exceeding the telemetry cap. Follow-up coverage includes absent/nested undefined metadata, repeated JSON echoes, reordered object keys, null/primitive/array changes, opaque host session URIs, and fresh/reused/updated ordinary/standalone/MCP bundles.
Full smoke/E2E suites and live mobile end-to-end rendering were not run.
(Written by Copilot)