Repository navigation
Description
What happened
When the Runtime Host refuses a Branch or an edit-and-resend (session.branch.create / session.revision.create returning session_busy or operation_unavailable), Desktop shows only the generic "Operation failed / Task action failed, try again later" toast. Retrying does not help for operation_unavailable, and session_busy gives no hint about what is still running.
The cause is on the Desktop side. sessions:branchFromTurn (for ordinary branches) and sessions:reviseBeforeTurn rethrow RuntimeHostOperationError. Electron IPC drops the error class and code, so app-shell-turn-actions.ts and app-shell-revision-actions.ts can only fall back to localizedShellErrorMessage. Side conversations already get a structured { ok: false, reason } result and show a specific reason.
Expected: both actions show why the Host refused (for example "this task or one of its subagents is still running" vs "this conversation contains content that cannot be branched or edited yet").
How to reproduce
- In a Session with at least two turns, start a new turn and keep it running.
- While it runs, click Branch on an earlier turn's footer (or edit and resend an earlier message).
- Observe the generic "Operation failed" toast. The Host reported
session_busy/Source Session has an active Turn.
Environment
- Maka version or commit:
main@ 1e31d0a - OS and version: any
- Surface: Desktop
Logs, screenshots, or additional context
Split out of #5333 / #5757. #5757 fixes the Host side: branches and revisions no longer fail just because linked children exist. What remains here is the rarer refusal cases.
Why this was not done in #5757: both action files are root debt in apps/desktop/renderer-architecture.json, so their token, import and bridge counts can only shrink (the attempt in #5757 failed check:architecture). The ledger already assigns them to features/conversation (session-controls-and-turn-actions). A proper move needs:
- a session-copy port on
ConversationServices(branchFromTurn,reviseBeforeTurn,abandonSessionCopy) with a platform adapter, because features may not touchwindow.maka; - new homes for the legacy helpers the actions import (
session-copy-attempt,session-workspace-errors,localizedShellErrorMessage), because new feature-to-legacy imports are forbidden; - render-prop wiring for the revision draft state and
prepareRevisionSend, because AppShell may not add hook calls; - one structured copy result,
{ ok: true, session } | { ok: false, reason: 'session_busy' | 'operation_unavailable' }, for branch, side conversation and revision, with one shared reason copy table and each action keeping its own title. Refusals are expected outcomes, so they should use an info toast, not the error toast.
This overlaps with the planned fork/rewind rework.
Activity
Astro-Han commentedon Sep 27, 2026
take
fix(runtime-host): one linked-child rule for every conversation copy (#…
Astro-Han commentedon Nov 5, 2026
Closing: this targets the TypeScript implementation on
main, which is superseded byrust-preview(#6366). If it still applies torust-preview, please open a new issue against it.