feat(pi): add thinking option for reasoning level control#584
Open
jerome-benoit wants to merge 2 commits into
Open
feat(pi): add thinking option for reasoning level control#584jerome-benoit wants to merge 2 commits into
thinking option for reasoning level control#584jerome-benoit wants to merge 2 commits into
Conversation
Expose pi's `--thinking` CLI flag through `PiOptions`, matching the `effort` option on `claudeCode`/`codex` and `variant` on `opencode`. Uses a typed union (`"off" | "minimal" | "low" | "medium" | "high" | "xhigh"`) since pi has a fixed, known set of valid thinking levels. Closes mattpocock#583
|
@jerome-benoit is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
This PR exposes pi’s --thinking reasoning level flag via a new PiOptions.thinking option, aligning pi with the existing “reasoning control” options supported by other agent providers.
Changes:
- Added
thinking?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh"toPiOptions. - Updated
pi().buildPrintCommand()to append--thinking <level>when configured. - Added unit tests to verify
--thinkingis included/omitted correctly and supports all levels.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/AgentProvider.ts | Adds the thinking option to PiOptions and wires it into the generated pi print command. |
| src/AgentProvider.test.ts | Adds coverage for the new thinking flag behavior and supported levels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README update deferred — same rationale as mattpocock#582: PiOptions section will be added when the provider options docs are restructured.
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
Expose pi's
--thinkingCLI flag throughPiOptions, matching theeffortoption onclaudeCode/codexandvariantonopencode.Changes
src/AgentProvider.ts: Addedthinking?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh"toPiOptionsand wired--thinkingflag inbuildPrintCommand.src/AgentProvider.test.ts: Added 4 tests covering presence, absence, empty options, and all 6 thinking levels.Usage
Design decisions
string): Pi has a fixed, documented set of 6 levels (off,minimal,low,medium,high,xhigh). Using a union provides compile-time safety — same pattern asclaudeCodeandcodex.claudeCode'seffort.buildInteractiveArgsunchanged: Pi's TUI manages thinking level via Shift+Tab — no need to pass it on the interactive command line.Closes #583