Skip to content

fix(pi): use Pi configured provider for Source Control AI defaults - #21693

Merged
nwparker merged 3 commits into
mainfrom
nwparker/omp-pi-default-provider
Sep 19, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/omp-pi-default-provider

Conversation

@nwparker

@nwparker nwparker commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​63 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

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-mini even 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 --model and explicit models remain passed through.
  • src/main/text-generation/commit-message-text-generation-model-discovery.test.ts: verifies discovery keeps the config-default sentinel.
  • Focused suite: 59 tests passed.
  • Live installed OMP smoke test: printf 'Reply with exactly OK.\n' | omp --print --no-session --no-tools --no-extensions --no-skills --no-rules --mode text returned OK without 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

  • Focused tests pass
  • Real OMP CLI exercised
  • Local and SSH-safe command path unchanged
  • No OMP source checkout changes
  • ELI5 included
  • Visual proof applicability explained

Fixes #14407
Related: #14076

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.
@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 459c7ccd-d1d6-4738-b4f4-29ca1e027e51

📥 Commits

Reviewing files that changed from the base of the PR and between 7aa4592 and 651316b.

📒 Files selected for processing (2)
  • src/renderer/src/lib/source-control-generation-plan.test.ts
  • src/shared/commit-message-agent-spec.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Pi agent now exposes default as its configured-model choice. It omits --model for that choice and passes the flag for explicit models. Model discovery preserves the static default when present and otherwise uses the first discovered model. Tests update Pi default expectations and cover both argument paths.

Priority: ➖ Normal

Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Pi Source Control AI default-provider fix and accurately summarizes the main change.
Description check ✅ Passed The description explains the user-facing change, rationale, linked issue, testing, visual-proof applicability, scope, and risk. It is mostly complete despite not reproducing every template heading, su…
Linked Issues check ✅ Passed Issue #14407 requires Pi branch/worktree automation to use Pi's configured provider when no Orca model override exists. The Pi agent now uses the default sentinel, and buildArgs omits --model fo…
Out of Scope Changes check ✅ Passed The changed source and test files address Pi model selection, model discovery, and command argument construction. These changes support the linked branch/worktree rename failure and the shared commit-…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 88369d89-70a9-42df-b363-dd0a1862a8b9

📥 Commits

Reviewing files that changed from the base of the PR and between e8a7be4 and 996584a.

📒 Files selected for processing (4)
  • src/main/text-generation/commit-message-model-discovery-policy.ts
  • src/main/text-generation/commit-message-text-generation-model-discovery.test.ts
  • src/shared/commit-message-agent-spec.test.ts
  • src/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.

@nwparker

Copy link
Copy Markdown
Contributor Author

Readiness update (2026-09-19): focused tests (59/59), oxlint, and oxfmt pass locally; the real installed omp --print smoke returned OK without --model. Required CI is green for typecheck, static analysis, macOS/Linux/Windows runtime, relay integration, and code-relevant guards. Remaining package and test shards plus Pullfrog are still running; I will leave this PR unmerged until they complete.

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — buildArgs omits --model when the selected model is the new default sentinel; explicit selections still pass the flag through.
  • Pi seed model swap — the static github-copilot/gpt-5.4-mini entry and its thinking levels are replaced by { id: 'default', label: 'Config default' }, with defaultModelId: 'default'.
  • Discovery default — finalizeModelDiscoveryOutput now picks the default from the static spec (spec.models) rather than the discovered catalog.

ℹ️ Nitpicks

  • src/shared/commit-message-agent-spec.test.ts:631 pins the explicit Pi model with toEqual(expect.arrayContaining(['--model', 'openai-codex/gpt-5.5'])). arrayContaining checks membership, not adjacency, so a stray --model plus the id elsewhere would still pass; a positional assertion would pin the pairing.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

}
],
defaultModelId: 'github-copilot/gpt-5.4-mini'
defaultModelId: 'default'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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 — finalizeModelDiscoveryOutput now forces the static default only for the default sentinel, 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 auto asserts defaultModelId: 'gpt-5.2'; it fails under the previous spec.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.

Pullfrog  | Fix it ➔ | View workflow run | Using 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.
@nwparker
nwparker merged commit b0cbb91 into main Sep 19, 2026
33 checks passed
@nwparker
nwparker deleted the nwparker/omp-pi-default-provider branch September 19, 2026 17:14
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.

[Bug]: Pi branch auto-rename hardcodes GitHub Copilot model instead of using Pi's configured provider

1 participant