You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: prompt_async notifications override session's active agent and model #21728
When a prompt_async request arrives without explicit agent or model fields (e.g., from Envoy notifications, Legion worker coordination, or any fire-and-forget prompt injection), the session's active agent and model are silently overridden by the default agent's configured defaults.
Steps to Reproduce
Start a session and set it to a non-default agent and model (e.g., agent=hephaestus, model=opencode/kimi-k2.5-free)
Send a POST /session/:id/prompt_async with only parts (no agent, no model)
Observe the next assistant turn uses the default agent's configured model, not the session's active model
Expected Behavior
When prompt_async omits agent and model, the session should preserve whatever agent and model were active from the last user message.
Actual Behavior
The session's agent falls back to the default agent config, and the model falls back to that agent's configured model — discarding whatever the user had actively selected.
Root Cause
In packages/opencode/src/session/prompt.ts, createUserMessage() defaulted omitted agent/model from the default agent configuration instead of reading the current session prompt state (most recent user/assistant message). The synthesized user message then became the new source of truth for ACP session replay, silently redirecting the session.
Impact
This actively affects overnight agent coordination: Envoy notifications delivered to sessions via prompt_async can change the session's agent and model, causing unexpected model switches and errors.
I have experienced the opposite of this condition and it resulted in having to reinstall OpenClaw fresh in order to resolve. The main session was picking up its model config from session history, rather than config, and session history model was no longer available (Claude).
We need the ability to reliably configure models from a central location without stale config polluting long-lived sessions.
The selected model should be configured per session, overridable when sending a message. If a model change is intended to be durable, there should be a session model configuration call or parameter that explicitly sets a durable model.
Activity
github-actions commentedon Apr 9, 2026
This issue might be a duplicate of existing issues. Please check:
sjawhar commentedon Apr 9, 2026
Re: potential duplicates flagged by the bot (#18615, #13456):
prompt_async/createUserMessage()path and should also fix [Bug] Model parameter ignored when launching subagent with agent name #18615's scenario.createEffectenforces agent defaults — not a duplicate.PR: #21729
clarajohan commentedon May 7, 2026
I have experienced the opposite of this condition and it resulted in having to reinstall OpenClaw fresh in order to resolve. The main session was picking up its model config from session history, rather than config, and session history model was no longer available (Claude).
We need the ability to reliably configure models from a central location without stale config polluting long-lived sessions.
The selected model should be configured per session, overridable when sending a message. If a model change is intended to be durable, there should be a session model configuration call or parameter that explicitly sets a durable model.
github-actions commentedon Jul 8, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.