Skip to content

agentHost: update Copilot SDK to 1.0.17-preview.4 - #339423

Merged
roblourens merged 5 commits into
mainfrom
agents/upgrade-copilot-sdk-and-verify-tests
Oct 5, 2026
Merged

roblourens merged 5 commits into
mainfrom
agents/upgrade-copilot-sdk-and-verify-tests

Conversation

@roblourens

@roblourens roblourens commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Upgrades the root @github/copilot-sdk dependency from 1.0.17-preview.0 to 1.0.17-preview.4 and aligns copilotRuntimeVersion with the bundled 1.0.92-4 runtime. Updates the coupled remote-server dependency/runtime pins and refreshes both lockfiles using npm install from the root.

Preview.4 follow-up

  • Adds typed sandbox.proxyCa mocks to existing unit-test clients to match the SDK's expanded RPC contract; production types and behavior are not narrowed or changed.
  • Extends existing runtime-change-notice normalization to omit only standalone user messages consisting entirely of recognized runtime notices. Preview.4 intentionally sends a standalone mode-exit notice after plan approval; removing its text previously left an empty projected message that mismatched the older capture. New tests verify that authored text, empty user messages, assistant messages, and tool-result wiring remain checked. No prompt, AHP, or model fixture baselines changed for preview.4.
  • Enables the existing warm managed-telemetry policy-change E2E test. Preview.4 now passes its unchanged assertion that a second session exports its actual user message under the changed service identity without restarting the host; removes the obsolete known-issue gate.
  • Retains the test-owned 100ms telemetry batching correction from the earlier preview.3 investigation. This verifies native span generation/routing but is not proof that default packaged-Linux production export timing is unchanged.

Potential live plan-approval regression — keep this PR in draft: two live recording attempts on preview.4 continued into workspace edits after choosing exit_only (“Approve Plan Only”), causing the unchanged no-pending-confirmation assertion to fail. A like-for-like live run with preview.3 passed. Logs confirm that preview.4 received selectedAction: exit_only and returned explicit “wait for the user's next prompt” instructions before the live model attempted implementation. This is a possible SDK/model behavior regression, not a lost client selection; it remains unresolved. Failed recordings were not accepted, no baselines were rewritten, no assertions were relaxed, and no tests were newly skipped. Strict replay passes with the original recorded responses, so replay success does not establish that this live behavior is correct.

October 4 live approval root-cause investigation

The concern now has a stronger local reproduction and a controlled model-request experiment. These are local live-model diagnostics, not failed GitHub/Azure CI jobs:

  • Alternating the existing unmodified planning E2E test against the exact base SDK 1.0.17-preview.0 and candidate .4 on the same current host: base passed 3/3; candidate failed 2/3 by requesting implementation tools after exit_only. Original fixture bytes and candidate packages were restored after each diagnostic run; none of the recordings was accepted.
  • On the exact .4 runtime, a diagnostic HTTP relay changed only the trailing post-approval mode notice delivered to the live model. Unmodified requests attempted implementation 3/3; omitting only the notice made the model wait 3/3. Keeping the notice but adding an explicit sentence preserving the selected Approve Plan Only action made the model wait 3/3. All cases retained the same original user prompt, host approval response, and real runtime/tool execution. These finite-sample results establish a strong causal signal for the notice, not a guarantee that prompt wording alone is a complete fix.
  • Source trace at runtime commit f4385f4f118c567aa0178776aeb45e296e9e6733: apply_exit_plan_mode_approval switches exit_only to Interactive but does not arm implementation; build_approval_result correctly says to wait. Mid-turn autopilot_transition_tool_change_message nevertheless consumes the pending Plan-to-Interactive transition and injects a new user-role message after the tool result. mode_changed_notice says “Do not follow plan-mode-only instructions from earlier in the conversation” without retaining the selected approve-only decision. The interaction loop has no action-specific hard stop for exit_only, so compliance depends on the model after this trailing instruction.
  • This became default with github/copilot-agent-runtime#24157. A production correction belongs in the runtime: preserve approve-only semantics in the transition, ideally enforce the wait at the turn/tool boundary rather than relying solely on prose. The diagnostic relay is not installed in VS Code and is not presented as a bundled fix.

The PR remains draft until this behavior is resolved or explicitly accepted by the maintainer. Green replay CI does not establish correct live approval behavior.

Default native OTel export and shutdown controls

Using the exact released Linux-x64 .4 SDK/runtime in an isolated Node 24.18.0 container, with no OTEL_BSP_SCHEDULE_DELAY override and strict committed model-response replay:

  • Default periodic export produced the actual session-correlated invoke_agent span under github-copilot in 11.06s and 10.98s on two fresh executions.
  • Disconnecting/stopping before the first batch produced that span during shutdown in 101.7ms and 63.9ms respectively.
  • These verify native .4 default batching and draining, not an exact packaged VS Code Linux build: the nonpublishing Azure validation did not retain executable artifacts. Packaged Agent Host routing remains covered by the green cross-platform integration jobs using their test-owned batch schedule.
  • The initial minimal container lacked a CA trust store and could not build the runtime's HTTP client; installing only that container's CA certificates resolved the setup failure. No host-machine dependencies or production telemetry settings were changed.

Preview.4 local validation:

  • npm install — passed in the repository root; root and remote SDK/runtime pins match their installed packages.
  • npm run compile-client — passed after typed sandbox mocks were updated.
  • env -u COPILOT_HOME VSCODE_SKIP_PRELAUNCH=1 ./scripts/test.sh --runGlob '**/agentHost/test/node/{copilotAgent,copilotAgentSession,copilotSessionLauncher,modelRequestProjection}.test.js' — passed: 1,390 tests and 1 existing skip. An initial run with inherited COPILOT_HOME failed home-path assertions; the clean-environment run restores the suites' intended isolation.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --runGlob '**/agentHost/test/node/{providerIntegration/*,e2e/providers/copilotPromptsE2E,e2e/providers/codexAgentHostLive}.integrationTest.js' — passed: 68 tests and 6 existing skips.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotOtelAgentHostE2E.integrationTest.ts — passed: all 5 OTel tests, including the newly enabled warm-policy scenario.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts --grep 'planning-mode session-state writes are auto-approved in default mode' — strict replay passed after the narrow runtime-notice normalization.
  • Targeted ESLint and git diff --check — passed.
  • VSCODE_SKIP_PRELAUNCH=1 npm run test-agent-host-e2e — passed once with 836 tests before the warm-policy gate was removed; the warm scenario separately passed and now runs by default. Final full-suite repetitions under severe shared-machine load passed Copilot, Claude, and all 5 OTel scenarios, but had unchanged conformance/Codex startup/subscription timeouts. The failing restart scenarios passed in fresh isolated retries; the failed overall runs are not represented as successful full-suite results.
  • The initial 68-test provider/prompt run passed. A later repeat failed unchanged Codex customization cases: startup passed on isolated retry, but the plugin-MCP tool-advertising assertion still failed. No unrelated Codex code or test assertions were changed.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/codexAgentHostE2E.integrationTest.ts --grep 'session metadata history and provider context survive a host restart|Codex image attachments remain readable after a host restart' — isolated replay passed: 2 tests.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/conformance/agentHostConformance.integrationTest.ts --grep 'annotations remain synchronized without retaining the conversation across eviction and restart' — isolated replay passed: 1 test.

Preview.4 packaged validation 480447 passed Electron integration tests on Windows, Linux, and macOS, including the five OTel scenarios, but failed the Linux/Windows Dev Container smoke suites.

CI correction: align with the published container host

All three failing smoke scenarios (local Dev Container, SSH Dev Container, and WSL Dev Container) were rejected at the AHP initialize handshake before reaching any SDK/model turn: this branch's client offered 0.9.0 and older versions, whereas the latest downloaded host requires 0.10.0. This is not an SDK no-response failure. Upstream adopted the AHP 0.10 implementation in #337780 on October 2.

With maintainer approval, merged current origin/main rather than fabricating protocol compatibility or weakening the smoke assertions. Merge commit bf61fa7241e preserves SDK 1.0.17-preview.4 and runtime 1.0.92-4. Resolved the upstream telemetry expected-failure conflict by retaining this SDK's successful warm-policy assertion, strict replay consumption, and test-owned batch scheduling; the formerly broken warm scenario is not reverted to an expected failure.

  • npm run compile-client — passed after the merge, zero errors.
  • Commit hygiene — passed across the merged changes.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotOtelAgentHostE2E.integrationTest.ts — fresh isolated retry passed: 5 tests.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/claudeAgentHostE2E.integrationTest.ts --run src/vs/platform/agentHost/test/node/e2e/providers/codexAgentHostE2E.integrationTest.ts --run src/vs/platform/agentHost/test/node/e2e/conformance/agentHostConformance.integrationTest.ts --grep 'workspace lifecycle: peer tools execute in their selected folder|a created automation survives an agent host restart' — passed: 3 exact retries after shared-host startup/create-session timeouts in the parallel full local run.
  • Full local E2E attempt after merge passed Copilot and Copilot managed settings, but failed other entrypoints on startup/create-session timeouts; isolated retries above passed. The overall failed local run is not represented as a successful suite.

Code OSS run 37241348668 passed on merge commit bf61fa7241e, including Windows/Linux/macOS Electron smoke and integration jobs. All accompanying GitHub workflows passed.

Replacement Azure build 480465 passed packaged Electron smoke and integration tests on Windows/Linux/macOS. Downloaded task logs confirm every previously failed container scenario actually ran and passed: local Dev Container (98.9s), SSH Dev Container (23.7s), and WSL Dev Container (52.6s). The matching-host protocol fix did not skip these tests or relax their response assertions.

The build initially failed because the Windows integration job exceeded its 50-minute job limit during post-test Component Governance, after the integration task and test-pass checkpoint had succeeded. Retried only that canceled Windows job, which reused its successful test checkpoint and completed finalization. Build 480465 is now succeeded on bf61fa7241e; that checkpoint reuse is not counted as an additional test execution. No code, assertions, or job timeouts were changed to conceal the infrastructure/finalization failure.

All build/test CI checks are now green; only the draft/review-policy VS Code PR Check remains pending. The potential live exit_only plan-approval behavior remains separately documented above and is not resolved merely by green deterministic CI. Previous preview.3 CI results below are historical, not validation of this revision.

Preview.3 baseline assessment (earlier revision)

The complete deterministic E2E suite passed without changes to AHP snapshots or recorded model fixtures. The additional prompt suite initially failed on all 19 model baselines. Generated replacement baselines were reviewed structurally across every model and contain only:

  • Updated write_agent guidance and its message parameter description: a message steers a running agent at the next processing opportunity instead of queuing a new turn; idle-agent behavior is unchanged.
  • Alphabetically ordered task.model enum values, with no change to the available model set.

System prompts, tool inventories, other schemas, and request metadata are unchanged. These are SDK-owned request changes, not observed Agent Host regressions. No assertions were relaxed and no tests were newly skipped. The regenerated baselines passed a fresh replay without update flags.

Preview.3 validation (earlier revision)

Local macOS validation:

  • npm install — passed in the repository root.
  • npm run compile-client — passed after aligning the bundled runtime pin.
  • VSCODE_SKIP_PRELAUNCH=1 npm run test-agent-host-e2e — passed: all five entrypoints (conformance, Claude, Codex, Copilot, Copilot OTel), 836 passing and 111 existing skips.
  • AGENT_HOST_UPDATE_AHP_SNAPSHOTS=1 VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotPromptsE2E.integrationTest.ts — passed: 24 tests; regenerated and reviewed the 19 prompt baselines.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --runGlob '**/agentHost/test/node/{providerIntegration/*,e2e/providers/copilotPromptsE2E,e2e/providers/codexAgentHostLive}.integrationTest.js' — passed after baseline refresh: 68 passing and 6 existing skips. Includes all synthetic-provider integration entrypoints and the additional E2E entrypoints. Credentialed/live-only scenarios remain under their existing gates.
  • git diff --check and the commit hygiene hook — passed.
  • npm run hygiene — passed, including the root/remote dependency-consistency check and all 12,894 source files.
  • TMPDIR="$PWD/.build/sdk-test-temp" npm run test-build-scripts — passed: 624 tests. The default macOS temporary path initially exposed a pre-existing /var versus /private/var URL assertion; using an isolated canonical temporary path avoids that unrelated failure without modifying the test.

The first CI quality checks correctly caught a missing remote-server pin update; the follow-up commit aligns it. The complete local E2E suite passed again on the final revision. A repeat of the additional provider suites intermittently failed the unchanged Codex MCP tool-advertising assertion; both an isolated retry and a subsequent full run passed (68 passing, 6 existing skips), with no test changes.

SDK-only revision CI (d9277521a6d):

  • Code OSS run 37079243730 — passed, including Windows, Linux, and macOS Electron integration tests. Downloaded job logs confirm that every Agent Host E2E entrypoint actually ran and passed on each platform, rather than being skipped by change classification.
  • Component Fixtures, Monaco Editor checks, chat-lib tests, Telemetry, and CodeQL — passed.
  • Azure packaged validation 480074 — failed: quality checks, Windows x64 integration tests, and macOS ARM64 integration tests passed, but Linux failed the OTel file-exporter test on both the initial execution and an isolated rerun of only the failed integration job on the same commit. Publishing and release are disabled. The CI template selects macOS ARM64 runners despite the product-build x64 parameters.

OTel investigation and test-isolation correction

The packaged Linux test provider turn exports SDK spans through the Agent Host file exporter reproducibly reports that SDK spans did not reach the export file. Host session/title/timing spans are present, but the required native invoke_agent span and github-copilot service are absent. Both attempts passed every other deterministic Agent Host E2E entrypoint, including all other Copilot scenarios. The same OTel suite passed locally and in GitHub Linux, Windows, and macOS CI.

This is not a model fixture or prompt-baseline mismatch. An isolated Linux SDK reproduction using the same recorded no-tool response showed that both the previous SDK (1.0.17-preview.0) and the upgraded SDK (1.0.17-preview.3) export the native invoke_agent span and github-copilot service successfully, but their first default batch arrives about 10 seconds after startup (10,095ms and 10,121ms respectively). The native exporter implementation is unchanged between these versions. That leaves the existing 10-second polling window exposed to batching and runner contention.

Reproduced the identical missing-native-span failure locally by running the unchanged test with inherited OTEL_BSP_SCHEDULE_DELAY=30000. With an explicit 100ms batch schedule, the standalone Linux exporter delivered the real spans at about 340ms and the full unchanged AHP OTel suite passed.

The follow-up commit sets OTEL_BSP_SCHEDULE_DELAY=100 only in both OTel suites' isolated child environments and documents why. Production telemetry behavior, the parent environment, polling deadlines, span assertions, baselines, and gates are unchanged. The test still requires native SDK invocation spans to traverse the real Agent Host pipeline and reach the file.

Follow-up local validation:

  • npm run transpile-client — passed.
  • OTEL_BSP_SCHEDULE_DELAY=30000 VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotOtelAgentHostE2E.integrationTest.ts — passed after isolation: 4 passing and 1 existing known-issue skip, proving a longer parent schedule no longer affects the suite.
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotOtelAgentHostE2E.integrationTest.ts — passed: 4 passing and 1 existing skip.
  • VSCODE_SKIP_PRELAUNCH=1 npm run test-agent-host-e2e — passed again: all five entrypoints, 836 tests. Copilot OTel completed in 12.8 seconds.
  • npm run eslint -- src/vs/platform/agentHost/test/node/e2e/providers/copilotOtelAgentHostE2E.integrationTest.ts and commit hygiene — passed.

Azure packaged validation 480123 and fresh repeat build 480139 both succeeded on the correction (ddb4c2d8079), including quality checks and all Electron integration tests on Windows x64, Linux x64, and macOS ARM64. Downloaded task logs confirm the unchanged native-span assertion actually ran and passed in both fresh builds on every platform; same-build checkpoint-skipped stage reruns were excluded from this count. The timing-sensitive correction therefore has two clean packaged executions per supported platform.

No new GitHub Actions workflow has been triggered for this follow-up; the SDK-only revision's GitHub workflow results above are not represented as validation of this later commit. Both fresh cross-platform Azure builds validate the actual latest commit.

For context, Rob Lourens added the file-exporter scenario on August 6, 2026 in #329333. Ross A. Wollman adjusted the shared OTel test setup for managed telemetry and inherited TLS configuration on October 2, 2026. The scenario was not introduced by this SDK upgrade.

(Written by Copilot)

Align the bundled runtime pin with 1.0.92-3 and refresh prompt snapshots for updated write_agent steering guidance and deterministic task model ordering.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:19

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

🟡 Changes recommended

The remote-server manifest and lockfile still package the previous SDK and runtime versions.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates the desktop Agent Host to Copilot SDK 1.0.17-preview.3 and runtime 1.0.92-3.

Changes:

  • Updates root SDK/runtime dependencies and lockfile.
  • Refreshes 19 model prompt snapshots for steering semantics.
  • Alphabetizes model enums without changing their contents.
File Description
package.json Updates desktop SDK/runtime pins.
package-lock.json Resolves updated SDK platform packages.
...prompts_gpt-5.prompt.md Refreshes GPT-5 prompt baseline.
...prompts_gpt-5-mini.prompt.md Refreshes GPT-5 Mini baseline.
...prompts_gpt-5-codex.prompt.md Refreshes GPT-5 Codex baseline.
...prompts_gpt-5_6-terra.prompt.md Refreshes Terra baseline.
...prompts_gpt-5_6-sol.prompt.md Refreshes Sol baseline.
...prompts_gpt-5_6-luna.prompt.md Refreshes Luna baseline.
...prompts_gpt-5_1.prompt.md Refreshes GPT-5.1 baseline.
...prompts_gpt-5_1-codex.prompt.md Refreshes GPT-5.1 Codex baseline.
...prompts_gpt-5_1-codex-mini.prompt.md Refreshes Codex Mini baseline.
...prompts_gemini-2_0-flash.prompt.md Refreshes Gemini baseline.
...prompts_claude-sonnet-5.prompt.md Refreshes Sonnet 5 baseline.
...prompts_claude-sonnet-4_6.prompt.md Refreshes Sonnet 4.6 baseline.
...prompts_claude-sonnet-4_5.prompt.md Refreshes Sonnet 4.5 baseline.
...prompts_claude-opus-5.prompt.md Refreshes Opus 5 baseline.
...prompts_claude-opus-5_5.prompt.md Refreshes Opus 5.5 baseline.
...prompts_claude-opus-4_7.prompt.md Refreshes Opus 4.7 baseline.
...prompts_claude-opus-4_6.prompt.md Refreshes Opus 4.6 baseline.
...prompts_claude-opus-4_5.prompt.md Refreshes Opus 4.5 baseline.
...prompts_claude-haiku-4_5.prompt.md Refreshes Haiku baseline.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json Outdated
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: d9e6a014 Current: ca122a92

Changed (2)

sessions/accountMenu/WeeklyAndFiveHourLimits/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/DiscoverPluginsLoadingMore/Light
Before After
before after

1 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Keep the remote server dependency in sync with the root SDK upgrade as required by the repository hygiene check.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens and others added 2 commits October 2, 2026 19:10
Use a test-owned 100ms native span batch interval so default or inherited scheduling cannot exhaust the bounded export-readiness wait. Preserve the existing span assertions and wait deadline in both telemetry suites.

Verified that the previous and upgraded SDK both defer the first default Linux export by about 10 seconds. Reproduced the missing-span failure with a long inherited schedule; the unchanged assertions pass after isolating the child schedule.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Align root and remote runtime pins with 1.0.92-4, adapt typed sandbox RPC mocks, normalize standalone runtime change notices, and restore warm managed-telemetry regression coverage.

Keep the upgrade in draft: live exit-only plan approval continued into edits twice with preview.4, while a preview.3 live control passed. Deterministic replay does not establish that the live behavior is correct.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens changed the title agentHost: update Copilot SDK to 1.0.17-preview.3 agentHost: update Copilot SDK to 1.0.17-preview.4 Oct 4, 2026
Adopt the upstream AHP 0.10 client implementation required by the latest published Dev Container host. Preserve Copilot SDK 1.0.17-preview.4/runtime 1.0.92-4 and its successful warm-policy telemetry regression coverage when resolving upstream expected-failure conflicts.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens
roblourens marked this pull request as ready for review October 5, 2026 03:39
@roblourens
roblourens enabled auto-merge (squash) October 5, 2026 03:39
@roblourens
roblourens merged commit 6456d37 into main Oct 5, 2026
62 checks passed
@roblourens
roblourens deleted the agents/upgrade-copilot-sdk-and-verify-tests branch October 5, 2026 03:43
@vs-code-engineering vs-code-engineering Bot added this to the 1.141.0 milestone Oct 5, 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