Skip to content

[Bug]: Pi extensions override the explicitly selected model on following turns #37511

Closed

Description

@StiensWout

Before submitting

  • 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

  1. Select an explicit Pi model A in a T3 thread and send a turn.
  2. Run a supported Pi extension command such as a preset that calls pi.setModel to switch the native session to model B.
  3. 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.

Version or commit

main @ 39e269a

Environment

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

  1. added
    vouch:trusted
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions