apache / apache/maka

feat(cli): TUI resume has no discovery surface — no interrupted-session hint, and /resume errors when no session is attached

Open
#3,508 1 comment 0 reactions 1 assignee Claimed by @me2seeks View on GitHub
enhancement
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
715

Description

## What happened

The TUI's safe-boundary resume has no discovery surface, so the feature is effectively invisible even when it would work:

1. **No interrupted-session signal at startup.** When the attached (or most recent) session has a failed/cancelled run that `/resume` could continue, the TUI shows nothing. The user must already know `/resume` exists and guess that it applies. Desktop solves this with an interrupted-turn banner carrying a **Safe resume** action (`use-shell-resume.ts` / AppShell); the TUI has no equivalent.
2. **`/resume` with no session attached fails raw.** In a fresh TUI (no session attached yet), `/resume` throws the driver's internal `Cannot resume before a session starts.` as a red error instead of helping the user reach a resumable session.

Reproduced live (with `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME=1`):

- Provider turn fails with a 502 → exit → relaunch TUI in the same cwd → no indication anything is resumable; `/resume` only helps if you already switched back to that session via `/session`.
- Fresh TUI, no session attached → `/resume` → `Error: Cannot resume before a session starts.`

## How to reproduce

1. `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME=1 maka` in a project with an existing session
2. Send a message; have the turn fail (e.g. provider error) or cancel it with Esc
3. Relaunch the TUI in the same cwd — observe: no hint that the session has an interrupted run
4. In a TUI with no session attached, type `/resume` — observe the raw red error

## Environment

- Maka version or commit: 944d82289 (main, v0.1.11)
- OS and version: Linux x64
- Surface: TUI / CLI
- Node.js version, if running from source: 26.3.0

## Expected behavior

- When the current/most-recent session for the cwd has an interrupted run (and the host reports resume available), the TUI shows an informational hint at startup/attach, e.g. "This session has an interrupted run — /resume to continue from the safe boundary." A passive hint is enough; no auto-resume is needed (Desktop owns the auto-resume policy).
- `/resume` with no session attached opens the session picker (scoped to resumable sessions where the driver reports them) instead of throwing `Cannot resume before a session starts.`

## Logs, screenshots, or additional context

- Builds on #3505 / PR #3506, which made parked plans render as informational notices; this issue is about the TUI never *offering* resume in the first place.
- Desktop already implements the discovery half of this story: interrupted-turn banner + Safe resume action + per-reason toast copy via `resumeParkToastCopy` in `@maka/ui` (note: that copy operates on runtime-level `rejectionReasons` and is currently zh-CN-only, while the TUI copy added in #3506 operates on protocol-level `TurnResumeParkReason` — sharing or aligning these two copy layers could be part of this work).
- Out of scope here: the Phase 3 production reconciler for indeterminate tool side effects (documented as designed-but-unwired in `docs/architecture/runtime-resume-architecture.md`) — that is a separate, larger runtime effort.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.