You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "me2seeks (via GitHub)" <gi...@apache.org> on 2026/08/22 14:16:09 UTC

[PR] fix(cli): surface parked /resume plans as informational notices, not errors [maka]

me2seeks opened a new pull request, #3506:
URL: https://github.com/apache/maka/pull/3506

   ## Summary
   
   The TUI `/resume` command could never succeed (#3505). The Runtime Host wires `safeBoundaryResumeEnabled` to `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME`, an env var nothing sets, so `turn.resume.query` always returns a parked plan (`resume_feature_disabled` → `continuation_unavailable`) and the TUI threw it as a red error:
   
   ```
   Error: Safe-boundary resume parked: continuation_unavailable
   ```
   
   With the flag set, a `/resume` after a *completed* turn parks with `resume_candidate_missing` and fails the same way — even though "nothing to resume" is a normal state, not an error. Reproduced both live in the TUI (issue body has the full trace); with the flag set and a genuinely interrupted run, the resume machinery itself works fine.
   
   This PR makes the failure mode honest:
   
   - `runtime-host-session-driver` throws a dedicated `SafeBoundaryResumeParkedError` carrying the protocol park reason, instead of a plain `Error` whose message is the only signal.
   - The TUI catches it in `/resume` and renders plain-language informational notices instead of a red error:
     - `continuation_unavailable` → "Safe-boundary resume is not enabled on this runtime."
     - `resume_candidate_missing` → "Nothing to resume: no interrupted run exists in this session."
     - `session_busy` → "Cannot resume: the session already has an active turn."
     - other reasons keep the raw detail for diagnosis.
   
   Whether to enable safe-boundary resume by default is a product decision left to maintainers; this change makes the current default behavior comprehensible either way.
   
   Fixes #3505
   
   ## Verification
   
   - `packages/cli` test suite: 121/121 pass, including two new tests pinning the informational rendering for `continuation_unavailable` and `resume_candidate_missing`.
   - `npm run lint`, `npm run format:check`, `tsc -p packages/cli/tsconfig.json --noEmit`: all clean.
   - Live TUI reproduction before the fix: `Error: Safe-boundary resume parked: continuation_unavailable`.
   - Live TUI after the fix (same repro): `Note: Safe-boundary resume is not enabled on this runtime.`
   
   ## AI use
   
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: Maka Agent (Claude) — investigated the root cause, reproduced the bug in a live TUI session, implemented the fix and tests, and authored the commit message and this description under human direction.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(cli): surface parked /resume plans as informational notices, not errors [maka]

Posted by "likun666661 (via GitHub)" <gi...@apache.org>.
likun666661 merged PR #3506:
URL: https://github.com/apache/maka/pull/3506


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(cli): surface parked /resume plans as informational notices, not errors [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #3506:
URL: https://github.com/apache/maka/pull/3506#discussion_r3836278984


##########
packages/cli/src/pi-tui-runner.ts:
##########
@@ -1947,11 +1971,28 @@ export async function runMakaPiTui(input: MakaPiTuiInput): Promise<void> {
       text: 'Resuming from the latest safe boundary…',
     });
     requestRender();
-    for await (const event of input.driver.resumeLatest()) {
-      applyMakaSessionEventToTranscript(state, event);
-      shellRunElapsedTicker.sync();
-      syncUserQuestionOverlay();
-      requestRender();
+    try {
+      for await (const event of input.driver.resumeLatest()) {
+        applyMakaSessionEventToTranscript(state, event);
+        shellRunElapsedTicker.sync();
+        syncUserQuestionOverlay();
+        requestRender();
+      }
+    } catch (error) {
+      // A parked plan is the host saying "there is nothing safe to resume",
+      // not a failure: the runtime feature may be disabled or no interrupted
+      // run exists. Show that as information, not as a red error that reads
+      // like session corruption.
+      if (error instanceof SafeBoundaryResumeParkedError) {

Review Comment:
   **[P1] Every park reason is rendered as `level: 'info'`, including the ones the description calls genuine failures.**
   
   `TURN_RESUME_PARK_REASONS` has eight members (`protocol/turn.ts:114-123`). `safeBoundaryResumeParkedCopy` gives plain-language copy to three of them and falls through to `Safe-boundary resume parked: ${reason}` for the rest. But the `catch` block does not branch on the reason at all — it matches on the *error class*, pushes `level: 'info'`, and returns. So these five also become informational notices:
   
   - `source_run_unreadable`
   - `safety_check_failed`
   - `continuation_already_exists`
   - `continuation_repair_required`
   - `continuation_started_indeterminate`
   
   The raw detail does survive, so half the promise holds. The level does not. The description says these `stay red`; after this change nothing reaches the red path, because the `return` is inside the `instanceof` branch and the rethrow below it is only for other error types.
   
   `continuation_started_indeterminate` is the one that concerns us most. It means the host does not know whether a continuation was started. Presenting that as a grey note next to `Nothing to resume` invites the user to run `/resume` again against a session that may already have a turn running — which is precisely the state this PR's own `session_busy` copy exists to explain. `safety_check_failed` has the same shape of problem: a safety gate that refused is not the same information as a feature being switched off, and right now they render identically in tone.
   
   Reproduction: make `turn.resume.query` return `{ disposition: 'parked', reason: 'safety_check_failed' }`. The driver throws `SafeBoundaryResumeParkedError`, the runner's `instanceof` branch swallows it, and the transcript gets `Note: Safe-boundary resume parked: safety_check_failed` instead of an error entry.
   
   The smallest fix is to make the classification live in one place instead of two. `safeBoundaryResumeParkedCopy` already knows which reasons are benign — it is the function with the switch. Have it return the level alongside the text (`{ level: 'info' | 'error', text }`), and let the `catch` block use whatever it returns rather than hard-coding `'info'`. Then the `default` arm carries `'error'` and there is no second list to keep in sync when a ninth reason is added.
   
   Worth pinning `safety_check_failed` or `source_run_unreadable` with a test asserting the error level, since the two new tests both cover benign reasons and would keep passing through this bug.
   
   One question we could not settle from the outside: is `session_busy` benign? Being told the session is already running a turn is a normal thing to hit, so info seems right, but it is the one of the three where a user might reasonably want it to stand out. Your call — we are not blocking on it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(cli): surface parked /resume plans as informational notices, not errors [maka]

Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks commented on PR #3506:
URL: https://github.com/apache/maka/pull/3506#issuecomment-5448937062

   Updated the PR description to record the actual compatibility transition as `56 -> 57`. The Summary and Verification now match the implementation and bilingual architecture docs; the three new wire reasons were already listed. No code or head change was needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(cli): surface parked /resume plans as informational notices, not errors [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #3506:
URL: https://github.com/apache/maka/pull/3506#issuecomment-5439477910

   This is a synthesis of the independent blind review by @Ox-Qronos at exact head `27038ddd56361882e85a21235f1e8d6aeabae75f` (base `38f0a275`, freshness rebased from `250dde69`). I verified the drift and the exact-head CI myself; the file:line finding below is from Ox's sealed review.
   
   What I checked myself:
   - Compared `250dde69 → 27038ddd` and confirmed the only PR-owned change is `49f8338e5` docs (bilingual) plus merges from `main`; the functional patch is semantically line-for-line identical, with only context-line epoch numbers shifting `51→52` to `53→54`.
   - Checked exact-head CI: `test` run 32994326664 SUCCESS, `windows_recovery` run 32994326712 SUCCESS, OPEN/MERGEABLE/BLOCKED/REVIEW_REQUIRED.
   
   Findings from Ox's freshness review:
   
   **Overall — GO — the two prior merge conditions are now closed.** The previous review required (1) PR body + bilingual docs to record `removed continuation_unavailable` and the three wire reasons plus epoch change, and (2) hosted checks green. Both are now met: `49f8338e5` updated both language docs with the three reasons (`turn.ts:122-124` + `pi-tui-runner.ts:294-318` three `info` cases + default error), body is updated, and hosted checks are green. Local re-check `58/58` runtime-host + `146/146` cli green.
   
   **P3 — Documented epoch number is stale** — `docs/architecture/runtime-resume-architecture.md` and the PR body cite epoch `52` (“51 → 52”), but the head carries `RUNTIME_HOST_COMPATIBILITY_EPOCH = 54` at `packages/runtime-host/src/protocol/index.ts:95` after rebasing over `main` (#3924/#3925). The semantic claim (closed-union epoch bump, mixed peers fail at handshake) is still correct — only the cited number needs updating to `54` to avoid confusion.
   
   What I did not re-do: a full first-pass derivation — this was a freshness rebind plus condition-closure check, relying on the still-valid prior derivation; no Docker cells are involved.
   
   Gate: one P3 docs staleness remains; no P0–P2, `test`/`windows_recovery` green, head `27038ddd` is otherwise ready to be approved and merged once a write holder approves (epoch doc update can be fixed in a follow-up or before merge).
   
   ---
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org