ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
> Generated by super-planner. Source: roadmap.md (Phase 8.5). > Last updated: 2026-05-15 after 3-model council (GPT-5.5, Claude Opus 4.6, > GPT-5.3-Codex). Pre-grilling draft.
Status: ✅ DONE (merged to main; E2E verified live)
Bring Claude tool-call rendering up to the quality bar Copilot already sets: permission cards and tool rows show the actual invocation parameters (the command, the file, the search pattern), and shell / search tools render in the workbench's dedicated terminal / search renderers instead of the generic tool renderer. Both live and replayed sessions must produce identical signals.
In scope
claudeToolDisplay.ts mirroring Copilot's shape: getClaudeInvocationMessage, getClaudePastTenseMessage, getClaudeToolKind, getClaudeShellLanguage, getClaudeToolInputString.
TOOL_ROWS table: toolKind, language. Source-of-truth lookup for the kind/language helpers.
buildClaudeToolMeta(toolName) → { toolKind?, language? } (omits keys when undefined), called at every tool-open seam.
claudeCanUseTool.ts — rich invocationMessage, rich toolInput, _meta on ToolCallPendingConfirmationState.
claudeMapSessionEvents.ts — _meta on SessionToolCallStart, success-aware pastTenseMessage and _meta on SessionToolCallComplete. Adds tool-input accumulation to ClaudeMapperState (see Decision D5).
claudeReplayMapper.ts — same helpers in _openToolUse / _attachToolResult. Subsumes the existing Phase 12 subagent-only _meta write.
claudeSubagentSignals.ts — same _meta on inner subagenttool-call start / ready (currently bare).
sessionPermissions.ts — copy state._meta into the emitted SessionToolCallReady action so _meta survives the pending_confirmation → ready transition.
claudeToolDisplay.test.ts covering every tool row × { invocation, pastTenseSuccess, pastTenseFailure, toolKind, language, inputString }.
claudeMapSessionEvents.test.ts and claudeReplayMapper.test.ts.
Out of scope
TOOL_ROWS already covers — adding toolsis a one-row update, not a phase.
and is driven by the _meta.toolKind field Copilot already sets. Phase 8.5 only emits the meta; rendering is the workbench's job.
as a known gap).
nls.localize() with {0} placeholders.
claudeCanUseTool.ts, INTERACTIVE_CLAUDE_TOOLS, and the pending-confirmation state shape.
TOOL_ROWS table and isClaudeFileEditTool helper.
'subagent'` precedent that Phase 8.5 generalizes.
(claudeReplayMapper.ts).
Add toolKind and language columns to the existing TOOL_ROWS table in claudeToolDisplay.ts (single source of truth), then add five helper functions that mirror Copilot's copilotToolDisplay.ts shape but read Claude SDK tool_use.input schemas defensively. A single tiny buildClaudeToolMeta(toolName) helper produces the _meta bag stamped at every tool-open seam — live mapper, permission path, replay mapper, and inner subagent path — so all three drivers emit identical signals. The pastTenseMessage helper is success-aware (tool_result.is_error). Inputs flow into the live mapper via accumulation of input_json_delta chunks (see Decision D5).
1. ✓ Extend `TOOL_ROWS` and add helpers in `claudeToolDisplay.ts`.
toolKind?: 'terminal' | 'subagent' | 'search' and language?: string columns to ClaudeToolRow. Populate:
Bash, BashOutput, KillBash → toolKind: 'terminal', language: 'bash'.
Grep, Glob → toolKind: 'search'.Task → toolKind: 'subagent'.undefined).getClaudeToolKind(name), getClaudeShellLanguage(name)as one-liner table lookups.
getClaudeInvocationMessage(name, displayName, input) and getClaudePastTenseMessage(name, displayName, input, success) returning StringOrMarkdown. Mirror Copilot's branches in copilotToolDisplay.ts lines 473–760, keyed off Claude tool names: Bash (command), Read/Write/Edit/ MultiEdit/NotebookRead/NotebookEdit (file_path / notebook_path), Grep/Glob (pattern), WebFetch (url), Task (description), MCP (server: tool).
getClaudeToolInputString(name, input) returning the "code under the row" string: shell tools → command; others → JSON.stringify(input, null, 2).
buildClaudeToolMeta(name) returning { toolKind?, language? } with undefined keys omitted.
command === 'string'); on mismatch fall back to the static display name. **No as` casts that escape the type checker.**
five helper outputs.
2. ✓ Wire `claudeCanUseTool.ts` (live permission path).
dispatchCanUseTool (lines 105–135), replace invocationMessage: displayName with getClaudeInvocationMessage(toolName, displayName, input).
input (used for toolInput) with getClaudeToolInputString(toolName, input) ?? <fallback>.
_meta: buildClaudeToolMeta(toolName) on the ToolCallPendingConfirmationState.
(verified by integration test added in Step 7).
3. ✓ Patch `sessionPermissions.ts` to forward `_meta` into Ready.
createToolReadyAction (lines ~175–201), copy state._meta onto the emitted SessionToolCallReady action so the pending_confirmation → ready transition preserves toolKind / language.
node/claude/; the change is agnostic and will help any future agent that puts _meta on a pending-confirmation state.
`sessionPermissions.ts`.
_meta is settled). _meta (asserted in `sessionPermissions.test.ts` if a fixture exists; otherwise add a focused test).
4. ✓ Wire `claudeMapSessionEvents.ts` (live event path) and extract `ClaudeToolCallRegistry`.
`claudeToolCallRegistry.ts` containing the ClaudeToolCallRegistry class described in Decision D5. It owns per-tool-call state for the live mapper (turnId, toolName, delta buffer, parsed input, computed IClaudeToolStartInfo bag). Public API: beginToolCall, appendInputDelta, completeToolCall, lookupToolCall, forgetToolCall, drainOnTurnEnd.
_toolCallTurnIds / _toolCallNames / _activeToolBlocks fields on ClaudeMapperState and migrate their callers to the registry. The mapper stops holding cross-message state directly.
ClaudeAgentSession constructs and owns one ClaudeToolCallRegistry per session (registered via _register), and passes it into the mapper as a constructor argument.
mapStreamEvent:content_block_start for tool_use (~line 416) → registry.beginToolCall(toolUseId, toolName, turnId).
input_json_delta (~line 182's comment block describes the block-index correlation) → registry.appendInputDelta(toolUseId, delta.partial_json).
content_block_stop for the same block → const info = registry.completeToolCall(toolUseId), then emit SessionToolCallStart with info.invocationMessage, info.toolInput, _meta: buildClaudeToolMeta(info.toolName).
mapUserMessage for tool_result (~lines 277–291):const info = registry.lookupToolCall(toolUseId).SessionToolCallComplete with pastTenseMessage: getClaudePastTenseMessage(info.toolName, info.displayName, info.parsedInput, !isError). No _meta — the reducer carries _meta forward from Start (D6).
registry.forgetToolCall(toolUseId) after emission.info === undefined (defense-in-depth): fall back to the existing static ${displayName} finished and no _meta; log a trace warning.
markTurnComplete (~lines 140–157) → delegate to registry.drainOnTurnEnd(turnId, logService).
`claudeToolCallRegistry.ts` (new), `claudeMapSessionEvents.ts`, `claudeAgentSession.ts` (construct and inject the registry).
Bash turn emits pastTenseMessage containing thecommand (verified in `claudeMapSessionEvents.test.ts`).
_meta.toolKind: 'terminal' appears on both SessionToolCallStart and SessionToolCallComplete.
claudeToolCallRegistry.test.ts covers begin/append/complete/ lookup/forget/drain in isolation (mirrors claudeSubagentRegistry.test.ts).
5. ✓ Wire `claudeReplayMapper.ts` (replay path).
_openToolUse (lines ~257–281):block.input (already a Record<string, unknown>).invocationMessage: displayName with getClaudeInvocationMessage(toolName, displayName, input).
_meta: { toolKind: 'subagent' } (set only when SUBAGENT_TOOL_NAMES.has(toolName)) with _meta: buildClaudeToolMeta(toolName) — this subsumes the Phase 12 path (since getClaudeToolKind('Task') === 'subagent').
Map<toolUseId, Record<string, unknown>>`.
_attachToolResult (lines ~282–320): stashedInput, !isError) instead of ${displayName} finished`.
..._meta carry-forward keeps the new full _meta intact.
Agent (legacy SDK alias for Task subagent spawning, per SUBAGENT_TOOL_NAMES at lines ~131–137) is handled. Two options:
Agent row to TOOL_ROWS with toolKind: 'subagent' (keeps replay regressions away).
SUBAGENT_TOOL_NAMES as thereplay-only fallback; document it. Decision D2: Option A — single source of truth.
`claudeReplayMapper.ts`.
Bash row in `claudeReplayMapper.test.ts` shows the same rich invocation / pastTense / _meta as the live row from Step 4.
6. ✓ Wire `claudeSubagentSignals.ts` (inner subagent path).
emitInnerAssistantSignals (lines ~250–270), the inner tool_use branch:
_meta: buildClaudeToolMeta(block.name) on the inner SessionToolCallStart.
invocationMessage: displayName on the synthetic inner Ready with getClaudeInvocationMessage(block.name, displayName, block.input).
buildTopLevelSubagentReadyAction (lines ~144–170), the existing _meta: { toolKind: 'subagent', ... } already produces the right kind. Re-express via { ...buildClaudeToolMeta('Task'), subagentDescription: ..., subagentAgentName: ... } to use the same helper (no behavioral change).
`claudeSubagentSignals.ts`.
with toolKind: 'search' / no toolKind (verified in `claudeSubagentSignals.test.ts`).
7. ✓ Snapshot + behavior tests.
`claudeToolDisplay.test.ts` with one snapshot test mapping every tool row to [invocationMessage, pastTenseSuccess, pastTenseFailure, toolKind, language, inputString] given a representative input bag. Mirrors the existing [permissionKind, displayName] snapshot at lines ~31–50.
tool gets undefined toolKind + JSON input string fallback.
`claudeMapSessionEvents.test.ts`: Bash start carries _meta.toolKind: 'terminal' / language: 'bash'; complete carries success-aware past tense containing the command.
`claudeReplayMapper.test.ts` for the same.
_meta forwarding test in sessionPermissions.test.ts (or add the file if absent).
npm run typecheck-client clean, valid-layers-check clean, all agentHost tests green.
| Path | Change | Notes | |------|--------|-------| | `claudeToolDisplay.ts` | modify | Add toolKind/language cols; add 5 helpers + buildClaudeToolMeta. | | `claudeCanUseTool.ts` | modify | Use rich helpers in dispatchCanUseTool. | | `claudeMapSessionEvents.ts` | modify | Migrate cross-message state to ClaudeToolCallRegistry; emit _meta on Start; success-aware past tense + _meta on Complete. | | `claudeToolCallRegistry.ts` | create | New class owning per-tool-call state for the live mapper. | | `claudeAgentSession.ts` | modify | Construct one ClaudeToolCallRegistry per session; inject into the mapper. | | `claudeReplayMapper.ts` | modify | Use rich helpers in _openToolUse / _attachToolResult; stash parsed input. | | `claudeSubagentSignals.ts` | modify | Same helpers on inner subagent path. | | `../sessionPermissions.ts` | modify | Copy state._meta into emitted SessionToolCallReady. | | `../../test/node/claudeToolDisplay.test.ts` | modify | Per-tool composite snapshot covering all 5 helpers. | | ../../test/node/claudeToolCallRegistry.test.ts | create | Unit tests for begin/append/complete/lookup/forget/drain. | | `../../test/node/claudeMapSessionEvents.test.ts` | modify | Live _meta + rich past-tense assertions. | | `../../test/node/claudeReplayMapper.test.ts` | modify | Replay parity assertions. | |
The table is already the single source of truth for per-tool data (isClaudeFileEditTool, INTERACTIVE_CLAUDE_TOOLS, getClaudePermissionKind all read it). Adding a switch would diverge on new tools and the snapshot test wouldn't catch the drift.
Agent to TOOL_ROWS (subagent-spawning, same as Task). SDK ships two** subagent-spawning tools: Task (built-in subagents, sdk.d.ts:95) and Agent (custom subagents, sdk.d.ts:36). Replay already recognises both via the local SUBAGENT_TOOL_NAMES set in `claudeReplayMapper.ts:137`; Phase 13's plan documented this with SDK citations. Add an Agent row to TOOL_ROWS with permissionKind: 'custom-tool', toolKind: 'subagent', then delete SUBAGENT_TOOL_NAMES and switch the replay call site at `claudeReplayMapper.ts:261` to getClaudeToolKind(name) === 'subagent'. The live path picks this up automatically because getClaudeToolKind is the single source of truth (D1).
Record<string, unknown> access; no per-tool exported types.** The SDK boundary is Record<string, unknown> / unknown (verified at sdk.d.ts:146 and sdk.d.ts:3059). Per-tool interfaces would be documentation-only and risk encouraging unsafe as casts. Helpers narrow each field with typeof checks and fall back on mismatch. Local-only readability interfaces are allowed inside claudeToolDisplay.ts (not exported) if they make the helper bodies easier to read.
(name, displayName, input, success) matching Copilot. Source of the success bit: tool_result.is_error === true → success = false. Already computed at claudeMapSessionEvents.ts:267 and claudeReplayMapper.ts:295.
complete" pattern (Option D), with state encapsulated in a small class — not as bare maps on ClaudeMapperState.** CopilotAgent computes the full IToolStartInfo at tool.execution_start (where the Copilot SDK hands over complete args) and stashes it in builder.pendingTools: Map<toolCallId, IToolStartInfo>; at tool.execution_complete it looks the info back up and calls getPastTenseMessage(info.toolName, info.displayName, info.parameters, success) (`mapSessionEvents.ts:135–202`, `mapSessionEvents.ts:622`).
Claude's analog: the SDK delivers tool input as input_json_delta chunks across content_block_start → delta* → content_block_stop. `content_block_stop` for a `tool_use` block IS Claude's "execution_start equivalent" — by then the buffer is complete and parseable.
Introduce a new class ClaudeToolCallRegistry in claudeToolCallRegistry.ts that owns all per-tool-call state for the live mapper. It replaces today's two bare maps (_toolCallTurnIds, _toolCallNames) and adds the new input-accumulation state. Public API:
beginToolCall(toolUseId, toolName, turnId) — called from content_block_start. Allocates the delta buffer.
appendInputDelta(toolUseId, partialJson) — called from input_json_delta.
completeToolCall(toolUseId) → IClaudeToolStartInfo — called from content_block_stop. Parses the buffer (try/catch), runs the display helpers once, stashes the resulting info bag, drops the buffer. Returns the bag so the mapper can use it on the matching Start emission.
lookupToolCall(toolUseId) → IClaudeToolStartInfo | undefined — called from mapUserMessage when tool_result lands. Returns the stashed info for past-tense / _meta use.
forgetToolCall(toolUseId) — called after tool_resultconsumes the entry, to bound memory.
drainOnTurnEnd(turnId, logService) — called from markTurnComplete, replaces today's inline cleanup at claudeMapSessionEvents.ts:140–157, warns on orphan tool_use blocks.
The registry is owned by ClaudeAgentSession (one per session, registered via _register so disposal flows through the session). The mapper takes it as a constructor argument instead of carrying state itself, so the mapper stays a pure event-translation function and the registry can be unit-tested in isolation (mirrors how Phase 12 split SubagentRegistry out of the mapper).
Replay is unaffected — block.input is already complete in the replay path. ClaudeReplayMapper keeps its own Map<toolUseId, Record<string, unknown>> stash internally; it does not share the live registry because the lifetimes and failure modes are entirely different (one-shot reconstruction vs. streaming).
_meta write asymmetry between live and replay is bydesign.** Both paths end up producing the same final reducer state; they differ only in the event shape that gets there.
Live (streaming, two-action shape): the SDK emits content_block_start → input_json_delta* → content_block_stop → (user approves) → tool_result over time. The host translates into two actions: SessionToolCallStart (stamped with _meta: buildClaudeToolMeta(toolName) once) and SessionToolCallComplete (no _meta). The reducer at `state/protocol/reducers.ts:30, 406` carries _meta forward when merging Complete into the existing per-toolCallId state. Mirrors Copilot's single-write at `mapSessionEvents.ts:197`.
Replay (flattened, single-action shape): there is no event stream — claudeReplayMapper.ts walks the on-disk transcript and synthesizes one terminal ToolCallState per (tool_use, tool_result) pair (per CONTEXT M7 "no live lifecycle states"). _meta is stamped on that single action because there is no prior state for the reducer to carry it from.
Permission cards (Step 3): the one place this falls down today is sessionPermissions.createToolReadyAction at `sessionPermissions.ts:175–201`, which does NOT copy _meta from the pending-confirmation state into the emitted SessionToolCallReady. Step 3 patches that one site so the live single-write keeps working through the pending_confirmation → ready transition.
Future readers: do not "fix" the asymmetry by emitting _meta on live Complete or by splitting replay into two actions. The final reducer state is identical in both paths; only the event shape differs.
12's existing _meta: { toolKind: 'subagent', subagentDescription, subagentAgentName } shape is the precedent, and Copilot's _meta is also flat. New keys (language for terminal, future keys for other kinds) sit as optional siblings on the same object. Workbench readers consume the keys they know about and ignore the rest. Namespacing later (_meta.terminal = { language }) would require migrating on-disk replay shape and a double-shape workbench reader; the tidiness win does not justify either cost. If _meta ever genuinely outgrows flat, it is its own roadmap-level refactor.
getClaudeInvocationMessage('Task', …) is the single source of truth for the parent Task row's invocation message.** The helper reads input.description (the model-authored one-liner for the subagent task) and falls back to the static display name. Phase 12's call site in `claudeSubagentSignals.ts:163` — currently description ?? getClaudeToolDisplayName(block.name) — is replaced with a plain getClaudeInvocationMessage('Task', displayName, block.input) call. One code path; the snapshot test covers the description-present and description-absent shapes.
behavior (copilotToolDisplay.ts:807 returns one of the three kinds or undefined). MCP input string defaults to JSON pretty-print; invocation message strips the mcp__ prefix and shows server: tool.
assert.deepStrictEqual mapping every tool name to a tuple of all five helper outputs. Mirrors the existing snapshot pattern at claudeToolDisplay.test.ts:31–50. New tools force one row edit + one snapshot update — easy to review.
Step 3 patches sessionPermissions.ts; covered by a focused test. Without this fix, terminal/search rendering on permission cards would silently break even though everything else looks right.
input_json_delta chunks may arrive out of order with the canonical assistant envelope for fast tools. Mitigation: D5's "first writer wins" rule plus try/catch fallback to the static past tense.
invocationMessage accepts StringOrMarkdown, but if a path stringifies it expecting plain string we'd render [object Object]. Mitigation: audit stateToProgressAdapter.ts and sessionPermissions.ts arms during Step 3; the reducer types should already enforce the union correctly.
on-disk transcripts have _meta: undefined or _meta: { toolKind: 'subagent' }. After this change they'll get richer _meta. This is purely additive (no fields removed, no semantics changed) so the workbench should accept it. Verified in Step 7's replay assertions.
+ past-tense markdown) must use nls.localize() with {0} placeholders, not concatenation. Coding guidelines enforced; Copilot's helper is the template.
`claudeToolDisplay.test.ts` covers every tool row × all five helpers. Defense tests cover malformed input + MCP fallback.
`claudeMapSessionEvents.test.ts` for _meta on Start, success-aware past tense + _meta on Complete.
`claudeReplayMapper.test.ts` for parity with the live path.
`claudeSubagentSignals.test.ts` for _meta on inner tool calls.
sessionPermissions.test.ts (add file if absent) that state._meta is copied into SessionToolCallReady.
runTests (preferred) or `scripts/test.sh --grep"agentHost"`.
npm run typecheck-client and npm run valid-layers-check.
Available skills in this workspace:
for the Phase 12 live E2E captured in `phase12-plan.md` (Step 14).
logs. Used to assert no [Claude] warn-logs during the scenario.
Tool-call kinds covered by Phase 8.5. Each kind exercises a distinct branch of the new helpers and a distinct workbench renderer. The E2E scenario hits every kind at least once across the live + replay paths.
| Kind | Tools | New behavior to verify | |------|-------|------------------------| | terminal | Bash, BashOutput, KillBash | Permission card + row use the terminal renderer (monospace + bash highlighting); invocation reads `Running <command> ; past-tense reads Ran <command> . | | search | Grep, Glob | Row uses the search renderer; invocation reads Searching for <pattern> / Finding files matching <pattern> . | | File link (no kind) | Read, Write, Edit, MultiEdit, LS, NotebookRead, NotebookEdit | Invocation contains a clickable markdown file link
Scenario (Agents app, [Local] workspace with the Claude agent):
1. Use launch to start the Agents window with ./scripts/code.sh --agents --remote-debugging-port=9224, pick a [Local] workspace, switch the agent picker to Claude. 2. Terminal + Read. Send: *"Run git status and then read README.md."* Verify:
(monospace block, bash highlighting) and reads *Running git status* — NOT *Run shell command*.
git status*(success-aware past tense).
[README.md](file://…) link rather than just "Read file". 3. Search. Send: *"Search for IClaudeAgentSession in this repo."* Verify the Grep/Glob row uses the search renderer with `Searching for IClaudeAgentSession ; on completion it reads Searched for IClaudeAgentSession . 4. **Subagent.** Send: *"Spin up 2 subagents that summarize the src/vs/platform/agentHost/node/claude` folder."* Verify:
Task parent row shows the model-authored description text (D9) — NOT the literal "Run subagent task" — and renders via the subagent renderer.
Glob / Read rows nest under each parent and render in their own kind's style (search / file-link). 5. Failure path. Send: *"Run false."* Verify the Bash card reads `Running false → after execution, "Run shell command" failed. 6. **Replay parity.** Click an older Claude session in the sidebar that contains shell + search + Read + Task tool calls (e.g. one of the sessions from steps 2–4 after a reload). Verify the historical rows render in the same renderers and with the same rich messages as the live ones — replay produces identical _meta and pastTenseMessage per D6. 7. Use code-oss-logs to read the agentHost log; assert no [Claude] warn-logs for the resolved tool calls. 8. **Auto-allowed tool visibility (regression guard for the missing-Ready bug).** In a NEW Claude [Local] chat session, send: *"Run git status` and then read README.md."* Wait for the chat to finish, then expand the response's thinking block. Verify:
block (a Ran git status row and a Read README.md row).
(stdout / file contents) are both visible when expanded.
This catches the case where the Claude SDK auto-allows a tool without invoking canUseTool — without a SessionToolCallReady emission at content_block_stop the tool stays in Streaming and the reducer drops the eventual SessionToolCallComplete, leaving an empty widget.
If the launch skill cannot be used, the same scenario is achievable by hand: open Agents window, send the same prompts, inspect the chat UI, then tail -f the agentHost log under ~/.config/Code - Insiders/logs/.../agentHost.log (path varies by OS; code-oss-logs resolves it).
*(Pre-grilling. Will be resolved during the grill-with-docs session and folded into Decisions above.)*
_attachToolResult needs the parsed input that was set in _openToolUse. The simplest path is a per-builder Map<toolUseId, Record<string, unknown>>. Is that map's lifetime correctly bounded by the builder, or does it need explicit cleanup on unmatched orphans? (Owner: implementer, resolve during Step 5.)
Today the only shell tools are Bash family. If/when the SDK adds Pwsh etc., does language become a column on the row, or derived? (Owner: roadmap, resolve when a non-bash shell tool appears.)
`copilotToolDisplay.ts`, `mapSessionEvents.ts`.
_meta precedent):`phase12-plan.md`.
launch, code-oss-logs.launch, code-oss-logs).Production:
toolKind / language columns on ClaudeToolRow; new Agent row; new exported helpers getClaudeToolKind, getClaudeShellLanguage, buildClaudeToolMeta, getClaudeInvocationMessage, getClaudePastTenseMessage, getClaudeToolInputString; private helpers truncate, md, formatPathAsMarkdownLink, readStringField, firstShellLine.
ClaudeToolCallRegistry owns per-tool-call attribution + input accumulation + computed start-info. See Deviation D5′ below.
ClaudeMapperState now composes a ClaudeToolCallRegistry (public toolCalls field); cross-message methods forward to the registry; added appendToolBlockInputDelta / finalizeToolBlock wiring on input_json_delta / content_block_stop; SessionToolCallStart emits _meta: buildClaudeToolMeta(...); SessionToolCallComplete uses getClaudePastTenseMessage; subagent Phase 12 path now produces meta via the same helper. Class size 197 → 136 LOC, 13 → 12 methods.
dispatchCanUseTool uses getClaudeInvocationMessage, getClaudeToolInputString, buildClaudeToolMeta on the ToolCallPendingConfirmationState.
_openToolUse and _attachToolResult use the rich helpers; added _toolUseInputs stash so past-tense gets the parsed input; removed local SUBAGENT_TOOL_NAMES (now table-driven via buildClaudeToolMeta).
subagent SessionToolCallStart now carries _meta; SessionToolCallReady uses getClaudeInvocationMessage; buildTopLevelSubagentReadyAction calls getClaudeInvocationMessage('Task'/'Agent', …) so the description fallback lives in one place (D9).
createToolReadyAction forwards state._meta into the emitted SessionToolCallReady action (D6 / R1).
Tests:
per-tool composite snapshot (Phase 8.5 — rich rendering snapshot) + defensive-input test + Agent-row test + MCP test.
— new file. 8 focused tests for begin / appendInputDelta / finalize / lookup / complete / clearPending.
— one existing assertion updated (Read file finished → Read file).
— one existing assertion updated for the new pretty-printed toolInput shape and rich markdown invocationMessage.
ClaudeToolCallRegistry was introduced as a second-pass refactor.** The first implementation pass extended ClaudeMapperState directly with input/info methods (pragmatic deviation: smaller diff, reuse of existing class). The follow-up /avoid-private-methods audit flagged the class as growing past the 7-method threshold, with input-tracking / file-edit-cache / cross-message-attribution / per-message-block as four distinct concerns. The registry was then extracted as the plan originally specified, with ClaudeMapperState composing it via a public toolCalls field so the mapper's existing call sites keep working. Net result: 60 LOC moved to a new file plus 8 focused unit tests; ClaudeMapperState shrunk to 136 LOC / 12 methods.
**/agentHost/test/node/*.test.js (was 1146;+8 from the new registry suite).
npm run typecheck-client clean.npm run valid-layers-check clean./avoid-private-methods audit re-run after D5′ extraction: ClaudeMapperState now at 12 methods across 3 concerns (per-message, file-edit cache, registry composition); no individual private method fails the checklist. Remaining low-severity finding (cacheFileEdit/takeFileEdit could move to a tiny file-edit-cache collaborator) is deferred as marginal value for the abstraction cost.
before the PR moves out of draft.
Ran against a claude-code [Local] workspace using the launch skill (Playwright/CDP into the Agents window) and the code-oss-logs skill (agent-host action stream). The Claude agent resolved to claude-sonnet-4-6 for the validated turn.
Validated live (terminal + generic + file-link): prompt *"Use the Bash tool to run 'git status'... and then use the Read tool to read README.md."* Captured agent-host action payloads:
session/toolCallStart for Bash: _meta: { toolKind: 'terminal', language: 'bash' } — confirms D1 (table-driven toolKind) + D6 (single-write on Start).
session/toolCallComplete for Bash: pastTenseMessage: { markdown: 'Ran git status' }, success: true — confirms D4 (success-aware) + rich helper output.
session/toolCallStart for Read: no _meta — confirmsgeneric-renderer tools omit the field.
session/toolCallComplete for Read: pastTenseMessage: { markdown: 'Read [README.md](file:///…/README.md)' } — confirms the file-link generic path.
listitem "Ran terminal command" — confirms the workbench's isTerminalTool branch sees _meta.toolKind and routes Bash into the terminal renderer.
No [claudeMapSessionEvents] warn-logs for the resolved tool calls. The Phase 12 subagent path used by the same _meta field still works (regression-free).
Validated via unit tests (other kinds): the remaining tool kinds in the matrix above are covered by `claudeToolDisplay.test.ts`'s Phase 8.5 rich-rendering snapshot — every tool row × {invocation, pastTense(success), pastTense(failure), toolKind, language, inputString}. The live emission code path that worked for Bash + Read is the same path used for Grep, Glob, Write, Edit, WebFetch, Task / Agent, and the failure branch; the renderer-side dispatch is the same _meta.toolKind lookup. Replay parity is covered by `claudeReplayMapper.test.ts`.
Deferred for follow-up validation: a wider live sweep across Grep / Glob / Task (D9) / failure / replay, on a build that has Phase 8.5 in the agent-host (the claude-code external session in the target workspace is pinned to an older agent host installation that predates these changes).
../../test/node/sessionPermissions.test.ts_meta instead of the bare display name. | | URL link (no kind) | | Invocation contains a clickable URL link. | | | , | Parent row uses the subagent renderer; invocation is the model-authored (D9), falling back to the display name. Inner Bash/Grep/Read rows nest under the parent and render in their own kind's renderer. | | Generic / MCP (no kind) | , , , | Render in the generic tool renderer; MCP is pretty-printed JSON. | | Failure | any of the above with | Past-tense reads "<displayName>" failed