Skip to content

feat(interactive): mark fast mode on the footer model label - #549

Merged
code-yeongyu merged 1 commit into
code-yeongyu:mainfrom
eddieparc:feat/issue-548-fast-mode-footer-indicator
Jul 31, 2026
Merged

feat(interactive): mark fast mode on the footer model label#549
code-yeongyu merged 1 commit into
code-yeongyu:mainfrom
eddieparc:feat/issue-548-fast-mode-footer-indicator

Conversation

@eddieparc

@eddieparc eddieparc commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #548.

Stacked on #547 (the /fast session tier for subscription Codex models). GitHub cannot base a PR on a fork branch, so this one targets main and 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

~/project • main • 14K/272K (5.2%) (auto)          (openai-codex) ⚡ gpt-5.6-sol:medium

The bolt appears whenever the session runs at the priority tier and disappears when it does not. Both fast paths light it: the direct openai provider's -fast catalog variants (model-configured serviceTier: "priority") and the ChatGPT-subscription Codex session toggle.

How the state gets to the footer

AgentSession gains a session-scoped _sessionFastMode flag plus isFastModeActive(), which ORs it with serviceTier === "priority". pi.setSessionFastMode(enabled) exposes the setter to extensions, and the service-tier builtin mirrors its Codex toggle through it (clearing on session_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) and compaction/openai-remote.ts (ctx.serviceTier ?? auth.serviceTier) — so a provider-scoped fast toggle bleeding into it would inject service_tier: "priority" into API-key-billed openai-responses traffic, where getServiceTierCostMultiplier() charges 2x. Keeping the indicator display-only leaves serviceTier as the single request-side source.

In the footer the glyph is part of the FooterSegment plain text, so planFooterLayout() counts it in the width ladder rather than overflowing narrow terminals, and colorRightSide() paints it warning while the model keeps accent and :thinking keeps dim.

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.ts additionally asserts session.isFastModeActive() across the toggle and the session_start reset.

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-codex credential, provider baseUrl pointed at a logging proxy, rendered through xterm.js in Chrome and screenshotted (not a tmux capture-pane dump):

  • /fast → footer reads (openai-codex) ⚡ gpt-5.6-sol:medium, and the turn taken while it was shown sent service_tier: "priority" on the wire
  • /fast again → Fast mode disabled: gpt-5.6-sol, no bolt anywhere in the capture

npm run check clean, packages/coding-agent suite 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 /fast on openai-codex to the priority tier without leaking to other providers.

  • New Features
    • Footer: Prefixes the model label with ⚡ when fast mode is active; counted in layout, colored as a warning, and shown after the provider prefix.
    • Core: AgentSession.isFastModeActive() returns the session flag OR serviceTier === "priority"; pi.setSessionFastMode(enabled) exposes a display-only toggle that doesn’t affect request composition.
    • Service tier: /fast on openai-codex toggles a session priority tier and injects service_tier: "priority" for Codex requests; mirrors through pi.setSessionFastMode(), resets on session_start, does not leak to other providers, and explicit model tiers still win.

Written for commit d2c0865. Summary will update on new commits.

Review in cubic

@code-yeongyu
code-yeongyu force-pushed the feat/issue-548-fast-mode-footer-indicator branch from d5cfe22 to 516badc Compare July 31, 2026 02:45
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
code-yeongyu force-pushed the feat/issue-548-fast-mode-footer-indicator branch from 516badc to d2c0865 Compare July 31, 2026 02:58
@code-yeongyu
code-yeongyu merged commit 76cfac1 into code-yeongyu:main Jul 31, 2026
9 checks passed
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.

Fast mode is invisible in the footer: no indicator on the model label

2 participants