Skip to content

Implement actionable mecatui exit handoff - #2047

Merged
jbeda merged 6 commits into
mainfrom
impl/mecatui-exit-handoff
Oct 1, 2026
Merged

jbeda merged 6 commits into
mainfrom
impl/mecatui-exit-handoff

Conversation

@jbeda

@jbeda jbeda commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Implementation

Closes #1992. Implements the embedded-session exit handoff approved in Plan / Interface PR #2039, approved squash-merge baseline dc28cce781edd95969770b2b6cd22998b0cb0aef.

After a clean embedded exit, mecatui retains the byte-exact JSON final-session-ID record and prints a safe, copyable exact resume command with a qualified --resume-latest alternative. When available, the final session snapshot supplies the display title, model-call count, and lifetime main input/output/cache counts. Lookup happens before client close with a one-second bound; output follows terminal teardown and cleanup. Connected-mode human guidance is optional under the plan and is not included; the existing connected ID record remains unchanged. An operator-requested follow-up adds a blank line before the exit handoff and removes the redundant startup notice containing the embedded server's private socket address.

Acceptance and verification

  • AC1.1–AC1.3: post-teardown exact handoff, authoritative snapshot totals, POSIX-safe quoting and terminal-safe display. Offline subprocess tests include real embedded runWithOptions/client/server composition, final-vs-startup ID, and malicious-ID/title cases.
  • AC2.1–AC2.2: bounded snapshot-failure fallback, interrupted/failed/no-session behavior, and connect-restart suppression.
  • AC2.3: updated the owning user-docs/mecatui/sessions.md guide and built the site.
  • Before the follow-up UX refinement, task docs, task test, task lint, task test:race, task site:build, task ac-trace-strict, task api:check, and offline go run ./cmd/mecademo passed. For commit 231278731, focused exit/diagnostics tests, task docs, task site:build, and task build passed. The full test and race suites were not rerun, as requested for fast iteration.
  • Panel review of the approved-plan implementation before the follow-up UX refinement: PANEL: ship_blockers=0 important=0 advisory=0 reviewer_failures=0.

Interfaces match approved contract: Yes for the required handoff. No amendment was needed for that implementation. The blank line and removal of the embedded socket startup notice are additional routine presentation changes requested after the plan merged; the optional connected human command remains deferred.

jbeda and others added 6 commits October 1, 2026 02:07
Co-authored-by: Mecatl <noreply@mecatl.dev>
Co-authored-by: Mecatl <noreply@mecatl.dev>
Replace duplicate title sanitization with the shared terminal-safe helper and repair the connected-resume guide code span.

Co-authored-by: Mecatl <noreply@mecatl.dev>
Co-authored-by: Mecatl <noreply@mecatl.dev>
Co-authored-by: Mecatl <noreply@mecatl.dev>
@jbeda
jbeda merged commit 805e406 into main Oct 1, 2026
37 checks passed
@jbeda
jbeda deleted the impl/mecatui-exit-handoff branch October 1, 2026 12:14

This branch was successfully deployed

1 active deployment
Preview — 23127873 Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mecatui: make exit output actionable (resume command, usage) instead of raw session ID

1 participant