feat(webui): add session-scoped reasoning effort (#6441)

* feat(webui): add session-scoped model options

Extend the composer preset menu with inherited reasoning effort and Codex Fast mode overrides. Persist choices with ordinary inputs, isolate captured runtimes, and restore browser preferences without changing shared presets.

Add regression coverage for pending preset ordering, settings initialization, session and host isolation, queue edits, Codex request mapping, and narrow-screen controls.

* feat(webui): refine session model options and add Codex Ultrafast

Fit the composer options into a compact single row and preview reasoning effort only during a drag. Add Fast/Ultrafast controls for eligible Codex models, preserve explicit session choices across reloads, and document the speed tiers.

* fix(webui): add Codex speed control to the component gallery

* fix(webui): preserve saved model options after preset rename

Use the session options for display when a browser preference no longer matches the preset. Omit model options from the next message unless the browser has a matching choice, so stale preferences cannot overwrite options the gateway already saved.
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-18 15:46:16 +08:00
1 parent 2b232c9133
commit 0f45d74fec
82 files changed
+2289 -113

No files matched your search

+4 -2
View File
@@ -758,7 +758,9 @@ nanobot agent -m "Hello!"
The WebUI model selector loads the models available to the signed-in account from Codex's online catalog. Context-window and reasoning-effort metadata come from that response; if discovery is unavailable, nanobot keeps a small built-in fallback instead of emptying the selector.
Codex Fast mode can be enabled from the WebUI provider settings, or with:
In **Settings → Models**, open a Codex preset and select the single lightning button for Fast or the double lightning button for Ultrafast where supported. Select the active button again to turn the speed boost off. The control shows the provider's current speed if the preset does not specify one. The config field is `modelPresets.<name>.codexFastMode` (`true`, `false`, or `"ultrafast"`); omit the field to use the provider default below. A topic's explicit speed choice overrides its preset.
Set the connection-wide default in the WebUI provider settings or in `extraBody`:
```json
{
@@ -772,7 +774,7 @@ Codex Fast mode can be enabled from the WebUI provider settings, or with:
}
```
The switch sends the Responses API `service_tier: "priority"` value. It only works for models and accounts that support Fast mode; turn the switch off to return to standard processing. Fast mode consumes Codex credits at a higher rate. See the [OpenAI Codex rate card](https://help.openai.com/en/articles/20001106) for current details.
Fast sends `service_tier: "priority"`; Ultrafast sends `service_tier: "ultrafast"`; explicitly turning the speed boost off removes the tier from the request. Fast and Ultrafast consume Codex credits at higher rates, and Ultrafast also requires a supported model and an eligible account or workspace. See the [Codex speed options](https://learn.chatgpt.com/docs/agent-configuration/speed.md) for current availability.
For proxy, remote/headless login, model-name, or config-key errors, see [`troubleshooting.md`](./troubleshooting.md#provider-and-model-problems).
+6
View File
@@ -105,6 +105,12 @@ Open a topic's sidebar action menu and choose **Create group** to turn it into a
To use work from another topic, mention it with `@` and tell nanobot what you need. See [Composer](#composer) for how to add a topic reference.
### Model options for a topic
Open the model preset menu beside the composer to choose **Reasoning effort** for the next message in this topic. Drag the slider to choose a known effort level. Codex presets also offer **Fast**, with an **Ultrafast** choice for supported models. The menu selects the current value, such as `medium`, when it opens. Selecting a value applies it to this topic without editing the preset; switching presets clears topic selections. The single lightning button requests Fast; the double lightning button requests Ultrafast. Select the active button again to turn speed boosts off. Faster processing increases Codex usage and depends on model and account availability.
Choices do not edit shared presets or provider settings and do not change an already-running task. Unsent choices are remembered in this browser; the last values sent with an ordinary message are saved with the topic and survive a gateway restart. Switching presets clears both overrides. Temporary chats do not show these controls.
### Activity and context usage
While nanobot works, **Working for** shows the latest activity beside the timer, or below it on narrow screens. Select the timer to see the full reasoning and tool activity. Set **Settings → Appearance → Activity details** to **Expanded** if you prefer to see the details by default.