-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Allow changing ACP mode, model, and agent in-session
Problem
ACP mode/model/agent are not fully controllable from the session UI.
Need runtime selectors + persistence, without breaking current planning workflow.
Goals
- Add runtime selectors for
mode,model,agent. - Persist per-session selections.
- Apply workspace defaults for new/empty sessions.
- Keep deterministic behavior while streaming.
- Gracefully degrade when ACP does not expose model/agent options.
Out of Scope
- Whisper model UX changes.
- Non-ACP provider integration.
Layout Changes
Current (header has session/phase/connection only)
┌─────────────────────────────────────────────────────────────────────────────┐
│ [Session Name] [#sessionId] [Phase ▼] [Connect/Reconnect] [window actions]│
├─────────────────────────────────────────────────────────────────────────────┤
│ Chat panel | Plan panel │
└─────────────────────────────────────────────────────────────────────────────┘
Proposed (add ACP controls in header as chips)
┌─────────────────────────────────────────────────────────────────────────────┐
│ [Session Name] [#sessionId] [Phase ▼] [Mode ▼] [Model ▼] [Agent ▼] [Adv ▼]│
│ [Connect/Reconnect] [window actions]│
├─────────────────────────────────────────────────────────────────────────────┤
│ Chat panel | Plan panel │
└─────────────────────────────────────────────────────────────────────────────┘
Header behavior
- Controls disabled when:
- streaming (
isStreaming=true) - disconnected
- streaming (
Model/Agenthidden or disabled with “Unavailable from ACP” when options are absent.- Keep workflow auto-switch:
- planning => force
planmode - approve => force
agentmode - append notice message when auto-switched.
- planning => force
Technical Plan
1) ACP contract support (Rust + TS)
- Extend ACP types with config options:
- available config options
- selected config options
- Add Tauri command:
acp_set_config_option(workspace_id, session_id, config_id, option_id)- maps to ACP
session/set_config_option
- Register command in
invoke_handler. - Parse config-option update events in
useAcpSession.
2) Persistence
- Add
acp_preferences_json TEXT NOT NULL DEFAULT '{}'tosessions. - Add table
workspace_acp_defaults:workspace_path TEXT PRIMARY KEYacp_preferences_json TEXT NOT NULL DEFAULT '{}'updated_at TEXT NOT NULL
- Add commands:
-
session_update_acp_preferences(id, acp_preferences_json) -
workspace_acp_defaults_get(workspace_path) -
workspace_acp_defaults_set(workspace_path, acp_preferences_json)
-
- Remove workspace defaults in
forget_workspace_data.
3) Preference application order
- On session init:
- load ACP session info
- load session prefs
- if empty -> load workspace defaults
- apply
modefirst, then config options - ignore stale/invalid selections safely
- On successful user selection:
- update ACP
- persist session prefs
- upsert workspace defaults
4) UI implementation
- Add
AcpSessionControlscomponent inActiveSessionViewheader. - Controls:
Modeselector (existing ACP modes)Modelselector (ACP config detected as model)Agentselector (ACP config detected as agent)Advancedselector for remaining config options
- Update
useAcpSessionreturn contract:- expose structured modes
- expose config options + selected values
- add
setConfigOption(configId, optionId)
5) i18n
- EN/PT keys for:
- labels (
Mode,Model,Agent,Advanced) - disabled/unavailable text
- auto-switch notice
- labels (
Data Contract
acp_preferences_json
{
"modeId": "string | null",
"selectedConfigOptions": {
"configId": "optionId"
}
}Resolution rules
- Session prefs override workspace defaults.
- Workspace defaults apply only when session prefs are empty.
- Invalid IDs are dropped (no hard failure).
Acceptance Criteria
- User can change mode at runtime.
- User can change model/agent when ACP exposes those options.
- Selections persist per session and restore on resume.
- New/empty sessions inherit workspace defaults.
- Selectors disabled during streaming.
- Missing model/agent options do not break UI.
- Plan workflow auto-switch still works and shows notice.
Test Plan
Frontend
-
useAcpSessionparses mode/config update events correctly. - Preference merge logic tests:
- session > workspace defaults
- fallback to workspace defaults
- stale IDs ignored
-
AcpSessionControlsrendering tests:- normal state
- streaming disabled state
- unavailable model/agent state
- selector action tests invoke expected Tauri commands.
Backend
- migration tests for new column/table.
- command tests for get/set prefs.
- command test for
acp_set_config_option.
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels