feat(mecatui): display effective token budget in the UI
@JAORMX is already working on this.
Since Sep 7, 2026.
- Dominant language
- Go
- Stars
- 152
- Forks
- 16
- Avg merge
- 14h 48m
- Merged PRs (30d)
- 536
Description
Problem
Mecatui does not show the effective per-run token budget. Once embedded-server configuration can set a deployment ceiling and a Subagent call can further tighten it, an operator or user cannot tell which limit applies, whether the budget is unlimited, or how much of it has been consumed.
Desired change
Display the effective token-budget state in mecatui for the active main run and delegated runs where that information is available. The UI must distinguish an unlimited budget from a configured ceiling and make the unit explicit.
Acceptance criteria
- The main-session UI shows either
unlimitedor the effective per-run token ceiling and current usage. - Delegation surfaces (at least Subagent; Team/Parallel where applicable) show the effective child budget or clearly state when no separate budget applies.
- If both an operator/deployment ceiling and a per-call child
max_run_tokensexist, display the effective tighten-only minimum rather than a misleading requested value. - A budget stop (
stop=budget) is visually connected to the displayed budget state. - The design accommodates the proposed weighted-cost budget work without presenting an ambiguous “token” label if enforcement changes units.
- The data comes from an authoritative server-side projection; the TUI must not independently recompute budget semantics from streamed token deltas.
- Add focused UI/client tests and update user-facing documentation.
Context
Mecatui renders relayed proto events and should remain a client rather than import engine accounting. Existing server-side budget semantics are in engine/agent/loop.go (effectiveMaxRunTokens, budgetExhausted), while the footer already receives server-resolved model/context information. The embedded server currently defaults MaxRunTokens to unlimited; see #686.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.