Skip to content

Fix Pi reasoning effort options to respect model capabilities - #431

Merged
Tryanks merged 1 commit into
Tryanks:mainfrom
lcisconl:fix/pi-supported-thinking-levels
Sep 15, 2026
Merged

Tryanks merged 1 commit into
Tryanks:mainfrom
lcisconl:fix/pi-supported-thinking-levels

Conversation

@lcisconl

Copy link
Copy Markdown
Contributor

Fixes #395.

Pi previously offered a fixed set of reasoning efforts, including levels the selected model does not support. Build the options from Pi's thinkingLevelMap: hide levels mapped to null, preserve ordinary defaults for omitted keys, and require explicit support for xhigh and max.

The existing Pi model adapter remains the owner of this behavior. The shared pickers consume the filtered model options, including when they are supplied by a remote host. There are no model-name special cases, new dependencies, or protocol changes. The composer design contract is updated.

Regression tests cover absent and partial mappings, disabled levels, extended levels, unsupported defaults, and non-reasoning models. The filtering regression fails with the original map_model function and passes with the fix. A separate non-reasoning test replaces repeated assertions for the same contract.

Validation on Windows with Rust 1.98.1:

  • cargo fmt --all --check: passed.
  • cargo build --workspace --locked: passed.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed.
  • cargo machete 0.9.2: passed.
  • Pi tests: 15 passed; the workspace run also passed all 174 agent tests.
  • cargo test --workspace --locked: stopped at two runtime failures, resident_idle_reaper_shuts_down_untouched_provider and orchestrate_worktree_dispatch_resolves_child_cwd_to_worktree (temporary worktree deletion returned Permission denied). The full suite is not green.
  • Individual reruns: the idle-reaper test passed; the worktree-deletion failure reproduced.

Checks were run on the patch over cba07d3. macOS, Linux, mobile/Web target checks, and two-device acceptance were not run.

@Tryanks
Tryanks force-pushed the fix/pi-supported-thinking-levels branch from f565965 to 8860f13 Compare September 14, 2026 17:12
@Tryanks
Tryanks merged commit 1847046 into Tryanks:main Sep 15, 2026
6 checks passed
@lcisconl
lcisconl deleted the fix/pi-supported-thinking-levels branch September 22, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pi Agent: hide reasoning effort levels a model does not support

2 participants