Skip to content

Desktop shows a generic failure when the Host refuses a Branch or edit-and-resend #5762

Closed as not planned

Description

@Astro-Han

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

  1. In a Session with at least two turns, start a new turn and keep it running.
  2. While it runs, click Branch on an earlier turn's footer (or edit and resend an earlier message).
  3. 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 touch window.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

  1. added
    bug
    on Sep 27, 2026
  2. Astro-Han commented on Sep 27, 2026

    @Astro-Han
    ContributorAuthor

    take

  3. Astro-Han commented on Nov 5, 2026

    @Astro-Han
    ContributorAuthor

    Closing: this targets the TypeScript implementation on main, which is superseded by rust-preview (#6366). If it still applies to rust-preview, please open a new issue against it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions