feat(interactive): mark fast mode on the footer model label - #549
Merged
code-yeongyu merged 1 commit intoJul 31, 2026
Merged
Conversation
code-yeongyu
force-pushed
the
feat/issue-548-fast-mode-footer-indicator
branch
from
July 31, 2026 02:45
d5cfe22 to
516badc
Compare
Fast mode was invisible: the footer renders the model label identically at the priority tier and the normal one, so the only way to check was to run `/fast` again and flip the state you wanted to observe. `AgentSession` gains a session-scoped fast-mode flag plus `isFastModeActive()`, which ORs it with `serviceTier === "priority"` so both fast paths light up: an `openai` `-fast` catalog variant and the Codex session toggle. `pi.setSessionFastMode()` exposes the setter, and the `service-tier` builtin mirrors its toggle through it. The flag stays out of `session.serviceTier` on purpose. That getter feeds request composition — `service-tier.ts`'s non-Codex branch and `compaction/openai-remote.ts` — so a provider-scoped toggle bleeding into it would inject `service_tier: "priority"` into API-key-billed `openai-responses` traffic at a 2x multiplier. The glyph lives inside the `FooterSegment` plain text so `planFooterLayout()` counts it in the width ladder instead of overflowing narrow terminals. Fixes code-yeongyu#548
code-yeongyu
force-pushed
the
feat/issue-548-fast-mode-footer-indicator
branch
from
July 31, 2026 02:58
516badc to
d2c0865
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.
Fixes #548.
Stacked on #547 (the
/fastsession tier for subscription Codex models). GitHub cannot base a PR on a fork branch, so this one targetsmainand therefore carries #547's two commits as well — merge #547 first and this diff reduces to the last commit,feat(interactive): mark fast mode on the footer model label.What you see
The bolt appears whenever the session runs at the priority tier and disappears when it does not. Both fast paths light it: the direct
openaiprovider's-fastcatalog variants (model-configuredserviceTier: "priority") and the ChatGPT-subscription Codex session toggle.How the state gets to the footer
AgentSessiongains a session-scoped_sessionFastModeflag plusisFastModeActive(), which ORs it withserviceTier === "priority".pi.setSessionFastMode(enabled)exposes the setter to extensions, and theservice-tierbuiltin mirrors its Codex toggle through it (clearing onsession_start).The flag is deliberately NOT folded into
session.serviceTier. That getter feeds request composition —service-tier.ts's non-Codex branch (ctx.serviceTier ?? settingsServiceTier) andcompaction/openai-remote.ts(ctx.serviceTier ?? auth.serviceTier) — so a provider-scoped fast toggle bleeding into it would injectservice_tier: "priority"into API-key-billedopenai-responsestraffic, wheregetServiceTierCostMultiplier()charges 2x. Keeping the indicator display-only leavesserviceTieras the single request-side source.In the footer the glyph is part of the
FooterSegmentplain text, soplanFooterLayout()counts it in the width ladder rather than overflowing narrow terminals, andcolorRightSide()paints itwarningwhile the model keepsaccentand:thinkingkeepsdim.Tests
test/footer-fast-mode-icon.test.ts(new): the indicator renders before the model id and after the(provider)prefix, it is absent when fast mode is off, and every line stays inside width 60 with a 30-char CJK model id.test/suite/service-tier-extension.test.tsadditionally assertssession.isFastModeActive()across the toggle and thesession_startreset.Every assertion was mutation-proved — dropping the extension's mirror call, making
isFastModeActive()ignore the configured tier, removing the footer indicator, stamping it unconditionally, and moving it after the model id each fail exactly the case that names them.Manual QA
Real TUI from source, isolated agent dir with only the subscription
openai-codexcredential, providerbaseUrlpointed at a logging proxy, rendered through xterm.js in Chrome and screenshotted (not atmux capture-panedump):/fast→ footer reads(openai-codex) ⚡ gpt-5.6-sol:medium, and the turn taken while it was shown sentservice_tier: "priority"on the wire/fastagain →Fast mode disabled: gpt-5.6-sol, no bolt anywhere in the capturenpm run checkclean,packages/coding-agentsuite green, build clean.Summary by cubic
Shows fast mode in the TUI footer with a ⚡ before the model label. Adds a session fast-mode indicator and wires
/fastonopenai-codexto the priority tier without leaking to other providers.AgentSession.isFastModeActive()returns the session flag ORserviceTier === "priority";pi.setSessionFastMode(enabled)exposes a display-only toggle that doesn’t affect request composition./fastonopenai-codextoggles a session priority tier and injectsservice_tier: "priority"for Codex requests; mirrors throughpi.setSessionFastMode(), resets onsession_start, does not leak to other providers, and explicit model tiers still win.Written for commit d2c0865. Summary will update on new commits.