Repository navigation
feat(agents): route child replies to the initiating tab across CLI, MCP, and split panes - #470
Merged
Merged
Conversation
…CP, and split panes
Owner
|
Looks correct and safe to merge, lineage threading and the trust boundary on the tab id both check out. One nit: if the initiating split-pane agent has since exited, Thanks for the contribution! |
Contributor
Author
|
Addressed in 64336c9:
|
simion
approved these changes
Nov 26, 2026
simion
left a comment
Owner
There was a problem hiding this comment.
Clean fix, nice job tracing the lineage through CLI, MCP, and split panes consistently. Thanks for the thorough testing writeup.
simion
added a commit
that referenced
this pull request
Nov 26, 2026
#470 deliberately signs the copied briefing with the sending tab (`${TERMIC_TAB_ID:+ tab:$TERMIC_TAB_ID}`) so a reply comes back to it, and the task spec still expected the old signature on every platform. Refs #470 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
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.
Summary
When a parent task has multiple agents running (either in multiple tabs or split panes) and spawns a child task in another project, an unqualified reply from the child (
termic send <parent>or MCPtask_sendwithouttab) previously routed to the parent task'sis_defaulttab (or single active agent) instead of the agent tab that spawned the child.This adds end-to-end tab lineage tracking (
spawned_by_tabvia$TERMIC_TAB_ID/X-Termic-Tab), extends exact tab-ID targeting to split-pane agents across CLI and MCP, updates agent briefings/instructions/skills to carry tab identity, and hardens spawn/resume tab selection in the store RPC bridge.What changed
termic-proto,termic-server,src-tauri/src/lib.rs,src-tauri/src/peers.rs):PROTOCOL_VERSIONto27, addingparent_tabtoCommand::New,caller_tasktoCommand::Send, andspawned_by_tabtoTaskSummaryandTask.task_link_spawn/apply_spawn_linkto recordspawned_by_tabalongsidespawned_by.parentTabIdon CLI/MCP task creation so the store writes lineage atomically.src-tauri/src/cli_server.rs,src/lib/cliRpc.ts,src/lib/cliAgentState.ts):pane_tab_statesalongside striptab_states(preserving strip-tab indices, title lookups,tab close, andtab rename).send), log reading, PTY attach, andpropreads/writes (handle_prop).--tab,handle_sendforwards the raw storedspawned_by_tabaspreferredTabIdwithout eagerly rewriting or falling back to a sibling title match;sendPromptHandlerroutes to that tab when live and falls back cleanly tois_defaultwhen closed/dead.waitForAgentPty+injectPromptTracked) onto a single resolvedtargetTabId, returning{ mode, capable, tabId }accurately.tabFromPersisted(insrc/store/app.ts) to preserve original tab IDs, CLI, and sessions without duplicating defaults or leaving an unconsumedmarkUnattendedSpawnmarker behind.src-tauri/src/mcp_server.rs,src/components/settings/McpSection.tsx, locales):X-Termic-Tab(MCP_TAB_HEADER) to the shell header helper andtermic mcp-headers, plusclaude_needs_update/codex_needs_updatedetection with an upgrade prompt banner in Settings -> MCP (mcp.needsTabUpdate).parentTab(same-task only fortask_new/task_review),caller_task(task_send), and baretask_propwrites fromX-Termic-Tab; accepted explicitparentTask/parentTabontask_review; scopedP_TABhelp to selector rules and documented per-tool omitted-tab behavior ontask_send,task_wait, andtask_log.src/lib/agentBriefing.ts,termic-cli,src-tauri/assets/skills/termic/,docs/):tab:<id>in bilateral agent message headers and single-lineTERMIC_TAB_IDreport-back flags in prompt templates/briefings, paired-machine instructions, CLI help (new,send,wait,attach,logs), and reference docs.Testing
src/lib/agentBriefing.test.ts,src/lib/cliAgentState.test.ts,src/store/cliSend.integration.test.ts,src/store/cliTabProps.integration.test.ts,src/store/resume.integration.test.ts,src/store/app.test.ts): 6 files, 235 passed (added 12 new tests across briefing formatting, split-pane state/props,preferredTabIdrouting, spawn lock-in, and non-agent-strip durable resume).npm test: 255 of 256 files passed (3959 of 3961 tests); the only failure is pre-existing upstreame2e/fixedWaits.test.tson untouchede2e/specs/peers.e2e.tslines 947 and 971.cargo test):cargo test --workspace --lib --manifest-path src-tauri/Cargo.toml: passed (termic_lib: 1770 passed / 8 ignored;termic_cli: 98 passed;termic_proto: 29 passed;termic_remote: 73 passed).cargo test --workspace --manifest-path src-tauri/Cargo.toml(before the final TypeScript-only fix, with zero Rust changes afterward): passed all crates includingtermic_server(17 unit + 8 e2e).npm run build(tsc -b && vite build),npm run typecheck:e2e, andgit diff --checkall passed after the final edit.