feat(nano): serve/web gateway carries nano — --nano flag + wire surfaces - #901
Merged
Conversation
clawcodex serve and clawcodex web gain --nano, wiring the pi-shaped minimal profile (docs/nano.md) into the browser/desktop gateway the same way the TUI launcher wires it into its agent-server child: * serve_cli parses --nano into AgentServerConfig, so every session the gateway spawns builds the nano registry + prompt in _build_runtime — including sessions created with the composer's own provider/model (spawn_for's dataclasses.replace keeps the field). It also sets the process-global BEFORE the server starts: sessions spawn lazily, and /api/status has to tell the truth with no session in existence. * web_cli forwards --nano in _serve_argv (web stays a thin wrapper). * /api/status reports "nano" — the one pre-session surface the web client's welcome screen can read. * session.info stamps "nano" on both publish paths — _init_session_info (strict `is True`, always stamped, so an older agent's frame reads as not-nano rather than unknown) and publish_session_info (from get_settings, so a client doing full replaces keeps the chip across model switches and turn ends). * the agent's get_settings reply gains "nano": is_nano_mode() — the same live process-global the init frame reports. Tests: 10 new in tests/nano/test_nano_web.py — web argv forwarding, serve argparse → config + process-global (both directions), spawn_for override retention, /api/status true/false, strict session.info mapping (init + model-switch republish, via a nano-reporting FakeAgent and the stock one), and get_settings on the real _AgentSession harness. Existing web-cli argv tests extended with the new flag. tests/nano + tests/server + tests/entrypoints: 792 passed. 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.
Backend half of the web-UI ↔ nano integration.
clawcodex serveandclawcodex webgain--nano, wiring the pi-shaped minimal profile (docs/nano.md) into the browser/desktop gateway the same way the TUI launcher wires it into its agent-server child.--nanointoAgentServerConfig, so every session the gateway spawns builds the nano registry + prompt in_build_runtime— including sessions created with the composer's own provider/model (spawn_for'sdataclasses.replacekeeps the field). It also sets the process-global before the server starts: sessions spawn lazily, and/api/statushas to tell the truth with no session in existence.--nanoin_serve_argv(web stays a thin wrapper over serve)./api/statusreportsnano— the one pre-session surface the web client's welcome screen can read.session.infostampsnanoon both publish paths:_init_session_info(strictis True, always stamped, so an older agent's frame reads as not-nano rather than unknown) andpublish_session_info(fromget_settings, so a client doing full replaces keeps the chip across model switches and turn ends).get_settingsreply gains"nano": is_nano_mode()— the same live process-global the init frame reports.Tests: 10 new in
tests/nano/test_nano_web.py— web argv forwarding, serve argparse → config + process-global (both directions), spawn_for override retention,/api/statustrue/false, strictsession.infomapping (init + model-switch republish, via a nano-reporting FakeAgent and the stock one), andget_settingson the real_AgentSessionharness. Existing web-cli argv tests extended with the new flag.Full local suite: 10,333 passed; the only failure is the known dirty-tree
test_pip_install_editabletimeout (environment-dependent, passes in a clean worktree).Client half (the badge) follows in the next PR.
🤖 Generated with Claude Code