mecatui: aligned, humanized exit summary with aux usage - #2083
Merged
Merged
Conversation
The embedded exit summary now prints a humanized Tokens (main) line and, when nonzero, a Tokens (aux) line summing every non-main usage bucket. Co-authored-by: Mecatl <noreply@mecatl.dev>
Print the session ID and every summary field under aligned labels, with the resume-latest alternative indented beneath the exact resume command. Co-authored-by: Mecatl <noreply@mecatl.dev>
Embedded exits with a displayable ID now print only the aligned summary. Connected mode and unsafe IDs keep the JSON-quoted final-session-id record. Co-authored-by: Mecatl <noreply@mecatl.dev>
Move ui/internal/renderfmt to cmd/mecatui/internal/renderfmt so package main can import the shared token humanizer, and drop the ui wrapper. Co-authored-by: Mecatl <noreply@mecatl.dev>
jbeda
force-pushed
the
mecatui-exit-aux-usage
branch
from
October 5, 2026 02:13
bbf35a4 to
3164639
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mecatuiexits now print an aligned, humanized session summary, including auxiliary model usage (title generation, compaction, reflection, routing, reviewers, guardrails, judges) now that fix: return and fence auxiliary usage results #1904 records it.29.7K,1.2M); cache read/write stay separately labelled components.Session ID:line replaces the JSONmecatui: final-session-id=record for embedded exits with a displayable ID.Development stage
Contract linkage
token_usage), no protocol, server, persistence, or engine API change.docs/acceptance/mecatui-exit-handoff.mdat the directing human's request; the frozen plan is left unedited.Interface conformance
Issue relationship
Relates to #1904
Type of change
Test plan
Baseline checks
task lint)task test) — covered bytask test:racetask test:race) — after rebase onto Implement canonical mecatui status surfaces #2075, only the pre-existing flakyTestMCPAuthorizationGRPCRejectsRepeatedInitialControlfails (10/50 race runs on unmodifiedorigin/maintoo)go run ./cmd/mecademo)task docs)task site:build)task api:check)task api:update+engine/CHANGELOG.mdtask ac-trace-strict)/panel-reviewManually verified by building and exiting a real embedded session.
Changes
cmd/mecatui/client/session.goSessionSnapshot.AuxiliaryUsage: sum of every non-maintoken_usagebucketcmd/mecatui/exit_handoff.goSession ID:instead of the JSON recordcmd/mecatui/{ui/ => }internal/renderfmtmaincan import the shared token humanizer;uiimport paths updatedcmd/mecatui/*_test.go,client/session_test.gouser-docs/mecatui/sessions.mdUser-facing change
On a normal embedded exit,
mecatuiprints an aligned summary with session ID, title, model calls, humanized main and auxiliary token usage, and resume commands. The aux line appears only when auxiliary usage is nonzero.Special notes for reviewers
mecatui: final-session-id="…". The original exit-handoff plan kept it byte-for-byte "for scripts"; nothing in this repo consumes it besides mecatui's own tests, but an external script scraping embedded exit output would break. Connected mode and IDs unsafe to display on one line still emit the JSON record.ui/footer.go;renderfmtmoves fromcmd/mecatui/ui/internal/tocmd/mecatui/internal/somaincan share it (pure move plus import-path updates).1,234,567→1.2M); exact values remain available from the session snapshot.