feat(advisor): surface advisor model + mode in REPL/TUI status bars - #189
Merged
Conversation
When /advisor is set, both the legacy REPL bottom toolbar and the TUI StatusLine widget now show a compact `advisor: <model> (<mode>)` segment next to provider/model. Users can see at a glance which reviewer is configured and whether it'll fire server-side, client- side, or sit inactive. ## Display format `advisor: opus-4-7 (client)` — claude- prefix stripped for brevity since the user already knows what brand they configured; mode label comes from `decide_advisor_mode(provider, main_model, advisor_model, force_client_mode)` so it reflects what the NEXT request will actually do (a stale config under an unsupported provider shows "(inactive)" rather than silently lying). Other provider prefixes (`gemini-`, `zai/`, etc.) keep their full name because the brand IS the disambiguator there. ## What changed * **New shared helper** `src.utils.advisor.format_advisor_status` — returns `"advisor: <model> (<mode>)"` or `None` if not configured. Robust to settings/provider exceptions (returns None on any failure; the status row must never break the input prompt). * **Legacy REPL** `src/repl/core.py:_bottom_toolbar` — appends the segment between cwd and turn count when it's non-None. * **TUI** `src/tui/widgets/status_line.py:_compose_text` — appends to the left side next to provider/model. * **TUI plumbing** — `REPLScreen` + `StatusLine` gain an optional `provider_instance` parameter so the mode predicate can call `is_advisor_enabled(provider)` and distinguish server-side (1P Anthropic) from client-side. `app.py` passes `self.provider` (the live BaseProvider) at construction. ## Tests * New: `test_format_advisor_status_compact_label` — verifies the claude- prefix stripping + mode label shape. * New: `test_format_advisor_status_returns_none_when_unset` — null case when no advisor_model is configured. * New: `test_format_advisor_status_returns_none_when_env_disabled` — env kill switch surfaces as "(inactive)" label. * Full advisor + TUI suites (117 + 525 tests) pass. ## Verified Live smoke test with the user's actual config (haiku-4-5 main + opus-4-7 advisor via litellm.singula.ai): `Bottom toolbar segment: 'advisor: opus-4-7 (client)'` Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
singlaamitesh
pushed a commit
to singlaamitesh/clawcodex
that referenced
this pull request
Jul 7, 2026
…s-line-segment feat(advisor): surface advisor model + mode in REPL/TUI status bars
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.
Summary
When
/advisoris configured, both the legacy REPL bottom toolbar and the TUI StatusLine widget now show a compactadvisor: <model> (<mode>)segment next to provider/model. At a glance, users see which reviewer is configured and whether it'll fire server-side, client-side, or sit inactive.Display format
```
openai · claude-haiku-4-5 · ~/workspace/clawcodex · advisor: opus-4-7 (client) · turns: 1 · tokens: 1234 in / 567 out
```
claude-family prefix stripped for brevity — the user already knows what brand they configured.decide_advisor_mode(provider, main_model, advisor_model, force_client_mode)so it reflects what the NEXT request will actually do. A stale config under an unsupported provider shows(inactive)rather than silently lying.gemini-,zai/, etc.) keep their full name because the brand IS the disambiguator there.Files
src/utils/advisor.pyformat_advisor_status(provider, main_model)helper. Returns the segment string orNoneif not configured. Robust to all internal failures (status row must never break the input prompt).src/repl/core.py_bottom_toolbarcalls the helper and inserts the segment between cwd and turn count when non-None.src/tui/widgets/status_line.py_compose_textappends the segment next to provider/model on the left. New optionalprovider_instanceconstructor parameter.src/tui/screens/repl.pyREPLScreengains optionalprovider_instanceparameter that it forwards toStatusLine.src/tui/app.pyself.provider(liveBaseProvider) toREPLScreenso the mode predicate can callis_advisor_enabled(provider)and distinguish server-side from client-side.Tests
test_format_advisor_status_compact_label— verifies the claude- prefix stripping + mode label shapetest_format_advisor_status_returns_none_when_unset— null casetest_format_advisor_status_returns_none_when_env_disabled— env kill switch surfaces as(inactive)labelLive verified
With the user's actual production config (haiku-4-5 main + opus-4-7 advisor via litellm.singula.ai):
```
Bottom toolbar segment: 'advisor: opus-4-7 (client)'
```
🤖 Generated with Claude Code