Repository navigation
v0.4.9
miao v0.4.9
v0.4.9 fixes one silent stop in automatic context compaction, restores the Command Code model list and plan-aware routing, makes the Chinese composer hint readable, and shows what a Session is doing while it waits or compacts.
Automatic compaction no longer stops for good
A Session could sit at 97% of its context window with automatic compaction armed and never shrink. The trigger was not the problem: compaction started at 640,450 tokens of a 655,360 window, and the summarizer answered. The commit then refused the checkpoint with unmatched tool result — every time.
An interrupted turn was writing the same answer twice. The stop path settled a planned tool with "the turn stopped before it ran", and the run's reconciliation then settled the still-planned call again with "Execution stopped before dispatch". The second answer was an orphan result, and the compaction cut validates its prefix strictly, so that prefix could never be cut.
Reconciliation now checks whether a call already has an answer before synthesising one, and the prefix validator accepts a repeat for an already settled call while still rejecting a result whose call never existed. The second half matters beyond prevention: a history already damaged by a released build compacts again after upgrading, without editing the database.
The Command Code model list is back
Command Code publishes neither capabilities nor pricing on its model list, so the catalog leaves modalities out for most entries. The route derivation read that missing field as "does not produce text". Only the one free model that happened to declare a text output survived, and a connected key appeared to have a single model.
A missing capability declaration is now unknown rather than unusable, and catalog entries marked deprecated are skipped, matching the product's existing enabled rule. The same pass points Command Code at its Provider API base /provider/v1 and sends its Claude models to /messages with the Anthropic wire; every other model stays on /chat/completions.
Plans choose the model list
Command Code gates models by subscription tier. providers.commandcode.plan takes go, goat, pro, or max; both Max 10× and Max 20× map to max. A provider holding keys on different plans can name each account's tier with account_plans:
A model whose catalog entry lists no tiers, or lists the account's tier, is selectable. An unrecognized plan (team, provider, and the like) hides nothing, and a missing plan keeps the previous behaviour. A plan-only provider entry merges with the catalog instead of replacing it, so declaring a plan no longer makes every model disappear.
The Go plan has no Provider API access, so third-party clients need GOAT or higher. That limit comes from Command Code; the picker still shows the catalog because the account may upgrade.
OpenCode was rechecked at the same time: its pay-as-you-go Console (opencode) and Go subscription (opencode-go) remain separate providers, and Go, Go Plus, and Go Teams cover the same model set. opencode-go therefore does not filter by plan; the tier changes usage limits, not selectable models.
The composer hint is readable again
The empty composer's hint was cut in half in Chinese: 随便问… painted as 便问…, because the terminal's block cursor occupies the composer's first cell and a CJK glyph is two cells wide. The hint now starts one cell right of the caret: the caret keeps a cell of its own, the whole first glyph survives, and a typed draft still starts at the first column.
Host footer facts keep their colour
When miao runs inside mtty, the host merges the status strip into its own footer row and used to paint every fact in one grey. Each fact now carries a semantic tone — accent for the model, muted for the provider and a settled approval policy, warning for a blocking approval — and mtty maps those into its palette (mttydev/mtty#277). A host that predates the field ignores it and keeps its own colour, so nothing changes until the host ships that release.
A waiting turn says what it is doing
- A job a Session is waiting on shows live progress — the job, its elapsed time and the estimate — instead of a frozen
workingline. - A compaction pass shows as a live
compacting contextsegment with its counted and total tokens, and the transcript keeps its own record when the pass commits. - A pure wait no longer injects a
Task pausednote into the transcript; the wait state is the notice. Pauses that need a decision (turn budget, spend, stall) keep their explanation. - A stopped turn records why it stopped and who stopped it, so the next read of the transcript says
interruptedinstead of looking like a truncated answer.
Compatibility
No protocol or storage changes. plan and account_plans are optional provider fields; existing configurations keep their model list. Command Code's non-Claude routes now point at /provider/v1/chat/completions, and Claude routes use /provider/v1/messages. The host-footer tone is an optional field on the existing footer wire. A session already blocked from compacting by the duplicate-result history recovers on the next settled turn after upgrading.
Maintenance and verification
cargo fmt --check, cargo clippy --all-targets -- -D warnings, the full TUI suite (780 tests), the engine store (24) and history (10) suites, the 12 native_routes tests, and the full miao-engine library suite (593 tests) pass on Rust 1.100 stable. The compaction fix carries two regression tests that fail on the previous code; the composer test asserts the painted hint sits one cell right of the reported cursor; the route tests cover catalog entries without modalities, deprecated entries, Command Code's two wires, and plan filtering per account.
{ "providers": { "commandcode": { "plan": "pro", "account_plans": { "work": "max" } } } }