219 files, 2.0 MB, untracked in souveraine/docs and existing nowhere else. The volume is at 100% with no snapshots.
3.2 KiB
| task_id | title | status | assignee | priority | phase |
|---|---|---|---|---|---|
| settings-llm-config-001 | Per-agent LLM config in Settings TUI | scoped | medium | 2 |
Task: Per-agent LLM Config in Settings TUI
Origin
The setup wizard (src/ui/setup.rs:486) hardcodes max_tool_rounds: 10, context_window: 128000, inter_round_delay_ms: 500 for new agents. The settings TUI's Agent category currently only exposes model name (AgModel). Neither the agent-level nor the per-model config fields (max_tool_rounds, context_window, inter_round_delay_ms, temperature, supports_images) are editable in the settings UI.
This becomes more pressing as multi-provider support (OpenAI BYOK, etc.) lands — a user might have 3-10 providers/models and needs per-agent LLM tuning.
What needs to change
1. Extend ActiveAgentSettings — src/ui/settings/view.rs
Currently holds only id, name, model, model_original. Add:
context_window: u32max_tool_rounds: u32inter_round_delay_ms: u64temperature: Option<f32>supports_images: bool
All with their originals for dirty detection.
2. Add FieldLoc variants — src/ui/settings/types.rs
Add to the enum:
AgContextWindowAgMaxToolRoundsAgInterRoundDelayMsAgTemperatureAgSupportsImages
Map them to Category::Agent in the category() method.
3. Add fields to fields_for_category() — src/ui/settings/view.rs
In the Category::Agent match arm, after AgModel:
AgMaxToolRounds—EditableValue::UintAgContextWindow—EditableValue::UintAgInterRoundDelayMs—EditableValue::UintAgTemperature—EditableValue::OptionalText(f32, or None)AgSupportsImages—EditableValue::Bool
4. Add apply_field() handlers — src/ui/settings/view.rs
For each new FieldLoc: read the value and write to self.active_agent fields.
5. Add numeric/float key constraints — src/ui/settings/key_handling.rs
Add the new numeric fields to the is_numeric and is_float match lists in handle_edit_key(), and to commit_edit().
6. Wire save-back through App — src/ui/app/mod.rs
The current SaveAndGoBack handler calls backend.update_agent_model() which only sends model. Extend it (or add backend.update_agent_llm_config()) to push the full LlmConfig struct.
The Backend trait's update_agent_model() at src/backend/mod.rs:208 takes (agent_id, model) — rename/expand to update_agent_llm_config(agent_id, LlmConfig).
7. Replace hardcoded setup.rs defaults
src/ui/setup.rs:486 — replace hardcoded values with LlmConfig::default() or constants from the config module.
Files affected
src/ui/settings/types.rs— FieldLoc enum + category mappingsrc/ui/settings/view.rs— ActiveAgentSettings struct, fields_for_category, apply_fieldsrc/ui/settings/key_handling.rs— numeric/float key constraints, commit_editsrc/ui/app/mod.rs— SaveAndGoBack handler wiringsrc/backend/mod.rs— Backend trait update methodsrc/backend/local/mod.rs— LocalBackend::update_agent_model expansionsrc/ui/setup.rs— hardcoded defaults
Related
docs/tasks/multimodal-and-input-metadata.md— thesupports_imagesflag this task would expose