Skip to content

fix(combos,pi): keep unknown-ladder models selectable and Pi loopback models visible - #1151

Open
lidge-jun wants to merge 3 commits into
codex/260806-stack11-test-isolation-docsfrom
codex/260806-stack12-picker-pi-export
Open

fix(combos,pi): keep unknown-ladder models selectable and Pi loopback models visible#1151
lidge-jun wants to merge 3 commits into
codex/260806-stack11-test-isolation-docsfrom
codex/260806-stack12-picker-pi-export

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Two independent visibility fixes extracted from two much larger PRs.

Effort picker. A model whose capability ladder is unknown disappeared from the effort picker entirely, instead of being offered with no forced default. An unknown ladder is now a wildcard for picker availability only — an explicitly empty ladder still restricts, and the runtime stays fail-closed: concreteComboRequestBody() continues to omit the default unless the concrete target advertises support. Both halves are pinned by tests, because the useful behavior here is precisely that the picker becomes permissive while the wire does not.

Pi loopback export. Pi's exported config referenced an unresolved environment variable, and Pi resolves apiKey before building its model list — so it hid the provider entirely for a user who had never been told to export anything. It now ships the same non-secret opencodex-loopback placeholder the Kimi and Grok blocks use, with no required environment variable, since a loopback bind needs no admission key.

Attribution

Both source PRs were large — 32 and 31 files. Only the defect fix was taken from each. Dropped from #1092: catalog fallback synthesis, the public-name copy redesign, imageInput, and locale churn (its src/combos/index.ts and types.ts hunks were imageInput, so those files are untouched). Dropped from #1085: combo/direct-mode filtering, cross-client contract changes, and generalized export-policy churn.

One follow-up I did make, deliberately. The Pi change broke two assertions in tests/cli-export-command.test.ts — a file the plan marked as out of scope. They asserted the old export OPENCODEX_API_KEY= output, which is exactly the behavior #1085 reports as the bug. Leaving them red to respect a scope boundary would have shipped a red suite, so they were updated to the new contract. The security property they exist for is unchanged and still asserted: no ocx_ token ever reaches stdout.

#1092 and #1085 are left open for their authors. Planning unit: devlog/_plan/260806_stacked_bug_campaign/140_phase15_effort_picker_and_pi_export.md.

Stack 12, the final one, stacked on #1150.

Verification

  • bun test on the combo, config-export and CLI export suites — 165 pass then 74 pass after rebase, 0 fail
  • bun run test (full) — 9,556 pass, 8 skip, 0 fail across 596 files
  • bun run typecheck — exit 0
  • bun run lint:gui — exit 0
  • bun run build:gui — 214 modules transformed, built successfully
  • bun run privacy:scan — passed
  • git diff --check — clean

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

lidge-jun and others added 3 commits August 7, 2026 02:08
Adapted from PR #1092 while preserving fail-closed runtime injection.

Co-authored-by: 关俊江 <each1024@qq.com>
Co-authored-by: Eachann <43348055+eachann1024@users.noreply.github.com>
Adapted from PR #1085 without direct-mode filtering or cross-client contract changes.

Co-authored-by: n3wr1ch <40690535+n3wr1ch@users.noreply.github.com>
The two failing assertions encoded the behavior the fix deliberately changes:
Pi no longer emits an OPENCODEX_API_KEY env reference, because Pi resolves
apiKey before building its model list and hides the provider when the
reference is unset - which is the defect #1085 reported.

The security property under test is unchanged and still asserted: no ocx_
token ever reaches stdout. Only the expected reference form moved from
$OPENCODEX_API_KEY to the non-secret opencodex-loopback placeholder.

Co-authored-by: n3wr1ch <40690535+n3wr1ch@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b834862b-bbf3-41f3-be55-c8608283ca12

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 595b0e4a34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const member: string[] = listed === undefined
? []
: listed.filter((effort) => effortSet.has(effort));
if (listed === undefined) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the effort-picker hint for wildcard ladders

When a selected target has no effort metadata, this branch now preserves the other targets' efforts—or offers every effort when all ladders are unknown—but gui/src/i18n/en.ts still tells users that targets without metadata “offer none.” The visible explanation therefore contradicts the picker; revise the hint consistently across the locale files to explain the wildcard behavior.

AGENTS.md reference: gui/AGENTS.md:L14-L18

Useful? React with 👍 / 👎.

destination: () => join(homedir(), ".pi", "agent", "models.json"),
apiKeyEnv: PI_API_KEY_ENV,
exportHint: `export ${PI_API_KEY_ENV}=<your key>`,
apiKeyEnv: "",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Suppress key warnings for placeholder-only Pi configs

When the dashboard has no generated API keys, ClientConfigDialog unconditionally renders api.clientConfig.noKeyYet and interpolates envelope.apiKeyEnv; returning an empty string here makes the Pi dialog display a blank key name and instruct users to generate a key for off-loopback use, even though Pi is marked loopback-only and now needs no key. Gate that warning on a nonempty credential requirement, or represent placeholder-only clients explicitly.

Useful? React with 👍 / 👎.

baseUrl: ctx.baseUrl,
api: PI_API_DIALECT,
apiKey: PI_API_KEY_ENV_REF,
apiKey: LOOPBACK_API_KEY_PLACEHOLDER,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update Pi credential guidance for the placeholder

After Pi starts serializing this literal placeholder, the shipped guidance still documents the removed environment-reference contract: src/cli/help.ts:181 says only Kimi uses a placeholder, while docs-site/src/content/docs/reference/cli/agents.md:176-182 and docs-site/src/content/docs/guides/integrations.md:12,85-87 still direct Pi users to OPENCODEX_API_KEY. Update those user-facing instructions and translated documentation so exported behavior and setup guidance agree.

AGENTS.md reference: AGENTS.md:L231-L232

Useful? React with 👍 / 👎.

lidge-jun added a commit that referenced this pull request Aug 6, 2026
Both remaining phases executed: #1150 (Yuxin Qiao, test isolation + Desktop
allowlist docs) and #1151 (Eachann + n3wr1ch, effort picker + Pi loopback
export). 16 contributor PRs landed across 12 stack PRs.

Also records the one in-scope deviation: phase 140 marked
tests/cli-export-command.test.ts as DROP, but the Pi fix made two of its
assertions stale - they expected the exact output #1085 reports as the bug.
Updating them beat shipping a red suite; the no-secret-in-stdout property is
unchanged.
@lidge-jun
lidge-jun force-pushed the codex/260806-stack12-picker-pi-export branch from 595b0e4 to 20a517b Compare August 6, 2026 17:31
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.

1 participant