Watch
1
0
Fork
You've already forked SouveraineOS
0
SouveraineOS/docs/substrate/tasks/settings-llm-config.md
Fimeg e480809c70 docs: rescue the agent-substrate tree out of a gitignored directory
219 files, 2.0 MB, untracked in souveraine/docs and existing nowhere else.
The volume is at 100% with no snapshots.
2026-07-26 12:11:50 -04:00

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 ActiveAgentSettingssrc/ui/settings/view.rs

Currently holds only id, name, model, model_original. Add:

  • context_window: u32
  • max_tool_rounds: u32
  • inter_round_delay_ms: u64
  • temperature: 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:

  • AgContextWindow
  • AgMaxToolRounds
  • AgInterRoundDelayMs
  • AgTemperature
  • AgSupportsImages

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:

  • AgMaxToolRoundsEditableValue::Uint
  • AgContextWindowEditableValue::Uint
  • AgInterRoundDelayMsEditableValue::Uint
  • AgTemperatureEditableValue::OptionalText (f32, or None)
  • AgSupportsImagesEditableValue::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 mapping
  • src/ui/settings/view.rs — ActiveAgentSettings struct, fields_for_category, apply_field
  • src/ui/settings/key_handling.rs — numeric/float key constraints, commit_edit
  • src/ui/app/mod.rs — SaveAndGoBack handler wiring
  • src/backend/mod.rs — Backend trait update method
  • src/backend/local/mod.rs — LocalBackend::update_agent_model expansion
  • src/ui/setup.rs — hardcoded defaults
  • docs/tasks/multimodal-and-input-metadata.md — the supports_images flag this task would expose