mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-04 18:21:54 +03:00
feat(agent): make model presets session-scoped (#4866)
This commit is contained in:
@@ -34,9 +34,8 @@ description: Inspect and optionally adjust the agent's runtime state. Use to che
|
||||
|
||||
| Situation | Command |
|
||||
|-----------|---------|
|
||||
| Large codebase analysis | `my(action="set", key="context_window_tokens", value=262144)` |
|
||||
| Switch to a named model preset | `my(action="set", key="model_preset", value="<preset-name>")` |
|
||||
| Repetitive simple tasks without a preset | `my(action="set", key="model", value="<fast-model>")` |
|
||||
| Check capacity for a large task | `my(action="check", key="context_window_tokens")` |
|
||||
| Switch model or context capacity | `my(action="set", key="model_preset", value="<preset-name>")` |
|
||||
| Long multi-step task | `my(action="set", key="max_iterations", value=80)` |
|
||||
|
||||
**Tradeoff:** Bias toward stability. Only set when defaults are genuinely insufficient.
|
||||
@@ -57,8 +56,8 @@ description: Inspect and optionally adjust the agent's runtime state. Use to che
|
||||
|
||||
## Constraints
|
||||
|
||||
- All modifications in-memory only — restart resets everything
|
||||
- Prefer `model_preset` for configured model choices. Direct `model` changes clear the active preset and should only be used when no preset exists.
|
||||
- `model_preset` is saved for the current session; other modifications are in-memory only
|
||||
- Direct `model` and `context_window_tokens` writes are rejected during active sessions because they would change the shared instance default. Use a configured `model_preset` instead.
|
||||
- Protected params have type/range validation: `max_iterations` (1–100), `context_window_tokens` (4096–1M), `model` (non-empty str)
|
||||
- If `tools.my.allow_set` is false, check only
|
||||
|
||||
|
||||
Reference in New Issue
Block a user