fix: honor --model for reconnect prompts#211
Open
skywills wants to merge 7 commits intoopenclaw:mainfrom
Open
Conversation
…_meta Previously --model was only applied during session/new (createSession). This meant any prompt to a live session silently ignored the model flag. Changes: - SessionSendOptions: add sessionOptions field - QueueOwnerRuntimeOptions + SessionSendLike: add sessionOptions field - queueOwnerRuntimeOptionsFromSend: propagate sessionOptions - runSessionQueueOwner: pass sessionOptions to sharedClient - RunSessionPromptOptions: add sessionOptions field - withConnectedSession (prompt-runner): pass sessionOptions to AcpClient - loadSessionWithOptions (client): include _meta from sessionOptions - CLI prompt command: wire globalFlags.model/allowedTools/maxTurns into sendSession Fixes: model flag silently ignored on live sessions (queue owner running)
…sion model switch - queue-owner-env: parse sessionOptions from ACPX_QUEUE_OWNER_PAYLOAD - session-runtime: route set_config_option through sharedClient live connection - client: add updateSessionOptions() for runtime model updates Fixes mid-session model switching and first-prompt model selection.
client.ts routed model changes through session/set_model (unstable_setSessionModel) which bypassed the Claude adapter's resolveModelPreference fuzzy matching. Model aliases like 'sonnet' or 'haiku' were passed raw to query.setModel() which didn't resolve them. Now tries session/set_config_option first (which has alias resolution on the adapter side), then falls back to session/set_model for adapters like Droid that only support the dedicated method.
runQueuedTask never saved the session record to disk after runSessionPrompt, so when loadSession failed and a fresh session was created with a new acpSessionId, subsequent control commands (e.g. model switch) read the stale record from disk and got 'Session not found' from the adapter. Now writes the record after each prompt in the queue owner, ensuring set_config_option fallback sees the correct acpSessionId.
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
This PR fixes a reconnect-session regression where prompt with session and model (for example, model haiku with Claude) could still run on the previously active model after session load/reconnect.
Root Cause
Per-command session options were not consistently preserved through reconnect and queue-owner prompt paths, and the reconnect prompt flow did not always enforce requested model application before prompt execution.
Changes
Files Changed
Validation
Notes