ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
A streamlined, repeatable smoke test for the ClaudeAgent IAgent provider. Use this whenever a phase changes the boot path, the registration code in agentHostMain.ts / agentHostServerMain.ts, the model filter in isClaudeModel, the GitHub-token plumbing through IClaudeProxyService, or (Phase 6+) the SDK subprocess fork / message pipeline.
It encodes the lessons from the Phase 4 live walk and the Phase 6 cycles so future runs are deterministic. The two helper scripts under ./scripts/ capture the boilerplate (launching the app, verifying the logs); the playwright steps are still operator-driven because they depend on snapshot refs that change between runs.
| Phase | What this plan must continue to prove | |-------|--------------------------------------| | 4 (skeleton) | Both providers register; auth reaches ClaudeAgent; proxy binds; models surface; first user prompt throws TODO: Phase 5 (the createSession stub fires before sendMessage). | | 5 (sessions) | Same as Phase 4 PLUS createSession succeeds (claude:/<uuid> URI in IPC log); first user prompt throws TODO: Phase 6. NOTE: Phase 5 was never run live — see §8. | | 6 (sendMessage, single-turn, no tools) | Same as Phase 4 PLUS createSession returns a *provisional* session (no SDK contact yet); first user prompt materializes the SDK subprocess and renders a real text response (no TODO: Phase match in the snapshot); IPC log carries session/responsePart, session/delta, session/usage, session/turnComplete actions. | | 7 (tool calls + permission + user input) | Same as Phase 6 PLUS: a tool-using prompt fires pending_confirmation; approving it lands SessionToolCallComplete with the result; flipping permissionMode → bypassPermissions skips confirmation; an AskUserQuestion invocation surfaces the question carousel and answers reach the model. | | 8 (file edit tracking) | Same as Phase 7 PLUS: a Write/Edit
VS Code - Build task or run npm run typecheck-client once.
@playwright/cli available (npx @playwright/cli --version should work). the Anthropic catalog is only visible to authenticated Copilot accounts. The ~/.vscode-oss-sessions-dev user-data-dir caches login state across runs, so you only need to sign in once.
ClaudeAgent registration is opt-in. Pick either:chat.agentHost.claudeAgent.enabled: true in user settings (theuser-data-dir caches this between runs), or
launch-smoke.sh — it exports VSCODE_AGENT_HOST_ENABLE_CLAUDE=1 so the agent host enables the provider regardless of the workbench setting.
./src/vs/platform/agentHost/node/claude/scripts/launch-smoke.sh 9224This handles the unset ELECTRON_RUN_AS_NODE, VSCODE_SKIP_PRELAUNCH=1, --user-data-dir, --extensions-dir, --remote-debugging-port, and the "kill anything squatting on the port" steps. It exits zero once the CDP port is listening.
./src/vs/platform/agentHost/node/claude/scripts/verify-claude-logs.sh [--phase=N]Default --phase is the latest implemented phase (currently 6). Pass --phase=4 or --phase=5 to skip the Phase-6+ session-action checks.
Exits non-zero if any invariant fails. Always-on checks (any phase ≥ 4):
1. Both copilotcli AND claude providers registered. 2. [Claude] Auth token updated appears (proves agentService.authenticate fans out to every provider that owns the resource — see §3 of phase4-plan.md for why this matters). 3. [ClaudeProxyService] listening on http://127.0.0.1:<port>. 4. The root-state IPC log carries a "provider": "claude" block. 5. ≥ 1 Claude-family model id (claude-opus-*, claude-sonnet-*, …) surfaces in the IPC log — verifies the §3.5 model filter and tryParseClaudeModelId. 6. No fatal error log lines (any phase — these indicate bugs):
[Claude SDK stderr] (Phase 6 subprocess error stream)[ClaudeAgentSession] _processMessages crashed (Phase 6 fatal loop)[ClaudeAgentSession] mapper threw, skipping message (Phase 6 mapper)[Claude] Failed to persist customization directory; aborting materialize (Phase 6 S5 fatal)Phase-6+ checks (only when --phase ≥ 6 AND the operator has driven a turn to completion via §4):
7. ≥ 1 "type":"session/responsePart" action in the IPC log (proves the mapper allocated a part — plan §3.6 reducer ordering invariant). 8. ≥ 1 "type":"session/turnComplete" action (proves the SDK reached result and the consumer loop completed the in-flight deferred).
Captured artifacts land in /tmp/claude-smoke/<timestamp>/:
registration.log — both Registering agent provider: … linesauth.log — [Claude] Auth token …proxy.log — [ClaudeProxyService] listening on …root-state.log — the claude block from a RootStateChanged eventclaude-models.log — sample of model entriesclaude-session-uris.log — every claude:/<uuid> URI creatednegatives.log — grep results for the four fatal patterns (empty if pass)response-actions.log — sample session/responsePart/turnComplete envelopesAttach playwright:
for i in 1 2 3 4 5; do
npx @playwright/cli attach --cdp=http://127.0.0.1:9224 2>/dev/null && break
sleep 3
done
npx @playwright/cli tab-listOpen the picker:
npx @playwright/cli snapshot
# Find the ref:
SNAP=$(ls -t .playwright-cli/page-*.yml | head -1)
grep -nE 'Pick Session Type' "$SNAP"
# → e.g. "Pick Session Type, Copilot CLI" [ref=eXXX]
npx @playwright/cli click <ref>Re-snapshot and confirm both options exist:
npx @playwright/cli snapshot
SNAP=$(ls -t .playwright-cli/page-*.yml | head -1)
grep -nE 'option "(Copilot CLI|Claude)"' "$SNAP"Expected: two option "Copilot CLI" [ref=…] and option "Claude" [ref=…] lines.
Capture screenshot for the PR:
SMOKE_DIR=$(ls -td /tmp/claude-smoke/*/ | head -1)
npx @playwright/cli screenshot --filename="$SMOKE_DIR/picker-open.png"> Gotcha — clicking the option directly fails. The dropdown overlay > registers a context-view-pointerBlock element that intercepts pointer > events on the option items. Use ArrowDown then Enter instead: > > ``bash > npx @playwright/cli press ArrowDown > npx @playwright/cli press Enter >
After selecting Claude, re-snapshot and verify:
npx @playwright/cli snapshot
SNAP=$(ls -t .playwright-cli/page-*.yml | head -1)
grep -nE 'Pick Session Type, Claude' "$SNAP"Expected: button "Pick Session Type, Claude" [ref=…].
What the prompt does is phase-dependent:
createSession stub before sendMessage, so the snapshot shows TODO: Phase 5.createSession succeeds; sendMessage stub fires; snapshot shows TODO: Phase 6.createSession returns a *provisional* session; the first sendMessage materializes the SDK subprocess and streams a real Claude response. Snapshot shows actual model output (e.g. “Hello! How can I help…”). No TODO: Phase match.With the picker still showing “Claude” selected, type and submit:
# Find the chat textbox (its label is the placeholder text)
SNAP=$(ls -t .playwright-cli/page-*.yml | head -1)
grep -nE 'textbox.*\[active\]' "$SNAP"
# Click it, type, submit:
npx @playwright/cli click <ref>
npx @playwright/cli type "hello claude"
npx @playwright/cli press EnterPhase 6 timing: the SDK subprocess fork + init handshake takes a few seconds on a cold start. Wait ≥5s before the first snapshot:
sleep 5Re-snapshot and check the result against the phase you're on:
npx @playwright/cli snapshot
SNAP=$(ls -t .playwright-cli/page-*.yml | head -1)
# Phases 4-5 — stub fires; should match exactly one of these:
grep -nE 'TODO: Phase' "$SNAP"
# Phase 6+ — should NOT match `TODO: Phase`. Instead grep for response:
grep -nE 'paragraph' "$SNAP" | head -5| Phase | Expected snapshot match | |-------|------------------------| | 4 | TODO: Phase 5 (createSession is the first stub on the path) | | 5 | TODO: Phase 6 (sendMessage stub) | | 6+ | no TODO: Phase match; one or more paragraph nodes with model output |
Capture screenshot:
# Phase 4-5: stub error
npx @playwright/cli screenshot --filename="$SMOKE_DIR/stub-error.png"
# Phase 6+: real response
npx @playwright/cli screenshot --filename="$SMOKE_DIR/turn-complete.png"Phase 6+ — verify the action stream from logs. After the turn completes, re-run the verify script (it will look for session/responsePart and session/turnComplete actions in the IPC log):
./src/vs/platform/agentHost/node/claude/scripts/verify-claude-logs.sh --phase=6This catches issues that the snapshot can't — e.g. a turn that renders text in the UI but never emitted SessionUsage (broken token accounting), or a mapper that skipped content_block_start and only emitted deltas (broken ordering invariant).
> Expected console error on Phase 6. A single > [ERROR] TODO: Phase 10: Error: TODO: Phase 10 line in the playwright > console capture is normal — the chat client invokes setClientTools to > register its tool list, which is a Phase 10 stub. It does not affect the > chat round-trip. Promote this to a check failure in Phase 10.
Run only after the Phase 6 baseline (above) passes. Steps mirror plan §7.5.
> Tool kinds vs. `permissionMode`. In default mode the Claude SDK > auto-approves reads and only invokes the host's canUseTool for > writes / shell / network — pick a write-style prompt below so the > confirmation card actually surfaces. (See the Claude permission-mode > table.) In acceptEdits mode writes are also auto-approved; only > bypassPermissions skips ALL gates.
1. Permission round-trip — approve. With Claude selected in the picker, type create a file named scratch.md with the body "smoke test". Wait ≥ 5s for the tool card. Snapshot. Verify a confirmation card appears (Edit file? / Write file? title with an Approve / Deny button row). Screenshot tool-confirm.png. Approve. Snapshot again. Verify the assistant follow-up acknowledges the create. Screenshot tool-complete.png. Clean up the file afterwards.
2. Verify the action stream. Re-run ./src/vs/platform/agentHost/node/claude/scripts/verify-claude-logs.sh --phase=7 — checks 9–11 must pass (session/toolCallStart, pending_confirmation, session/toolCallComplete).
3. Permission round-trip — bypass. Open the workbench Approvals dropdown, switch to bypassPermissions. Type create a file named scratch2.md with the body "no gate". Snapshot. Verify NO confirmation card appears; the write result lands directly. Screenshot bypass-mode.png. Re-run the verify script; check 13 must pass (the setPermissionMode("bypassPermissions") line appears and the post-bypass tool call has no pending_confirmation). Clean up the file afterwards.
4. User-input flow. Type Use AskUserQuestion to ask me which package manager I prefer with options npm, pnpm, yarn. Wait ≥ 5s. Verify a carousel question card surfaces with the three options. Screenshot ask-user-question.png. Pick an option. Verify the assistant's follow-up message acknowledges the choice.
The session URI is observable in the IPC log, not as a data-session-uri DOM attribute (none exists). verify-claude-logs.sh already captures these to claude-session-uris.log, but you can re-grep:
LOG=$(ls -td ~/.vscode-oss-sessions-dev/logs/*/ | head -1)
WIN=$(ls -td "$LOG"window1/output_*/ | head -1)
grep -oE '"session":\s*"claude:[^"]+"' "$WIN"agenthost.*.log | sort -uExpected: at least one "session": "claude:/<uuid>" line. The scheme is claude: (the provider id, fed straight to AgentSession.uri); the synced-customization namespace uses the longer agent-host-claude form, which appears in the IPC log as "uri": "vscode-synced-customization:/agent-host-claude".
lsof -t -i :9224 | xargs -r killThe ~/.vscode-oss-sessions-dev data dir is intentionally preserved so the next run skips GitHub login.
For a phase smoke PR, include in the description:
registration.log (two lines)picker-open.pngstub-error.pngturn-complete.png AND response-actions.log (proves theIPC action stream landed, not just the UI render)
tool-confirm.png, tool-complete.png, bypass-mode.png, ask-user-question.png AND tool-actions.log (proves the session/toolCall/start → pending_confirmation → session/toolCall/complete action sequence)
claude-session-uris.log (one line per session created)The other captured artifacts are useful for triage if any check fails but need not appear in every PR.
Phase 5 (the IAgent provider skeleton) was committed without a live smoke run. The --phase=5 row in §1 documents *what would have been* verified — createSession succeeds, IPC log carries a claude:/<uuid> URI, prompt produces TODO: Phase 6 — but the Phase 5 PR description did not include any of the artifacts in §7.
This is recorded here (rather than fixed retroactively) because Phase 6 fully replaces the Phase 5 sendMessage path: a Phase 6 smoke run transitively exercises every Phase 5 code path (provider registration, auth fan-out, proxy bind, model surface, picker, session URI scheme), and additionally proves the SDK subprocess fork + message pipeline.
Lesson for future phases: every phase that touches the agent host boot path or the IAgent surface MUST run this plan and attach the §7 artifacts to its PR, even if the visible behavior is “stub message changes from X to Y”. Without a live run, regressions in upstream layers (authentication, proxy, model filter) only surface at the next phase that does run live — by which point the bisect window is wider.
| Symptom | Likely cause | |---------|--------------| | verify-claude-logs.sh fails at check 1 (copilotcli missing) | A registration was deleted from agentHostMain.ts or agentHostServerMain.ts. | | verify-claude-logs.sh fails at check 1 (claude missing) | Same, but for ClaudeAgent. Or import broken. | | verify-claude-logs.sh fails at check 2 ([Claude] Auth token updated missing) | agentService.authenticate is short-circuiting on the first matching provider. The fan-out fix lives in src/vs/platform/agentHost/node/agentService.ts. | | verify-claude-logs.sh fails at check 5 (zero models) | The §3.5 filter rejected everything. Inspect the upstream [Copilot] Found N models log line and check vendor / supported_endpoints / model_picker_enabled / tool_calls. | | verify-claude-logs.sh fails at check 6 ([Claude SDK stderr]) | Phase 6 SDK subprocess wrote to stderr. Inspect the captured stderr in agenthost.log — likely auth (401/403 from the proxy), missing node runtime, or the subprocess can't reach ANTHROPIC_BASE_URL
MultiEditSessionToolCallCompleteresult.contentToolResultFileEditContenttype: 'file_edit'beforeaftersession-db:Options.enableFileCheckpointingtrueOptions.hooksundefinedClaudeFileEditObserverEditMultiEditReadsendMessage[Claude] session <id>: resume rebuild'now'steering_consumedPendingMessage.idQuery.setModelQuery.applyFlagSettingsstartup'max''max' effort clamped to 'xhigh'sendMessageverify-claude-logs.sh_processMessages crashed_fatalErrorclaudeMapSessionEvents.tsverify-claude-logs.shFailed to persist customization directory_writeCustomizationDirectoryISessionDataService.openDatabaseverify-claude-logs.shsession/responsePartcontent_block_starttool_usetextthinking_inFlightRequests[0]?.turnIdverify-claude-logs.shsession/turnCompleteresult_processMessages crashedautorunagentSideEffects.ts_publishAgentInfosagentsTODO: Phase 5createSessioncreateSessionprovisional: true[ClaudeProxyService]/v1/messagesnpx @playwright/cli evaluateevalevaluate--rawnpx @playwright/cli clickpointer-block interceptspress ArrowDownpress Enter