feat(nano): nano badge in the web client - #902
Merged
Merged
Conversation
The browser client now shows the backend's nano mode (clawcodex web --nano, docs/nano.md) on three surfaces, all driven by the gateway wire fields the previous commit added: * the composer row: a green 'nano' fact chip after the effort picker — the TUI status line's `model effort nano` order. A span, not a control: nano is a launch flag, there is nothing to toggle. * the run-stats line: the chip rides the model segment (RunStatsBar), so whatever narrows the bar can never shed the mode without also shedding the model it describes — the TUI stats-line contract. * the session details panel: a 'Harness: nano' fact row, rendered only when the session IS nano (default mode is not a fact worth a row). Sourcing mirrors the composer's model/approval fallbacks: the session's own session.info.nano once one exists, else $backendNano — a new boot fact read from /api/status, which is what lets the welcome screen say what the first prompt will run on before it is sent. Strict === true everywhere, so older backends without the field never grow a badge. Tests: 8 TS vitest in NanoBadge.test.tsx (composer chip render/absence/ not-a-button, stats-bar ride-along + absence + no-model case, details row presence/absence) + a transcript merge pin (nano survives a session.info republish that omits it — matching the backend, where _install_provider keeps the nano registry). ui-web npm run check: 418 tests green, typecheck clean; vite build clean. Verified live against `clawcodex web --nano` (deepseek): hero chip from /api/status before any session; a real fix-the-bug turn on the six-tool surface (Read → Edit → Bash verify); mid-session model switch keeps chip, details row, and registry (second turn green); default-mode control run shows no chip anywhere and nano:false on every wire field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Client half of the web-UI ↔ nano integration (backend: #901). The browser client now shows the backend's nano mode (
clawcodex web --nano, docs/nano.md) on three surfaces, all driven by the gateway wire fields #901 added:nanofact chip after the effort picker, the TUI status line'smodel effort nanoorder. A span, not a control: nano is a launch flag, there is nothing to toggle.RunStatsBar), so whatever narrows the bar can never shed the mode without also shedding the model it describes (the TUI stats-line contract).Harness: nanofact row, rendered only when the session IS nano.Sourcing mirrors the composer's model/approval fallbacks: the session's own
session.info.nanoonce one exists, else$backendNano— a new boot fact read from/api/status, which is what lets the welcome screen say what the first prompt will run on before it is sent. Strict=== trueeverywhere, so older backends without the field never grow a badge.Tests: 8 vitest in
NanoBadge.test.tsx(composer chip render/absence/not-a-button, stats-bar ride-along + absence + no-model case, details row presence/absence) + a transcript merge pin (nano survives asession.inforepublish that omits it — matching the backend, where_install_providerkeeps the nano registry).npm run check: 418 tests green, typecheck clean; vite build clean.Verified live against
clawcodex web --nano(deepseek): hero chip from/api/statusbefore any session; a real fix-the-bug turn on the six-tool surface (Read → Edit → Bash verify, fix landed on disk); mid-session model switch keeps chip, details row, and registry (second turn green); WS wire probes (session.createwith explicit provider/model,config.get,session.active_list) allnano: true; default-mode control run shows no chip anywhere andnano: falseon every wire field; dark-theme chip legible.🤖 Generated with Claude Code