Skip to content

feat(advisor): surface advisor model + mode in REPL/TUI status bars - #189

Merged
agentforce314 merged 1 commit into
mainfrom
advisor/status-line-segment
May 21, 2026
Merged

feat(advisor): surface advisor model + mode in REPL/TUI status bars#189
agentforce314 merged 1 commit into
mainfrom
advisor/status-line-segment

Conversation

@agentforce314

Copy link
Copy Markdown
Owner

Summary

When /advisor is configured, both the legacy REPL bottom toolbar and the TUI StatusLine widget now show a compact advisor: <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.
  • 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.

Files

File Change
src/utils/advisor.py New format_advisor_status(provider, main_model) helper. Returns the segment string or None if not configured. Robust to all internal failures (status row must never break the input prompt).
src/repl/core.py _bottom_toolbar calls the helper and inserts the segment between cwd and turn count when non-None.
src/tui/widgets/status_line.py _compose_text appends the segment next to provider/model on the left. New optional provider_instance constructor parameter.
src/tui/screens/repl.py REPLScreen gains optional provider_instance parameter that it forwards to StatusLine.
src/tui/app.py Passes self.provider (live BaseProvider) to REPLScreen so the mode predicate can call is_advisor_enabled(provider) and distinguish server-side from client-side.

Tests

  • test_format_advisor_status_compact_label — verifies the claude- prefix stripping + mode label shape
  • test_format_advisor_status_returns_none_when_unset — null case
  • test_format_advisor_status_returns_none_when_env_disabled — env kill switch surfaces as (inactive) label
  • Full advisor + TUI suites pass (117 + 525)

Live 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

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>
@agentforce314
agentforce314 merged commit c9ec158 into main May 21, 2026
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
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.

1 participant