feat(rprompt): display reasoning effort next to model in zsh rprompt#3087
feat(rprompt): display reasoning effort next to model in zsh rprompt#3087EmojiPati wants to merge 4 commits intotailcallhq:mainfrom
Conversation
Adds the currently configured reasoning effort (e.g. HIGH, MEDIUM) to the right of the model in the ZSH right prompt. Follows the existing active/inactive (bright/dimmed) color pattern, renders a nerd-font lightbulb glyph when nerd fonts are enabled, and picks up session overrides set via the FORGE_REASONING__EFFORT env var.
8b7b851 to
5c3a65e
Compare
|
|
||
| // Add reasoning effort (rendered to the right of the model) | ||
| if let Some(ref effort) = self.reasoning_effort { | ||
| let effort_label = effort.to_string().to_uppercase(); |
There was a problem hiding this comment.
Lets select just the first 3 letters:
low
med
hig
xhi
max
Hide it if its none
There was a problem hiding this comment.
Thanks for the review.
Hiding none makes sense — I'll include that in the next push.
The one thing I'd like to run by you is the abbreviation. On wider terminals the short forms feel a bit cryptic, while the full labels still fit comfortably. Would you be open to making this width-aware — using the short form when the terminal is narrow, and the full label when there's room? That way we keep things tidy on smaller screens without giving up readability on full-screen setups.
Happy to go either way, just wanted to raise it before implementing.
There was a problem hiding this comment.
Pushed the width-aware version. Narrow terminals show the three-letter form (MED, HIG, etc.), and it expands to the full label (MEDIUM, HIGH) on wider setups. none stays hidden.
There was a problem hiding this comment.
Hey @amitksingh1490 , thanks for testing!
On the full label showing instead of the 3-letter form — that's actually the intended behavior we agreed on with @tusharmath above (#3087 (comment)). The label is width-aware: it collapses to the three-letter form (MED, HIG, XHI, MIN, MAX) only when the terminal is narrower than 100 columns, and expands to the full uppercase label (MEDIUM, HIGH, XHIGH, MINIMAL) at 100 columns or wider, so we don't sacrifice readability on full-screen setups.
From your screenshot it looks like your terminal is ≥100 columns, which is why you're seeing the full form. You can verify the switch quickly with:
COLUMNS=80 forge zsh rprompt # -> MED / HIG / XHI
COLUMNS=120 forge zsh rprompt # -> MEDIUM / HIGH / XHIGH
COLUMNS=100 forge zsh rprompt # -> full (threshold is inclusive)
Or just resize your terminal below 100 columns and the RPROMPT will update on the next refresh. The threshold lives in crates/forge_main/src/zsh/rprompt.rs as WIDE_TERMINAL_THRESHOLD = 100. Happy to tune it if you feel 100 is too generous — just let me know what width you'd prefer.
On the icon — I intentionally kept a glyph there for visual symmetry with the model segment right before it. The model already renders with a nerd-font icon (\u{ec19}) as a prefix, so the reasoning effort follows the same pattern with a matching lightbulb glyph (\u{eb41}) — together they read as two icon-prefixed labels belonging to the same group. Dropping the icon would make the reasoning segment visually inconsistent with the model/agent/token segments, all of which are glyph-prefixed.
If you still prefer it gone after that rationale, I'm happy to drop it — just wanted to surface the symmetry reasoning first in case we want to keep it.
There was a problem hiding this comment.
Ok can we drop the icon, as we show model name and reasoning effort is property of model doesn't need its own icon? I checked on smaller width its working properly
Per review feedback, the \`Effort::None\` variant carries no useful information for the user (it means 'no reasoning' — same effective state as having reasoning unset), so the rprompt now suppresses it entirely instead of rendering the literal text 'NONE'. The corresponding test was updated to assert the new hidden behavior.
Render the reasoning effort as a three-letter abbreviation (MIN, LOW, MED, HIG, XHI, MAX) when the terminal is narrower than 100 columns, and as the full uppercase label (MINIMAL, LOW, MEDIUM, HIGH, XHIGH, MAX) when wider. This keeps the prompt compact on small screens while preserving readability on full-screen setups. Width is sourced from the $COLUMNS env var propagated by the zsh shell plugin. Callers that do not supply a width default to the full-length label.

Summary
Show the currently configured reasoning effort (e.g.
HIGH,MEDIUM) next to the model in the ZSH right prompt so users can see at a glance what effort level their agent is running with.Context
The ZSH right prompt already surfaces the active agent, token count, cost, and model — but not the reasoning effort. Because effort level noticeably changes latency, cost, and output quality, users often forget what level they had configured during a session. The shell plugin already sets
FORGE_REASONING__EFFORTas part of everyforgeinvocation (shell-plugin/forge.theme.zsh:20), and the config layer (crates/forge_services/src/app_config.rs:51-66) resolves it intoOption<Effort>, so exposing it in the prompt is the missing piece.Changes
ZshRPrompt: added anOption<Effort>field rendered to the right of the model when set.Displayimpl: renders the effort in uppercase (e.g.HIGH,XHIGH,NONE) preceded by a nerd-font lightbulb glyph (\u{eb41}) when nerd fonts are enabled. UsesYELLOWwhen the conversation is active (tokens > 0) andDIMMEDotherwise, matching the existing pattern for the other segments.ZshColor::YELLOW: new 256-palette color constant (3).handle_zsh_rprompt_command: extended thetokio::join!to fetch reasoning effort in parallel with the existing model/conversation lookups and pipe it into the builder.Key Implementation Details
ForgeAPI::get_reasoning_effort, which already honorsFORGE_REASONING__EFFORTthroughForgeConfig's env-var source (crates/forge_config/src/reader.rs:103-108). This means the per-session override set by the shell plugin (shell-plugin/forge.theme.zsh:20) is picked up automatically.Effort::Noneis deliberately rendered asNONEso the user can tell that reasoning is explicitly disabled (vs. unset, which shows nothing).use_nerd_font: when nerd fonts are disabled the glyph is omitted and only the uppercase label is rendered.Use Cases
FORGE claude-opus-4-7 HIGH.MEDIUMafter a provider switch.FORGE_REASONING__EFFORTis actually propagating from the shell plugin.Rendered Examples
FORGE 1.5k gpt-4 HIGHFORGE 1.5k gpt-4 LOWTesting
New tests cover: active state rendering, init/dimmed state,
XHigh→XHIGHuppercase, explicitEffort::Nonevariant, nerd-font-off path, and a regression guard ensuring thatNone(unset) produces no output.Links
crates/forge_main/src/zsh/rprompt.rsshell-plugin/forge.theme.zsh:20