feat(resume): late-join an existing claude session into the mesh#31
Open
Lanzelot1 wants to merge 6 commits into
Open
feat(resume): late-join an existing claude session into the mesh#31Lanzelot1 wants to merge 6 commits into
Lanzelot1 wants to merge 6 commits into
Conversation
Add LaunchOpts.resume; the claude connector emits --resume <id> --fork-session (forks so the original session keeps its identity), composing with the strict-MCP isolation and skipping the greeting prompt. Threaded through cotal spawn --resume and the manager's start/opStart. codex/opencode throw (resume is claude-only). Closes #23. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Assert the claude connector folds --resume <id> --fork-session in while keeping --strict-mcp-config and dropping the greeting on resume, and that codex/opencode reject --resume (fail-closed). Wired as pnpm smoke:resume. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add fork?: boolean to LaunchOpts; the claude connector emits --fork-session only when fork !== false. Default still forks, so spawn/start --resume and the resume smoke are unchanged; cotal resume --in-place passes fork:false to continue the same session id instead of branching a new one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A live claude can't be hot-attached (MCP/hooks/channel are launch-bound), so late-join means relaunching a session's history wired to the mesh. cotal resume needs no agent file and runs from any directory: it discovers the newest session for --cwd (~/.claude/projects/<encoded-cwd>/<id>.jsonl) and launches claude there, with definable --space/--server. Fork by default (original untouched); --in-place continues the same id. New lib/session.ts holds the discovery helpers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Assert fork:false drops --fork-session while keeping --resume (and the default still forks), and that findClaudeSession returns the newest session by mtime with the cwd→projects-dir encoding (empty for an unknown cwd). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Instead of writing a new resume command, we should have a pass-through for resume with spawn. This way we can just wire it to the claude code command and be specific to claude code, so that we don't interfere with other implementations and connectors. |
…eview) Drop the standalone `cotal resume` command + session-discovery helper; resume is now a pass-through flag on spawn (and start), claude-specific. Other connectors ignore `--resume` like they already ignore `prompt` — no more throws. Co-Authored-By: Claude Opus 4.8 (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.
What
Late-join an existing Claude Code session onto the mesh. A live
claudecan't be hot-attached (its MCP, hooks and wake channel bind at launch), so late-join means relaunching the session's history wired to the mesh.It's a
--resume <id>pass-through oncotal spawn(andcotal start) — claude-specific, no new command:--resume <id> --fork-session: replays the transcript into a fresh, mesh-equipped process under a new id, so the original keeps its identity and runs untouched.--in-place(spawn only) — plain--resume <id>: the same id/transcript continues, now mesh-wired (exit the original first — two live processes writing one transcript corrupts it).Resume is claude-only; the other connectors ignore the flag (like
prompt).Changes
core:LaunchOpts.resume?+LaunchOpts.fork?(fork defaults on)connector-claude-code: emit--resume <id>, add--fork-sessionunlessfork === false; skip the greeting on resumecli:--resume/--in-placeonspawnmanager:--resumeonstart; threaded intobuildLaunchresume.smoke.ts— claude argv composition + fork toggleclaude-code-integration.md,getting-started.md,CLAUDE.mdNotes
split/04-setup(composes with the--strict-mcp-configisolation from feat(control-plane): manager-by-default + cotal_purge #27). Rebase tomainafter build: publish the cotal-ai npm package #26-29 merge.🤖 Generated with Claude Code