跪拜 Guibai
← All articles
Frontend · Agent · AI Programming

One Window for Nine Coding Agents: The Architecture Behind Seamless Handoffs

By 不一样的少年_ ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Anyone juggling multiple local AI coding CLIs knows the pain of copying handoff documents between terminals; this architecture abstracts task state out of the individual agent processes, so switching costs drop to a click and context survives agent changes. The hybrid of private channels plus a standard waits for fewer adapters as new agents ship.

Summary

Anyone who has switched between Codex and Claude Code in daily work knows the ritual: finish planning in one CLI, ask it to write a handoff summary, paste into the other terminal, then reverse the process when the new conversation hits a boundary. This design report from a team that built an internal agent console describes how they collapsed that loop into one chat window.

Under the hood, a Plan object owns the full conversation context, separate from any agent process. Nine CLIs connect through three protocol channels: Codex gets a dedicated app-server, Claude Code gets a stream-json pipe, and the other seven (Cursor Agent, Grok Build, OpenCode, OMP, Antigravity, Pi, DeepSeek Harness) all speak the open ACP standard. When you switch agents, the backend chooses among three handoff modes: a fresh handoff package for a newcomer, direct follow-up for the same agent, or a bookmark-based catch-up for a returning one. A two-grid output format (reply + planMarkdown) keeps casual chat from overwriting the plan document.

The details are what make it plausible: a turn number stops messages from a stopped agent leaking into a new conversation, resident processes are recycled after 30 idle minutes, and a phonebook maps Plan+Agent to native session IDs so a resumed conversation goes straight back to the original thread. The authors also draw a hard line for Google's Antigravity, which stays on ACP but is restricted to manual sends because of Google's platform rules. That isolation is a useful reminder that protocol compatibility doesn't mean vendor policy compatibility.

Takeaways
— Nine local CLI agents are supported in one Plan window.
— The backend maps agents to three protocol channels: app-server for Codex, stream-json for Claude Code, and ACP for the other seven.
— Each round gets a turn ID; late messages from a stopped agent are discarded when they don't match the current turn.
— A handoff package for a new agent contains the full plan text, the last 12 chat entries, and the list of unresolved questions.
— Follow-up questions to the same agent reuse its original native session, preserving the model cache.
— Returning to a previous agent triggers a bookmark-based catch-up that only feeds messages from the agent's absence.
— Idle CLI processes are kept alive for 30 minutes before recycling; session loss triggers an automatic re-handoff.
— The two-grid output uses reply and planMarkdown fields; planMarkdown must be empty for pure Q&A to avoid overwriting the plan.
— Antigravity is restricted to manual, single-turn input and is isolated from automatic tasks and cross-agent context sharing, per Google's platform rules.
Conclusions

Dedicated private channels for Codex and Claude Code while leaving the long tail on ACP is a trade-off that trades adapter coverage for native control, which matches where the heaviest daily usage sits.

The right-hand plan document is treated as durable long-term memory while chat is scratch paper; only decisions written into planMarkdown survive a handoff, so users are silently trained to commit conclusions to the plan.

Protocol compatibility does not erase vendor policy differences: Antigravity speaks ACP yet must stay manual-only because of Google rules, so tool builders still need per-vendor red lines even with a common standard.

Truncating chat history to the last 12 entries while keeping the full plan text is a deliberate token-saving choice; it assumes the plan captures durable decisions and that older verbal nuance can be safely dropped.

Concepts & terms
ACP (Agent Client Protocol)
An open standard that lets a host client start, prompt, and manage local coding agents uniformly, analogous to USB-C for agent communication.
Plan
The task-level conversation container holding full context (discussion history, plan text, unresolved questions), decoupled from any single agent CLI process.
Turn
One complete user-message-to-agent-final-reply cycle, including internal tool loops, identified by a backend-assigned turn ID to prevent stale messages mixing in.
Handoff / Follow-up / Catch-up
Three context-feeding strategies when switching agents: a full package for newcomers, direct continuation for the same agent, and bookmark-based catch-up for returning agents.
From the discussion

The discussion centers on whether a single-window multi-agent relay is truly necessary and how to prevent context loss during handoffs. For single-agent workflows the tool is deemed pointless, while mixed-agent workflows treat it as a real convenience. A concrete technical issue surfaces: implicit constraints set by one agent get overwritten by the next, and the proposed fix involves separating Plan/Agent/Model layers and carrying the full Plan with the chat. A related open-source Obsidian plugin built on the same multi-agent + ACP idea is also pitched.

— The value of the tool is contested: it appears useless for developers who consistently stick to one agent, but essential for those juggling multiple agents for different tasks like planning versus code review.
— Switching agents can silently discard implicit constraints; an example shows Codex's test branch being altered by Claude after handoff.
— A stabilizing approach separates Plan, Agent, and Model into distinct layers, where the Plan holds only facts and decisions and the Model never touches state.
— The authors' method to prevent constraint loss is to write settled decisions directly into the Plan, transfer the entire Plan plus recent chat, and restrict the new agent to extending rather than rewriting the original plan.
— An Obsidian plugin named 'Oh My Claudian' brings the same multi-agent + ACP pattern to embed local CLIs like Claude Code, Codex, Cursor, and OpenCode directly into Obsidian.
Featured comments
侵晨

Doing it for the sake of doing it, I don't see any meaning in it.

不一样的少年_

If you stick with one agent long-term, you really don't need it. We're used to discussing solutions with Claude and having Codex review details and write code; copying context back and forth is annoying, so we just saved that step in our in-house console.

行走的前端码农  → 不一样的少年_

Hasn't Claude been banned yet?

badhope

I just stepped on this exact point about single-window multi-agent relay last week. At first I treated 'switching agents' as 'switching models', and the constraints in the Plan got lost with the change: Codex defined the test branch, Claude took over and changed it based on its own understanding. Later I separated the three layers - Plan, Agent, Model - where Plan only stores facts and decisions, Agent only executes, and Model doesn't touch state; only then did it stabilize. In your setup, how do you prevent the next agent from eating the previous agent's implicit constraints when switching?

不一样的少年_  · 1 likes

For things like the test branch you mentioned, we write them directly into the Plan on the right once we've settled them in the chat on the left, not leaving them as just talk; when switching to a new agent, we carry the entire Plan and the recent chat over, and only let it add on top of the original plan, not let it change what was already decided based on its own understanding.

不一样的少年_

Friends who usually use Obsidian can check out the open-source plugin 'Oh My Claudian' made by my colleague, which also uses the multi-agent + ACP approach from this article, embedding local CLIs like Claude Code, Codex, Cursor, and OpenCode directly into Obsidian for use; the experience is quite smooth: https://community.obsidian.md/plugins/oh-my-claudian [heart gesture]

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗