Repository navigation
feat(server): t3_thread_import, conversation only - #16731
juliusmarminge wants to merge 1 commit into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: 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. |
34e2882 to
ca1ff44
Compare
ca1ff44 to
f139c6e
Compare
A thread moving here from a linked environment needs its conversation. t3_thread_import creates the thread with that history as runless, imported messages, so its first run gets it as a text context handoff whatever the provider, then sends continuationPrompt as that run's message. The thread id is a hash of the source environment, thread and handoff id, and the continuation's command id derives from the thread, so a retried import returns the thread the first created and starts nothing new. The tool goes through startsThreads: modes are capped by the caller's, and a link's import carries its linkOrigin. worktreePath, when given, must be one of the project's worktrees. The imported-history header no longer names "the previous T3 Code orchestrator", since history now also arrives from other environments. The capturing Codex adapter from the V1 cutover test moves to a testkit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
f139c6e to
70a654c
Compare
End-to-end run, two real serversTwo Every handoff in the run seeded the box's thread through Opus 5.5 via Claude Code. |
Part of cross-environment orchestration. Moving a thread to another environment needs its conversation over there. This PR adds the receiving half for the conversation. The code moves in the next PR, and the handoff that drives both comes after that.
What changes
t3_thread_import(behind a newthreadImportcapability) creates a thread whose history is the given user and assistant messages.historyOrigin: "v1_import". That makes its first run receive the history as a text context handoff, which works the same for every provider.continuationPrompt, when given, becomes that run's message.startsThreads, so modes are capped by the caller's. A link's import carries itslinkOrigin(feat(server): work a linked environment starts stays within its link #16695). IfworktreePathis given, it must be one of the project's worktrees.testkit/CapturingCodexAdapter.tsfor reuse.Verification
orchestration-v2/ThreadImportService.test.tsruns a real orchestrator (replay harness, SQLite) with a capturing adapter:created: false, and adds no messages, runs or provider turns.mcp,peer,ContextHandoffService,legacy(including the V1 cutover integration test on the extracted adapter),AgentSessionImporter,Orchestrator.migration, sharedt3McpToolPresentationand the toolkit catalog checks. All passed. Server and contracts typecheck clean, and lint is clean on the changed lines.Opus 5.5 via Claude Code.
🤖 Generated with Claude Code