Feat(webui): config.json/webui parity - #4313
Conversation
9145f02 to
671d289
Compare
|
This looks like a mistake. I will close this for now; feel free to mention me if you have any questions. |
In what sense is this a mistake? If you have something else in mind for the settings, I'd be happy to look into that :) |
|
Hi @La-Volpe This PR contains 151 commits and most of them are not related to this PR, so I closed it. 💖 Happy to reopen it if it is rebased on the latest origin/main . If everything is ready, feel free to @ me see: https://github.com/HKUDS/nanobot/pull/4313/commits |
|
@La-Volpe I re-target this pr to main, reopened |
Thanks. I'll make sure it's correct branch next time 👍 |
671d289 to
2dd2466
Compare
2dd2466 to
8ae7cb3
Compare
…oad, and UI - Add write endpoints for temperature, max_tokens, reasoning_effort, tool limits, retry mode, session TTL, memory consolidation, dream config, and channels behaviour - Expand GET /api/settings payload to expose all previously hidden agent, channels, advanced, and runtime.dream fields - Add Max tokens, Temperature, Reasoning effort, and collapsible Behavior sub-section to Models settings; add Memory and Dream cards to Runtime settings - Cover all new endpoints and payload fields with 21 new tests (60 total, all passing) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused updateChannelsSettings import (step 3.4 deferred) - Pass onUpdate prop correctly to DreamSection instead of applyPayload Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Reasoning effort, temperature, and max tokens now mark the Models section dirty; switching presets syncs those fields to the preset values. Agent limits, Memory, and Dream sections compute dirty against server state instead of always reporting unsaved changes. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
8ae7cb3 to
8b5287d
Compare
|
Maintainer update: rebased this PR onto latest main and resolved the SettingsView import conflict. Verified with \python -m pytest tests/webui/test_settings_api.py -q\ (66 passed). |
maintainer edit: remove channels settings write plumbing and disabled/fallback write params that are not wired to the WebUI yet, keeping the PR focused on controls users can actually reach.
|
Maintainer update: trimmed unused settings surface from this PR. Removed the deferred Channels write endpoint/helper/tests and disabled/fallback write params that were not wired to the WebUI yet. Verified with |
feat(settings): WebUI / config.json settings parity
TL;DR: Closes most of the gap between the WebUI settings panels and
config.json. New write endpoints for temperature, tool limits, dream,channels, and memory fields, an expanded settings payload, and new UI
controls in Models, Agent limits, Memory, and Dream. 66 tests passing. A
Channels sidebar section and a raw config editor are intentionally left out,
pending discussion (see "What is NOT in this PR").
Summary
nanobot has two ways to configure the agent and they have not been in sync.:
path/to/.nanobot/config.jsonDozens of fields that already existed in the config schema (temperature, max_tool_iterations, dream consolidation, channels behaviour, fallback_models,…) had no UI control and no write endpoint. Users (such as myself) either gave up or hand-edited JSON with no validation and no feedback.
This PR tries to narrow that gap across three layers mentioned below.
What changed
Layer 1: Backend write endpoints
nanobot/webui/settings_api.pyupdate_agent_settings()now accepts nine new scalar fields:temperature,max_tokens,reasoning_effort,max_tool_iterations,max_concurrent_subagents,max_tool_result_chars,provider_retry_mode,unified_session,session_ttl_minutesupdate_agent_settings()also accepts five memory/session fields:max_messages,consolidation_ratio,context_block_limit,disabled_skills,fallback_modelscreate_model_configuration()accepts caller-supplied overrides fortemperature,max_tokens,reasoning_effort,context_window_tokensinstead of always inheriting defaults
update_model_configuration()accepts the same three generation fieldsper-preset
update_dream_settings(), a dedicated endpoint fordream.enabled,dream.interval_h,dream.model_overrideupdate_channels_settings(), a dedicated endpoint forsend_progress,send_tool_hints,show_reasoning,extract_document_text,send_max_retriesupdate_network_safety_settings()now acceptsrestrict_to_workspaceasa standalone param (previously required another field to be present);
returns
requires_restart: truewhen it changes, matching the securityboundary documented in
.agent/security.mdnanobot/webui/settings_routes.pyPOST /api/settings/dream/update,POST /api/settings/channels/updateLayer 2: Settings payload (
GET /api/settings)nanobot/webui/settings_api.pyagentkey gains 12 new fields covering behavior scalars andmemory/session configuration
channelskey exposes all five channel behaviour fieldsadvancedkey now returns the fullssrf_whitelistlist (previouslycount-only), plus
exec_timeout,exec_allow_patterns,exec_deny_patternsruntime.dreamexpanded from{ schedule }to{ enabled, interval_h, model_override, schedule }, withschedulekeptfor backward compatibility
webui/src/lib/types.tsSettingsPayload.agentextended with all 12 new fieldsSettingsPayload.runtime.dreamexpandedSettingsPayload.channelsinterfaceSettingsPayload.advancedextended with ssrf list + exec fieldsSettingsUpdate,ModelConfigurationCreate,ModelConfigurationUpdateextended with the new generation/behavior fields
Layer 3: WebUI controls
webui/src/lib/api.tsupdateSettings()wires all newSettingsUpdatefields to query paramscreateModelConfiguration()/updateModelConfiguration()wire the newgeneration fields
updateDreamSettings(),updateChannelsSettings()webui/src/components/settings/SettingsView.tsxAgentSettingsDraftextended with 15 new fields; defaults andagentDraftFromPayloadupdated accordingly(number input), Temperature (range + number input), and Reasoning effort
(segmented control)
button, with Max tool iterations, Max concurrent subagents, Max tool
result size, Retry mode, Unified session toggle, and Session timeout,
each saved via its own button
ratio, Context block limit) and new Dream section (enabled toggle,
interval, model override); Memory saves via
updateSettings, Dream savesvia
updateDreamSettingssaveBehaviorSettings,saveMemorySettingsTests
tests/webui/test_settings_api.py21 new test functions covering every new endpoint and payload field:
validation acceptance, out-of-range rejection, null/empty clearing,
payload default assertions, and
requires_restartcontracts.All 66 tests pass.
What is NOT in this PR
Three items still need maintainer discussion before implementation, per
CONTRIBUTING.md:config.jsonread and write endpoints(
GET /api/settings/config/raw,POST /api/settings/config/raw/save)SettingsSectionKey)config endpoints above
Branch target
nightly, since all changes are new features or API surface additions.Checklist
pytest: 66/66 passedruff check nanobot/: no new errors introducedruff format: not run (.agent/gotchas.mdexplicitly prohibits it)docs/configuration.md: to be updated in a follow-up once theChannels section and raw config editor land and the full settings
surface is stable