[pull] main from microsoft:main#1397
Merged
Merged
Conversation
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>
Remove Agents sanity tests
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 : )