ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
onElicitation translation)> Generated by super-planner. Source: roadmap.md (phase 10.6). > Last updated: 2026-07-14 after implementation (super-implementer).
Status: implemented
Replace the Phase-7 onElicitation cancel stub with a real translation so that when an MCP server (the host's own in-process server, or a third-party server surfaced by the Phase 16/17 disk scan) calls elicit/create, the request is surfaced to the user instead of being silently auto-cancelled. Elicitation routes through the structured user-input channel that AskUserQuestion already uses (ClaudeAgentSession.requestUserInput → ActionType.ChatInputRequested → respondToUserInputRequest), not the pending_confirmation permission gate (design locked in CONTEXT.md:632). The user's answer is delivered back to the server as an ElicitResult ({ action: 'accept' | 'decline' | 'cancel'; content? }).
In scope
claudeElicitation.ts (sibling to claudeInteractiveTools.ts): JSON-Schema → ChatInputQuestion[] and workbench answers → ElicitResult.content, plus a result mapper and a cancelResult() helper. Unit-testable without an agent.
requestUserInput, observes the SDK per-request signal, and maps the response back to an ElicitResult.
canUseTool: IBuildOptionsInput field → Options.onElicitation projection in buildOptions; IMaterializeContext field; _makeOnElicitation closure in ClaudeAgent; removal of the logElicitation param and the inline stub.
form mode (schema → questions) and url mode (question-less requestcarrying the URL).
unit tests for the projection module.
Out of scope
SDKElicitationCompleteMessage (elicitation_complete) in the message router. onElicitation awaits the returned promise and the renderer resolves URL prompts via the existing ChatInputCompleted path; the out-of-band completion notification is not required for this phase (see Decisions). If a later phase needs true out-of-band URL completion, it owns that router work.
parentToolCallId). Elicitation carries no agentID, so requests route to the top-level session only.
IAgent public surface, the renderer's chat-input widget, or the protocol ChatInputRequest shape (all already support url + questions).
requestUserInput / respondToUserInputRequest / _pendingUserInputsmachinery) — done.
ClaudeAgentSession lifecycle, in-process MCPserver) — done.
codex/codexElicitationMapper.ts + test/node/codex/codexElicitationMapper.test.ts — same protocol types (ChatInputRequest, ChatInputQuestion, ChatInputAnswer), same three modes, same helper shape, snapshot-style tests. Closest mirror.
codex/codexAgent.ts _handleElicitationRequestRpc (codexAgent.ts:1356) — fresh uuid, park on registerAndFire, map back, cancel-on-teardown.
claudeCanUseTool.ts:88-100._handleElicitationRequest(copilotAgentSession.ts:2239).
Mirror the established Claude split: a pure claudeElicitation.ts owns schema↔questions and answers↔content projection (modeled on codexElicitationMapper.ts, adapted for the Claude SDK's untyped requestedSchema: Record<string, unknown>), and a bridge claudeElicitationBridge.ts owns session lookup, the requestUserInput park, SDK signal abort wiring, and ElicitResult mapping (modeled on claudeCanUseTool.ts). The bridge is wired through the SDK options the same way canUseTool is: a new IBuildOptionsInput.onElicitation field is projected onto Options.onElicitation in buildOptions, threaded via IMaterializeContext, and produced by a ClaudeAgent._makeOnElicitation closure at every materialize/rematerialize call site. The logElicitation param and the inline { action: 'cancel' } stub are deleted.
1. ✓ Create the pure projection module `claudeElicitation.ts`.
src/vs/platform/agentHost/node/claude/claudeElicitation.ts (create)Record<string, unknown> → { properties: Record<string, ParsedField>; required: Set<string> }, guarding every access with typeof/hasKey checks so a malformed third-party schema cannot throw.
buildElicitationQuestions(schema) → ChatInputQuestion[] (field nameis the stable question id — reuse the codex pattern).
buildElicitationContent(schema, answers) → Record<string, ElicitationFieldValue> where ElicitationFieldValue = NonNullable<ElicitResult['content']>[string] (derive from the SDK type, as copilot does — avoids a raw unknown); omit skipped/missing/uncoercible answers.
elicitationFieldToQuestion / elicitationAnswerToValue covering boolean, number, integer, string (plain / enum (+enumNames) / oneOf / format), and array (enum / anyOf) — port coverage from codexElicitationMapper.ts:104-177 and copilotAgentSession.ts:185-286.
buildElicitationResult(request, response, answers) → ElicitResult: Decline → { action: 'decline' }; non-Accept → { action: 'cancel' }; Accept → { action: 'accept', content } (content only for form mode) — modeled on codex's elicitationResponseFromAnswers. Plus a standalone cancelResult() for the no-session early return (single helper — no separate declined variant, per Decisions).
ChatInputRequest.url is a URI (state.ts:368): convert the SDK's url: string with URI.parse in the url-mode branch.
npm run typecheck-client passes and the module has no imports of ClaudeAgentSession or any SDK callback type (pure).
2. ✓ Create the bridge `claudeElicitationBridge.ts`.
src/vs/platform/agentHost/node/claude/claudeElicitationBridge.ts (create)handleElicitation(deps, sessionId, request, options) where deps is IClaudeElicitationDeps { getSession } (narrower than IClaudeCanUseToolDeps — no configurationService, since there is no unattended auto-cancel), request is the SDK ElicitationRequest, and options is { signal: AbortSignal }. Logic:
deps.getSession; if absent return cancelResult() ({ action: 'cancel' } — per Decisions, no-session is a cancel, not a decline).
requestId = generateUuid().ChatInputRequest via step-1 projections (form → questions; url → question-less + url).
options.signal.aborted return { action: 'cancel' }; else add an abort listener calling session.respondToUserInputRequest(requestId, ChatInputResponseKind.Cancel), removed in finally (mirror claudeCanUseTool.ts:88-100).
session.requestUserInput(request) (no parentToolCallId).{ response, answers } → ElicitResult: Accept → `{ action: 'accept', content } (content only for form mode), Decline → { action: 'decline' }, anything else → { action: 'cancel' }`.
3. ✓ Add `onElicitation` to `IBuildOptionsInput` and project it; delete the stub.
claudeSdkOptions.ts (modify)readonly onElicitation: OnElicitation; beside canUseTool (~line 34). In buildOptions, remove the logElicitation parameter and replace the inline onElicitation stub (lines 123-126) with onElicitation: input.onElicitation.
claudeSdkOptions.test.ts compiles after its buildOptions call sites drop the logElicitation arg (see step 8).
4. ✓ Thread `onElicitation` through `IMaterializeContext` and both build sites.
claudeAgentSession.ts (modify)readonly onElicitation: OnElicitation; to IMaterializeContext (~line 59). Pass onElicitation: ctx.onElicitation into the buildOptions input at the initial materialize (~line 449) and the resume rebuild (rebuildOptions, ~line 539). Remove both logElicitation lambdas (line 459 and the resume-rebuild equivalent).
npm run typecheck-client passes.5. ✓ Add `_makeOnElicitation` in `ClaudeAgent` and pass it at every materialize.
claudeAgent.ts (modify)_makeOnElicitation(sdkSessionId) beside _makeCanUseTool (line 969), returning (request, options) => handleElicitation({ getSession: id => this._findSessionBySdkId(id) }, sdkSessionId, request, options). Add onElicitation: this._makeOnElicitation(sessionId) to the materialize context at all three call sites (lines 1002/1005, 1077/1080, 1430/1432).
npm run typecheck-client passes; claudeAgent.integrationTest.ts"canUseTool / onElicitation closures wired through" still finds a function.
6. ✓ Replace Phase-7 Test 18 stub assertions with real-translation assertions.
test/node/claudeAgent.test.ts (~line 5358), test/node/claudeAgent.integrationTest.ts (~line 737)Options.onElicitation directly (unit: ctx.sdk.capturedStartupOptions[0].onElicitation; integration §5.3: startup.onElicitation, currently asserting { action: 'cancel' }). Rework the round-trip: invoke onElicitation with a form-mode request (returns a pending promise), capture the emitted ChatInputRequested action's request.id off the session progress/state stream, answer via agent.respondToUserInputRequest(request.id, ChatInputResponseKind.Accept, answers) (claudeAgent.ts:1895 — scans all sessions by id), then await the promise and assert { action: 'accept', content }. Add decline/cancel/abort variants. This is the primary end-to-end proof of the translation.
scripts/test.sh --grep "onElicitation" passes.7. ✓ Unit tests for the projection module and bridge.
test/node/claudeElicitation.test.ts (create)test/node/codex/codexElicitationMapper.test.ts (deepStrictEqual snapshots): buildElicitationQuestions over every field kind; url-mode → no questions + url; buildElicitationContent round-trips + omits skipped; malformed schema degrades gracefully (no throw). Bridge tests against a fake session: form accept → {accept, content}, decline → {decline}, cancel → {cancel}, pre-aborted signal → {cancel}, abort mid-park → respondToUserInputRequest(Cancel).
scripts/test.sh --grep "claudeElicitation" passes.8. ✓ Adapt `claudeSdkOptions.test.ts` to the new `buildOptions` signature.
test/node/claudeSdkOptions.test.ts (modify)logElicitation positional arg from every buildOptions(...) call and provide an onElicitation input (a trivial async () => ({ action: 'cancel' }) stub is fine for those cases). Optionally assert the projection passes the callback straight through.
scripts/test.sh --grep "claudeSdkOptions" passes.| Path | Change | Notes | |------|--------|-------| | src/vs/platform/agentHost/node/claude/claudeElicitation.ts | create | Pure projections: schema→questions, answers→content, result mapper + cancelResult() helper | | src/vs/platform/agentHost/node/claude/claudeElicitationBridge.ts | create | SDK-callback bridge: session lookup, park on requestUserInput, abort wiring, ElicitResult mapping | | src/vs/platform/agentHost/node/claude/claudeSdkOptions.ts | modify | Add IBuildOptionsInput.onElicitation; drop logElicitation param; project onto Options.onElicitation | | src/vs/platform/agentHost/node/claude/claudeAgentSession.ts | modify | Add IMaterializeContext.onElicitation; pass at materialize (~449) + resume rebuild (~539); remove log lambdas | | src/vs/platform/agentHost/node/claude/claudeAgent.ts | modify | Add _makeOnElicitation; pass into materialize context at all 3 sites | | src/vs/platform/agentHost/test/node/claudeElicitation.test.ts | create | Projection + bridge unit tests (codex mapper test as template) | | src/vs/platform/agentHost/test/node/claudeAgent.test.ts | modify | Replace Test 18 stub assertion (~5358) | | src/vs/platform/agentHost/test/node/claudeAgent.integrationTest.ts | modify | Update wired-through assertion (~737) from cancel-stub to translation | | src/vs/platform/agentHost/test/node/claudeSdkOptions.test.ts | modify | Drop logElicitation
Resolved during council synthesis (strong 3/3 or 2/3 consensus). Grilling may add more.
design locked in CONTEXT.md:632. Elicitation is structured user input, not a permission decision.
(claudeCanUseTool.ts bridge vs claudeInteractiveTools.ts pure). 2/3 council + both in-repo precedents (codex, canUseTool). File name claudeElicitationBridge.ts (pure stays claudeElicitation.ts).
tool_use_idfor elicitation. Uuid guarantees global uniqueness — required because agent response dispatch scans all live sessions (claudeAgent.ts:1895). The abort listener captures the id by closure. Matches codex (codexAgent.ts:1364).
onElicitation awaits the returned promise for both form and url mode; the host parks on requestUserInput and the renderer resolves via the existing ChatInputCompleted path. The elicitation_complete notification stays in the router's "known unhandled" bucket (CONTEXT.md:1096). NB: this narrows the roadmap's "route it through the message router" bullet — confirmed unnecessary because the promise-await model already resolves URL prompts.
agentID; requests route tothe top-level session. Subagent-scoped elicitation is out of scope.
decline is reserved for explicit user Decline; everything else is cancel.** Follow Copilot's semantic (copilotAgentSession.ts:3784): a no-session lookup miss and a mid-park teardown both return { action: 'cancel' }; only an explicit user Decline returns { action: 'decline' }. This keeps one meaning for decline ("the user refused") and reports "nobody to ask" honestly as a cancel — chosen over Codex's no-session→decline split (codexAgent.ts:1362). Practically: the pure module needs only a single cancel helper (no separate declined/cancelled pair), and the bridge's no-session early return and the teardown-driven respondToUserInputRequest(Cancel) both land on cancel.
(resolveSessionConfig suppresses it, claudeAgent.ts:1731), and sibling Codex does no auto-cancel — it parks and lets teardown unwind. The handler always surfaces the prompt; parked requests unwind on dispose via _pendingUserInputs.denyAll({ Cancel }) (claudeAgentSession.ts:731/1087). This narrows the roadmap's "auto-cancel when unattended" bullet — no headless Claude path exists today, so the branch is dead code and is omitted. A future headless phase owns re-adding it.
title/displayName/description) is ignored.** Those SDK fields target elicitation-driven *permission* prompts, but Phase 10.6 routes through the user-input channel; both Codex and Copilot use message only. The bridge surfaces request.message as ChatInputRequest.message and drops the rest. A future permission-styled elicitation phase can thread them.
generated McpElicitationPrimitiveSchema and copilot's typed schema, the Claude SDK schema is untyped, so a malformed third-party schema could throw mid-projection. Mitigation: narrow defensively (guard every property access with typeof/hasKey); on any parse failure fall back to a question-less request (message only) so the user can still accept/decline, never a crash. Cover with a "malformed schema" unit test.
ChatInputRequest.url is a URI (state.ts:368); the SDK gives url: string ([sdk.d.ts ElicitationRequest]). Mitigation: URI.parse in the url-mode branch; guard against a missing/empty url.
logElicitation ripples to claudeSdkOptions.test.ts and both session build sites. Mitigation: step 8 updates the test; npm run typecheck-client catches every caller.
ChatInputAnswer value kinds; coercion to the schema's declared type must match what the MCP server expects. Mitigation: port codex/copilot coercion (Math.trunc for integers, Number.isFinite guards, freeform-merge for arrays) and snapshot-test round-trips.
npm run typecheck-client
npm run valid-layers-checkscripts/test.sh --grep "claudeElicitation"scripts/test.sh --grep "claudeSdkOptions" scripts/test.sh --grep "onElicitation" (covers claudeAgent.test.ts Test 18 and claudeAgent.integrationTest.ts §5.3)
scripts/test.sh --grep "Phase 7"Reality check: the protocol harness (test/node/protocol, CapiReplayProxy record/replay) has no existing eliciting MCP-server producer — elicitation originates from an MCP server the SDK talks to, and no stub server in the harness calls elicit/create. So the realistic, deterministic end-to-end proof is the captured-`onElicitation` integration round-trip in step 6 (claudeAgent.integrationTest.ts §5.3): it drives the exact SDK callback the real SDK would invoke, through the real materialize → Options boundary, and asserts the full park → answer → ElicitResult cycle. Treat that as the E2E gate for this phase.
Discovered workspace skills (project scope, .github/skills/), for a fuller manual/optional pass:
agent-host-e2e-tests — black-box AHP-protocol tests withCapiReplayProxy record/replay. Usable only if a new eliciting stub MCP server is added to the harness (optional stretch; see below).
agent-host-logs — analyze exported Agent Host debug-log bundles (events.jsonl, AHP JSONL transport logs) for post-hoc inspection.
launch — drive Code OSS with @playwright/cli + a Nodedebugger for a manual check in the Agents window.
the harness that calls elicit/create in form mode during a turn, follow the agent-host-e2e-tests skill to record a fixture, and assert over the AHP stream: ChatInputRequested carries the projected questions → respondToUserInputRequest(Accept, answers) → server receives { action: 'accept', content }; repeat for decline, cancel, and a url-mode question-less request. Only pursue if the integration round-trip proves insufficient.
launch to open Code OSS in an isolated profile, start a Claude session with an MCP server that elicits, and confirm the chat-input form renders in the Agents window and the answer reaches the server; use agent-host-logs to inspect the transport if needed.
logElicitation references and no inline { action: 'cancel' } stub in claudeSdkOptions.ts.
_None open — all council alternatives resolved during grilling (see Decisions)._
./roadmap.md (Phase 10.6, lines 1288-1357)./phase7-plan.md (§3.7, lines 43 / 930) CONTEXT.md:1096 (SDKElicitationCompleteMessage unhandled)
../codex/codexElicitationMapper.ts + ../../test/node/codex/codexElicitationMapper.test.ts
../codex/codexAgent.ts _handleElicitationRequestRpc (1356)./claudeCanUseTool.ts (88-100)../copilot/copilotAgentSession.ts _handleElicitationRequest (2239)extensions/copilot/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts — OnElicitation (969), ElicitationRequest (470), ElicitationResult/ElicitResult (495)
agent-host-e2e-tests, agent-host-logs, launchImplemented 2026-07-14 via super-implementer (TDD, red-green per behavior).
Matches the planned Files to Modify or Create table exactly — no drift.
| Path | Change | |------|--------| | claudeElicitation.ts | created — pure projections (buildElicitationRequest, elicitationResultFromAnswers, cancelledElicitationResult) + module-private parseElicitationSchema / elicitationFieldToQuestion / elicitationAnswerToValue | | claudeElicitationBridge.ts | created — handleElicitation + IClaudeElicitationDeps (getSession returns ClaudeAgentSession, matching IClaudeCanUseToolDeps — no structural slicing) | | claudeSdkOptions.ts | modified — IBuildOptionsInput.onElicitation; dropped logElicitation param; projected onto Options.onElicitation | | claudeAgentSession.ts | modified — IMaterializeContext.onElicitation; passed at materialize + resume rebuild; removed both log lambdas | | claudeAgent.ts | modified — _makeOnElicitation + handleElicitation import; passed at all 3 materialize sites | | test/node/claudeElicitation.test.ts
claudeElicitation.test.ts — projection snapshots covering every field kind and branch: text/integer/boolean/oneOf/enum+enumNames/array-items.enum (canonical fixture), plus number/titled-multiselect-anyOf/plain-enum/rich-text-format+maxLength+default/unknown-type/missing-type (variants fixture); allowFreeformInput: false on all strict enum/select questions; url mode; malformed-schema and every empty/broken-form → message-only degradation; per-field validation drop; accept/decline/cancel result mapping; schema-aware text→type coercion (number/integer/boolean from text answers, uncoercible dropped); prototype-polluting field-name safety; accept edge cases; url-accept no content; cancelledElicitationResult; and the bridge no-session → cancel guard.claudeAgent.test.ts — Phase 10.6 suite: form accept surfaces ChatInputRequested + returns content; decline → decline; SDK-signal abort mid-park → cancel; url-mode round-trip; pre-aborted signal → cancel; and (review-driven) url-mode-without-url and empty-form both → cancel without surfacing a prompt.claudeAgent.integrationTest.ts — §5.3 real accept round-trip through the proxy-backed materialize boundary.1. Pure module exposes one cohesive `buildElicitationRequest(requestId, request)` (handles both form and url) rather than a separate buildElicitationQuestions + bridge-assembly. Mirrors the sibling codexElicitationMapper.ts directly and gives clean deepStrictEqual snapshot tests. Same files, same behavior. 2. `ChatInputRequest.url` is `string`, not `URI`. The glue-layer sessionState ChatInputRequest (protocol-serialized) types url as string; the plan's URI.parse note referred to the internal channels-chat type. The url string is assigned directly, matching codex. No URI import needed. 3. One extra edit not in the file table: claudeAgent.test.ts had a *second* direct session.materialize(...) helper call (not an agent-routed one) that also needed the new required onElicitation context field. In-file, test-only, surfaced by typecheck — noted here for transparency.
NonNullable<Options['onElicitation']>) across IBuildOptionsInput, IMaterializeContext, and _makeOnElicitation — exactly equivalent, more readable.IElicitationSessionTarget slice. This matches IClaudeCanUseToolDeps (which returns ClaudeAgentSession) — the sibling claudeCanUseTool.ts bridge imports the concrete session too, so there is no cycle. Bridge round-trips are covered at the agent level (accept/decline/abort-mid-park/pre-aborted through the real captured onElicitation), mirroring how canUseTool is tested; the no-session guard is covered by a direct handleElicitation call with a missing lookup.Copilot's review surfaced real correctness gaps against the workbench consumer (agentHostSessionHandler.ts); all confirmed and fixed:
"3"/"false" must be coerced back to 3/false. elicitationAnswerToValue now takes the field and coerces per type (ported from copilot's elicitationAnswerToFieldValue); uncoercible values are dropped.allowFreeformInput to true, which would let a user submit an out-of-schema value that the translator then drops. MCP enums are strict, so the projection now disables free-form input on single/multi-select.url-mode request missing its URL, or a form with no representable fields, would become the consumer's injected required text question and then resolve as accept. The bridge now cancels a request with neither a URL nor questions.__proto__, constructor, …) are read with Object.hasOwn and content is built via Object.fromEntries, so such a name never reads an inherited member (crash) or mutates the prototype (silent drop).avoid-private-methods: clean. The new projection helpers are pure module-scoped free functions (already the ideal form, directly testable via the exported API). The only new class private method, _makeOnElicitation, passes every check — no branching, called from all three materialize sites, a direct mirror of the existing _makeCanUseTool factory.
claudeAgent.integrationTest.ts §5.3 — drives Options.onElicitation through the real materialize → SDK boundary, parks a ChatInputRequested, answers via respondToUserInputRequest, and confirms { action: 'accept', content: { side: 'left' } } flows back. Passed.claudeAgent.test.ts (190), claudeAgentHostE2E.integrationTest.ts (8 pass / 2 pending), claudeSdkOptions.test.ts (12), claudeElicitation.test.ts (12) — all green.npm run typecheck-client clean; npm run valid-layers-check clean; eslint clean on new files.buildOptionsonElicitationtest/node/claudeAgent.test.tsonElicitationsession.materialize(...)test/node/claudeAgent.integrationTest.tsrespondToUserInputRequest{ action: 'accept', content }test/node/claudeSdkOptions.test.tsinput()onElicitationlogElicitationbuildOptions(...)SDKElicitationCompleteMessagevs/base/common/validation.ts (the pure "zod-lite") to build vElicitationField, runtime-validates each schema field (dropping malformed ones — e.g. a non-array enum that would otherwise reach .map and throw), and *derives* the field type via ValidatorType<typeof vElicitationField> (no hand-rolled interface). A type-only import of PrimitiveSchemaDefinition plus the compile-time guard _assertElicitationFieldCoversSchema (verified non-vacuous and drift-catching) pins the derived type to the SDK's authoritative union. The base validator is used instead of the SDK's own zod schema because a *runtime* @modelcontextprotocol/sdk import doesn't resolve in the unit-test renderer (all SDK runtime access goes through IClaudeAgentSdkService); a safeParse prototype was rejected for exactly that reason. Net vs. the original hand-rolled interface: real runtime validation (fixes a latent throw), zero duplicated type, and spec-drift protection.