feat: BTW ephemeral forks + MCP mode descriptions#954
Open
mistercrunch wants to merge 4 commits into
Open
Conversation
…Mode support
Implements three connected features:
1. **Fork-while-running**: Removed the isRunning guard from the fork button
in SessionPanel, allowing users to fork sessions at any time regardless
of status. The fork captures persisted conversation history.
2. **callbackMode ("once" | "persistent")**: Added callback firing mode to
control how many times callbacks fire. "once" (new default) fires on
first completion then auto-disables. "persistent" preserves legacy
behavior. Available on spawn, create, and update MCP tools.
3. **"btw" mode on sessions.prompt**: New ephemeral fork mode that forks
the target session (even if running), sets up a one-shot callback to
the caller, and auto-archives the fork after the callback delivers.
Perfect for asking side questions without disrupting running work.
Frontend additions:
- "btw" button appears next to Send when session is running
- Placeholder text hints at btw mode when session is working
- BTW forks show orange "btw" badge instead of cyan "FORK" tag
- WorktreeCard tree shows "btw" label for ephemeral forks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dge cases Fixes from Codex code review of PR #953: **Critical**: btw button now uses dedicated `btwForkSession` action that patches fork_origin:"btw" on the forked session, instead of calling the regular fork flow which had no btw semantics. **Backward compat**: Legacy sessions without callback_mode now default to "persistent" (not "once"), preserving existing behavior for pre-existing spawned sessions. **Edge cases**: Moved btw auto-archive and once-mode auto-disable out of queueCallbackToSession into the parent task completion handler, so they run even if the callback target session is deleted/inaccessible. **DRY**: Merged fork and btw mode handlers into a single code path in the MCP sessions.prompt tool, with conditional btw-specific patch. **Modeling**: Simplified fork_origin type to just "btw" (undefined for regular forks). Added "btw_completed" archived_reason for auto-archived ephemeral forks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Inject system message into parent session when btw fork completes, showing the question (blockquote) and response as markdown - Include caller session info for remote btw (MCP), hidden for local - BTW button always visible with ? icon, consistent button styling - FileUploadButton matches other toolbar buttons (remove type="text") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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.
Summary
agor_sessions_promptmode descriptions: Clarified what each mode is for — btw is for quick side questions (status checks, summaries, fixes), not restricted to read-only.Test plan
agor_sessions_promptwithmode: "btw"on a Claude session worksagor_sessions_promptwithmode: "btw"on a Codex session returns capability error🤖 Generated with Claude Code