Skip to content

[pull] main from microsoft:main#1397

Merged
pull[bot] merged 20 commits into
KingDEV95:mainfrom
microsoft:main
May 8, 2026
Merged

[pull] main from microsoft:main#1397
pull[bot] merged 20 commits into
KingDEV95:mainfrom
microsoft:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 8, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

mjbvz and others added 20 commits April 30, 2026 23:35
Fixes #313661

Hopefully cuts down on some of the double submissions we've been seeing

Co-authored-by: Copilot <copilot@github.com>
…doc alignment (#315136)

* agentHost/claude: Phase 6.1 — auth, model config, mapper, lifecycle, doc alignment

Phase 6.1 lands the architectural follow-ups identified after Phase 6's
sendMessage shipped. Eight tightly-scoped cycles (A–G) plus a stateless-mapper
cleanup, all backed by an exhaustive M1–M13 mapping of the IAgent ↔ Claude SDK
surface in CONTEXT.md.

Cycle summary
-------------
- A: CONTEXT.md mapping doc — the M1–M13 portrait of IAgent ↔ Claude SDK.
- B: Auth — `createSession` / `_materializeProvisional` throw
  `ProtocolError(AHP_AUTH_REQUIRED, …, getProtectedResources())` instead of a
  plain `Error`, so the workbench surfaces the sign-in flow (mirrors
  `copilotAgent.ts:382-385`).
- C: Turn.id = SDK uuid invariant — the host yields `SDKUserMessage.uuid =
  effectiveTurnId`, single-namespace contract documented as a glossary entry.
- D: `getSessionMetadata?` per-session lookup; `listSessions` overlay read
  refactored onto `_readSessionMetadata`.
- E: Permission-mode enum widened from 4-value to 6-value canonical (adds
  `dontAsk`, `auto`); `Options.model` / `Options.permissionMode` / effort flow
  through to the first `query()`; `_writeSessionMetadata` persists model +
  permission mode alongside the customization-directory key.
- F: Mapper widening — `'assistant'` is canonical at the SDK seam, with
  reconciliation against `stream_event` partials so deltas + final message no
  longer double-emit. `tool_use` blocks on the canonical envelope warn through
  defense-in-depth instead of silently leaking.
- E2/E5/E6 + C2: `IClaudeModelConfig` (`createClaudeThinkingLevelSchema`,
  `isClaudeEffortLevel`, `resolveClaudeEffort`) — pulled out as a stateless
  helper so the mapper / agent / model picker share one effort-level vocabulary.
- G: Doc-alignment pass on `roadmap.md`, `phase5-plan.md`, `phase6-plan.md`
  driven by a 3-reviewer council pass. Resolves 10 drift items (see CONTEXT
  `ai-customization` / Phase 6.1 plan §"Cycle G — Stale phase-plan + roadmap
  refresh"); CONTEXT.md is the truth oracle and is unchanged.

Files
-----
- New helpers + tests:
  `src/vs/platform/agentHost/common/claudeModelConfig.ts`,
  `src/vs/platform/agentHost/test/common/claudeModelConfig.test.ts`,
  `src/vs/platform/agentHost/test/node/claudeMapSessionEvents.test.ts`,
  `src/vs/platform/agentHost/test/node/claudeMapSessionEventsTestUtils.ts`.
- Plans: `phase6.1-plan.md` (the executed plan), `phase7-plan.md` (the next
  phase, drafted; not landing in this PR).
- Touched code: `claudeAgent.ts`, `claudeAgentSdkService.ts`,
  `claudeAgentSession.ts`, `claudeMapSessionEvents.ts`,
  `claudeSessionConfigKeys.ts`.
- Touched docs: `CONTEXT.md` (new — full M1–M13 mapping), `roadmap.md`,
  `phase5-plan.md`, `phase6-plan.md`.

Verification
------------
- `npm run compile-check-ts-native`: 0 errors.
- Affected test suites: 72/72 pass (`claudeAgent.test.ts` +
  `claudeModelConfig.test.ts` + `claudeMapSessionEvents.test.ts`).

Risk
----
- Sidecar schema change: legacy sidecars without the `model` field default to
  `undefined`; tolerated.
- Transcript discontinuity at Cycle C: sessions written before this PR have
  SDK-random uuids; one-time discontinuity expected, no migration.
- Permission-mode enum widening: existing `'default' / 'acceptEdits' /
  'bypassPermissions' / 'plan'` values remain valid; new values are additive.
- Doc-only Cycle G changes carry no behavioral risk.

Phase 7 (tools / permission / user input) and Phase 6.5 (fork) are not in this
PR. See the in-tree plans.

* phase5-plan: correct canonical permissionMode enum values

Fix the Cycle G status note: the enum is 'default' | 'acceptEdits' |
'bypassPermissions' | 'plan' | 'dontAsk' | 'auto' (matching ClaudePermissionMode
in claudeSessionConfigKeys.ts and the SDK's PermissionMode typedef), not the
'acceptAll' / 'denyAll' values previously listed. Addresses Copilot review
comment on PR #315136.
Ensures agent host sessions keep chat-model pending requests synchronized when an existing session is restored while a turn is already active.

- Starts pending-message sync for restored agent-host sessions, including when the chat model is created after session content is provided.
- Treats same-id steering and queued pending-message text changes as protocol upserts so edited pending requests are sent to the backend.
- Adds regression coverage for restored active sessions and queued pending-message text updates.

Fixes #314824

(Commit message generated by Copilot)
* Derive worktree branch name from first message on agent host

In remote agent host worktree mode, the generated branch was just a
GUID because the eager-create path never sent a branchNameHint. Rather
than plumb a hint from the client, derive it on the agent host from
the first message itself.

- Add getCopilotBranchNameHintFromMessage in copilotAgent.ts
- Plumb prompt through sendMessage -> _materializeProvisional ->
  _resolveSessionWorkingDirectory
- Remove SessionConfigKey.BranchNameHint and the client-side
  getAgentHostBranchNameHint plumbing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add unit tests for getCopilotBranchNameHintFromMessage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix possibly-undefined access in branch name hint test

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix legacy Copilot CLI remote routing

Route known Copilot CLI slash commands through the legacy chat session path before falling back to prompt handling. Allow /remote with arguments to run as a control command from untitled sessions without swapping the untitled item.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Better craft Copilot CLI identity in VS Code

* match wording

* use customize

* remove ugly `as const`

* Simplify prompt

* Add sprinkle of text
…X, and CURRENT_TIMEZONE_NAME (#315140)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Disable issue reporter submit button while the issue is being submitted
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators May 8, 2026
@pull pull Bot added the ⤵️ pull label May 8, 2026
@pull pull Bot merged commit c15ec12 into KingDEV95:main May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants