Repository navigation
feat: transcript export, conversation import picker, and subagent worktree setup on v2 - #153
Merged
adampeterhiggins merged 1 commit intoOct 5, 2026
Conversation
…ktree setup on v2 Restores four fork features the orchestration v2 merge removed or left half-wired: - Export a transcript: buildThreadTranscript renders an OrchestrationV2ThreadProjection (timeline order via deriveTimelineEntriesFromVisibleTurnItems, header from projection.thread), loaded with a restored loadFullThreadSnapshot. The dialog and every entry point (thread action menu, sidebar, legacy sidebar, command palette) are back. - Import a CLI conversation: agentSessions.list and single-session agentSessions.import on top of upstream's bulk importer. Sessions are marked with the thread holding them, by the deterministic import id or an unarchived thread's active provider thread. The web picker and its entry points return. - Claude subagent worktrees get the project setup: a SubagentStart hook through makeClaudeQueryOptions in ClaudeAdapterV2, with SubagentWorktreeSetup reading the project from ProjectionStoreV2. - Mobile work rows show commands and file paths relative to the thread workspace. formatToolTextForWorkspace now keys on the work entry's tone so it recognises v2 items, and web uses it instead of its own copy. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The orchestration v2 merge (#149) deleted or half-wired four fork features: Export a transcript (#87, dialog, builder, snapshot loader, and every entry point removed), the Import a CLI conversation picker (#99, contracts reverted to upstream's bulk-only import,
agentSessions.listand the dialog gone), Claude subagent worktrees get the project setup (#127,SubagentWorktreeSetupdeleted with the v1 Claude adapter), and mobile's half of Commands and file paths shown relative to the workspace (#88, upstream's rewritten mobile feed never got the workspace root).How it is restored on v2
Export a transcript
buildThreadTranscript(apps/web/src/lib/threadTranscript.ts) now renders anOrchestrationV2ThreadProjection. It takes messages, proposed plans, and the work log from upstream'sderiveTimelineEntriesFromVisibleTurnItems, so the order matches the timeline. Reasoning, todo lists, and event cards are left out. The front matter header comes fromprojection.thread.loadFullThreadSnapshottopackages/client-runtime/src/state/threadSnapshotHttp.ts. It wraps the fullGET /api/orchestration/threads/:idroute and uses upstream'sManagedRelay.ManagedRelayDpopSigner/RemoteEnvironmentAuthorization.RemoteEnvironmentAuthorization.TranscriptExportDialog.tsx(including the chat-tab picker) and every entry point: thread action menu (threadActionMenu.logic,useThreadActionMenu,Sidebar), theLegacySidebarthread menu, the command palette, and the host inroutes/__root.tsx. The desktopsaveTextFileIPC andlib/saveTextFile.tshad survived and are reused.Import a CLI conversation (built on upstream's bulk
AgentSessionImporter)AgentSessionRef, optionalsessiononAgentSessionImportInput,threadIdson the result,AgentSessionListInput/AgentSessionSummary/AgentSessionListResult, andWS_METHODS.agentSessionsListwith its RPC. Added theRpcAuthorizationread-scope entry. TheagentSessionPickercapability was already advertised.AgentSessionScanner.recentThreadstakes{ session, refresh }options, and parsed threads carrymessageCount(the full transcript count, not just the 200 kept messages).AgentSessionImporter.listProjectAgentSessionsreturns the newest 50 sessions plustruncated. Each session is marked with the thread already holding it, found in one projection query: upstream's deterministicimport:<instance>:<session>id, or any unarchived, undeleted thread in the project whose active provider thread's native id is that session (this covers threads T3 started itself). A single-session import runs upstream's importer path with a fresh, narrowed scan and returnsthreadIds.ImportConversationDialog.tsx, which now shows provider icons through<ProviderInstanceIcon driverKind=…/>. Its entry points are back: Import conversation into … in the command palette, and Import conversation… in the legacy sidebar's project menu, both gated on the capability.Claude subagent worktrees get the project setup
apps/server/src/project/SubagentWorktreeSetup.tsis ported. It looks the project up throughProjectionStoreV2.getThreadShell, andProjectSetupScriptRunner.runForThreadis unchanged.makeClaudeQueryOptionsacceptshooks.ClaudeAdapterV2builds aSubagentStarthook (makeSubagentWorktreeSetupHooks) when the setup service is present and the thread has a cwd. Each real path is prepared once per provider session, and the thread's own worktree is never prepared.server.ts,SubagentWorktreeSetup.layersits beside the provider loggers so driver creation sees it, andinstallLivesits in the runtime core where the projection store and setup runner exist.Relative commands and paths on mobile
buildThreadFeedtakesworkspaceRoot, anduse-thread-composer-statepasses the thread cwd. Work entries get relative commands (a leadingcdto the workspace is dropped), tool labels, details, tool titles, and changed files. Copy text keeps the exact command.workEntryRowLabeltakes the root for read paths that come straight from tool input.ThreadFeedpasses its existingworkspaceRootthroughThreadWorkLog.formatToolTextForWorkspace, which only recognised v1 item types. It now keys on the work entry'stone === "tool", like v2. Web's duplicateworkEntryTextForWorkspaceis removed in its favour.Verification
npx tsc --noEmit -p .inapps/server,apps/web,apps/mobile,apps/desktop,packages/client-runtime,packages/contracts: clean.apps/server:npx vp test run src/project/AgentSessionImporter.test.ts src/project/AgentSessionScanner.test.ts src/project/SubagentWorktreeSetup.test.ts src/auth/RpcAuthorization.test.ts src/orchestration-v2/Adapters/ClaudeSubagentWorktreeHooks.test.ts(100 passed), andsrc/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts(140 passed).apps/web:npx vp test run src/lib/threadTranscript.test.ts src/components/threadActionMenu.logic.test.ts src/components/chat/MessagesTimeline.logic.test.ts(164 passed).apps/mobile:npx vp test run src/lib/threadActivity.test.ts(81 passed).packages/client-runtime:npx vp test run src/work-log/commandDisplay.test.ts(32 passed).npx vp check --fixon the changed files: 0 errors.New tests:
threadIds, and listing against a real in-memory projection that marks imported, T3-started, and archived holders.SubagentStarthook preparing each worktree once and skipping the thread's own.Not restored / notes
docs/fork-differences.mdstill linkspackages/client-runtime/src/state/agentPanelView.tsfor the Agents panel part of the relative-paths section. That file belongs to the Agents panel feature group, which is not restored on this base.Done by Claude Opus 5.5 in Claude Code (via T3 Code).
🤖 Generated with Claude Code