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]: Pi extensions override the explicitly selected model on following turns #37511
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Select an explicit Pi model A in a T3 thread and send a turn.
Run a supported Pi extension command such as a preset that calls pi.setModel to switch the native session to model B.
Send another turn with model A still selected, or select A again before sending.
Expected behavior
The following turn uses the explicit model A selected in T3.
Actual behavior
The following turn uses model B. The adapter remembers its last set_model as A and skips restoring it. Native extension model switches do not emit a model-change RPC notification, so the stale cache persists. Native thinking-level changes can similarly override the selected thinking level.
Impact
Major degradation or frequent failure for users of model-switching Pi extensions.
Pi provider; independently confirmed with Pi 1.5.2 over RPC on Linux.
Logs or stack traces
Deterministic public-adapter reproduction: both turns select anthropic/model-a; after a simulated native switch, the second prompt uses openai/model-b. The regression test is included in the companion fix PR.
Independently reproduced against real Pi 1.5.2 without an LLM call: set_model A, get_state A, extension command calling pi.setModel(B), get_state B. No model-change RPC event was emitted.
Workaround
Choose a different model and then choose the intended model again, or start a new session.
Found during the Pi and ACP Improvements hunt by GPT 6.1 Sol and independently confirmed by Claude Opus 5.5.
Activity