fix(acp): persist runtime model and mode into assistant preferences#482
Merged
Conversation
When users switched the model or mode inside an ACP conversation, the change reached the running agent through `set_config_option` but never flowed back into `assistant_preferences.last_*`. The next conversation seeded from the same assistant in `auto` mode therefore re-used the previously persisted value, ignoring the user's most recent pick. Mirror runtime model/mode switches into the persisted assistant snapshot and preference, but only when the agent confirms the change as observed — `command_ack` means the request was accepted, not applied, and unrelated option ids (e.g. `thought_level`) have no preference mapping. Persistence failures are logged and do not roll back the user-facing config switch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set_config_optioninto the persisted assistant snapshot andassistant_preferencesso an assistant configured withdefault_*_mode = autoactually remembers the user's most recent pick across conversations.Observed—CommandAckonly acknowledges the request, and unrelated option ids (e.g.thought_level) have no preference mapping.warn!but do not roll back the user-facing config switch.Why
Before this change, switching the model inside an ACP conversation reached the running agent through
acpConversation.setConfigOption, but that code path forwarded straight toIAgentTask::set_config_optionand never touchedassistant_preferences.last_*. The next conversation seeded from the same assistant inautomode therefore re-used the previously persisted value, ignoring the user's most recent pick. The aionrs path already wrote back viaConversationService::update; this brings the ACP path to parity.Verification
cargo test -p aionui-conversation(270 lib + integration tests pass, including 3 newset_config_option_*cases)cargo clippy -p aionui-conversation --tests --no-deps -- -D warningscargo fmt -p aionui-conversation --check