Repository navigation
fix(pi): use Pi configured provider for Source Control AI defaults - #21693
Conversation
When Orca runs Pi for automatic branch names or commit messages without an explicit model override, omit --model so Pi resolves its configured provider. Preserve explicit discovered model selection and add regression coverage.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Pi agent now exposes Priority: ➖ Normal Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 88369d89-70a9-42df-b363-dd0a1862a8b9
📒 Files selected for processing (4)
src/main/text-generation/commit-message-model-discovery-policy.tssrc/main/text-generation/commit-message-text-generation-model-discovery.test.tssrc/shared/commit-message-agent-spec.test.tssrc/shared/commit-message-agent-specs-primary.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
Readiness update (2026-09-19): focused tests (59/59), oxlint, and oxfmt pass locally; the real installed |
Keep the configured-default sentinel behavior limited to agents whose default is the explicit CLI sentinel. Other dynamic agents still fall back to the first discovered model when their static default is unavailable.
There was a problem hiding this comment.
Important
Two follow-ups worth addressing before merge: the new Pi default sentinel renders as a literal --model default in the Source Control AI CLI-arguments placeholder, and the discovery-default predicate now overrides the discovered catalog for every dynamic agent, not just the sentinel.
Reviewed changes
- Pi defers to its own provider —
buildArgsomits--modelwhen the selected model is the newdefaultsentinel; explicit selections still pass the flag through. - Pi seed model swap — the static
github-copilot/gpt-5.4-minientry and its thinking levels are replaced by{ id: 'default', label: 'Config default' }, withdefaultModelId: 'default'. - Discovery default —
finalizeModelDiscoveryOutputnow picks the default from the static spec (spec.models) rather than the discovered catalog.
ℹ️ Nitpicks
src/shared/commit-message-agent-spec.test.ts:631pins the explicit Pi model withtoEqual(expect.arrayContaining(['--model', 'openai-codex/gpt-5.5'])).arrayContainingchecks membership, not adjacency, so a stray--modelplus the id elsewhere would still pass; a positional assertion would pin the pairing.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| } | ||
| ], | ||
| defaultModelId: 'github-copilot/gpt-5.4-mini' | ||
| defaultModelId: 'default' |
There was a problem hiding this comment.
The new sentinel id flows into getSourceControlAgentArgsPlaceholder('pi'), which has no override in AGENT_ARGS_PLACEHOLDER_OVERRIDES and returns the literal --model default. omp carries an explicit --model <provider/model> override for exactly this reason. A user copying the placeholder sends --model default to Pi (the generated args deliberately omit the flag), which Pi rejects. Reachable now that Pi is a selectable text-generation agent.
Technical details
# Keep the Pi sentinel out of the recipe args placeholder
## Affected sites
- `src/shared/commit-message-agent-specs-primary.ts:213-217` — new `default` sentinel and `defaultModelId`.
- `src/renderer/src/components/settings/source-control-action-recipe-options.ts:61-67` — `AGENT_ARGS_PLACEHOLDER_OVERRIDES` covers `codex`, `copilot`, `omp` but not `pi`.
- `src/renderer/src/components/settings/source-control-action-recipe-options.ts:94` — falls through to `--model ${capability.defaultModelId}`.
- `src/shared/commit-message-plan.ts:78` — Pi uses `DEFAULT_SINGLETON_OPTIONS`, so a user-supplied `--model default` is not filtered out.
## Required outcome
- The Pi placeholder shows a real example rather than the sentinel.
## Suggested approach
- Add `pi: '--model <provider/model>'` to `AGENT_ARGS_PLACEHOLDER_OVERRIDES` (mirrors the `omp` entry).
- Optional: assert `getSourceControlAgentArgsPlaceholder('pi')` in `CommitMessageAiPane.test.tsx:152`.There was a problem hiding this comment.
ℹ️ The follow-up commit resolves the discovery-default scoping concern cleanly; the earlier recipe-args placeholder point is still open.
Reviewed changes (since 996584a)
- Scoped the discovery default —
finalizeModelDiscoveryOutputnow forces the static default only for thedefaultsentinel, or when discovery actually lists the static default, restoring the first-discovered fallback for concrete agents. - Regression test — a new cursor case whose discovery omits
autoassertsdefaultModelId: 'gpt-5.2'; it fails under the previousspec.models.some(...)predicate.
The narrowed predicate is correct: Pi keeps its sentinel while Codex/Claude/OpenCode/Cursor/Antigravity and the grok/omp probe specs return to the prior availability fallback. Verified pnpm test src/main/text-generation/commit-message-text-generation-model-discovery.test.ts — 17 passed.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Prove Source Control AI does not render the Pi configured-default sentinel as a literal model argument, and assert explicit model flag pairing positionally.

What changed
When Orca runs Pi for Source Control AI without an explicit model override, it now invokes Pi without
--model. Pi can therefore use the provider and model configured in its own profile. Explicitly selected or discovered models still receive--model.This fixes the automatic first-work branch/worktree rename failure reported in #14407 and the same commit-message failure described in #14076, where Orca forced
github-copilot/gpt-5.4-minieven when the user had configured another Pi provider.ELI5
Orca used to tell Pi “use GitHub Copilot” every time it named a branch. If Copilot was not configured, Pi stopped immediately. Orca now lets Pi use its own configured default unless the user explicitly picks a model.
Proof
src/shared/commit-message-agent-spec.test.ts: verifies the default omits--modeland explicit models remain passed through.src/main/text-generation/commit-message-text-generation-model-discovery.test.ts: verifies discovery keeps the config-default sentinel.printf 'Reply with exactly OK.\n' | omp --print --no-session --no-tools --no-extensions --no-skills --no-rules --mode textreturnedOKwithout a forced model.Visual proof
N/A — this changes a non-interactive CLI argument and has no visual surface. The generated argv contract and real OMP invocation are the relevant proof.
Merge risk
Low. The change is limited to Pi Source Control AI argument construction and default-model discovery. An explicit model selection is unchanged; other agents are unchanged. No IPC, persistence, wire format, or dependency changes.
Verification checklist
Fixes #14407
Related: #14076