Repository navigation
fix(server): Claude adapter v2 fixes (upstream G2) - #1005
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 1e7c8e0f24c217a3229615fa1de1e6ed85d7e835) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gents (#14726) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit b4d3d51ac99d4306d754afb5c78c49845bfac3c1) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… path (#15021) Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com> (cherry picked from commit 8283b481a34f5cc6f984f290e7cb93cc35b4dc56) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…5055) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 5bf19d12b0fd54fc9999579869bcf264bc555874) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit ce90eec1ffc2087395227a610843091f4b260cf7) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…entered itself (#15224) (cherry picked from commit aad732901e4b7d485574eaef5a9c1fb388c4291a) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…string Adapted from upstream 858b98b8fa618cf9b9528b5415493fcf0572ac88 (and 6414268859 for the exit-with-parent intent). Pylon's capability probe only sends initialize, and its fake CLI never had a keep-alive interval, so the fixture keeps Pylon's initialize-only behavior and exits when stdin closes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4197c0a to
a1175cb
Compare
|
CI note: on head a1175cb, Test Server 2 failed once in |
Ports upstream T3 group G2 (Claude adapter v2 fixes) into Pylon. Part of upstream cycle #996.
Sources
1e7c8e0f24tool_use_meta→ title +toolSource)cherry-pick -x(includesclaude_mcp_tool_presentationreplay fixture)b4d3d51ac9ClaudeBackgroundWorkBlocksQueryReplacementError; continuations keep the live process)8283b481a3resolveClaudeSdkExecutablePath)5bf19d12b0initcounts as wake evidence)ce90eec1ffaad732901esetPermissionModerestore on reuse)6414268859setInterval(Pylon's probe only sendsinitialize, noget_usage), so it already exits when stdin closes. Intent folded into the adapted fixture below.858b98b8faapps/server/src/provider/Layers/testing/ClaudeCapabilitiesProbe.fixture.mjs; upstream'sget_usagehandler and keep-alive not carried since Pylon's probe does not request usage.Pylon adaptations / interactions
settleInterruptedTurn/CLAUDE_INTERRUPT_GRACE) lived in the v1apps/server/src/provider/Layers/ClaudeAdapter.ts, which was removed when Pylon adopted orchestrator v2 (eed7e978f6). None of these sources touch v1 or the v2interruptTurnpath; v2interruptTurnstill awaitsquery.interruptacknowledgement beforeclose.b4d3d51ac9only adds astopping = truemark incloseLiveQueryForNativeThread(Stop/rollback/fork), so Stop still always closes the process. Behavior otherwise unchanged; whether the v1 "wait for the turn to settle before kill" grace should be re-ported to v2 is a separate follow-up (not in scope here).ProviderFailure.tsmaps the new tag to its own message.titlechain: kept G3'sdynamicToolTitle(...)and added the MCPpresentation.titleafter it, matching upstream's final order (searchTitle ?? dynamicToolTitle ?? presentation.title ?? null).Applicability to other adapters (follow-ups, not ported)
1e7c8e0f24): Claude-specifictool_use_meta. No other v2 adapter setstoolSource; Codex/OpenCode MCP presentation is a possible follow-up if their protocols expose server names/icons.b4d3d51ac9): Claude-specific (selection change replaces the CLI process). Codex/OpenCode take per-turn model selection without process replacement; Prime not checked in depth — follow-up.init, self-entered plan mode: Claude CLI/SDK-specific; no equivalent in Codex/OpenCode/Prime.ce90eec1ff): Codex, Cursor, Pi and OpenCode2 already assertinterruptedinturn_interrupt_mid_tool/opencode2_interrupt. OpenCode v1 (OpenCodeAdapterV2.tsmaps tool parterror→failedregardless ofturn.interrupted) likely has the same bug — follow-up. Prime: not verified — follow-up.Verification
vp run -F t3 typecheck— exit 0, 0error TS(rantsc --noEmitinapps/server).vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts src/provider/Layers/ClaudeCapabilitiesProbe.test.ts— 2 files, 131 tests passed.vp test run src/orchestration-v2/testkit/ClaudeReplayFixtures.integration.test.ts src/orchestration-v2/testkit/OrchestratorReplayFixtures.contract.test.ts src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts— 3 files, 129 tests passed (incl.claude_mcp_tool_presentation,claude_background_task_interrupt,turn_interrupt_mid_tool/claudeAgent).CLAUDE_CONFIG_DIRunset (known local env issue forclaude_result_is_error).vp lint/vp fmt --checkon changed files — format clean; only two pre-existingno-unused-varswarnings inClaudeAdapterV2.ts/.testkit.ts.Re-run after the rebase onto #999: typecheck exit 0; the five test files above together pass (260 tests).
Unverified
tool_use_meta, plan-mode restore, and background-work refusal beyond the recorded replay fixtures and unit tests.🤖 Generated with Claude Code