Skip to content

fix(zcode): carry reasoning ladders and image input into the provider_config.json store - #6828

Merged
lidge-jun merged 2 commits into
lidge-jun:devfrom
Blazetes:fix/zcode-store-capabilities
Oct 10, 2026
Merged

lidge-jun merged 2 commits into
lidge-jun:devfrom
Blazetes:fix/zcode-store-capabilities

Conversation

@Blazetes

@Blazetes Blazetes commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • ZCode 3.14 moved custom providers to v2/provider_config.json ([Bug]: ZCode 3.14 integration writes to the legacy provider file and is silently ineffective — injected models never appear #5348), and the store export (buildZcodeStoreContribution) carried over only each model rule's contextWindow. The reasoning ladder that [Bug]: ZCode client config export omits reasoning configuration, preventing thought level controls in ZCode UI #4147/fix(zcode): export reasoning configuration for thought-capable models #4153 added to the legacy v2/config.json block — and the catalog's declared image modality — were both silently dropped for every current ZCode build: opencodex models showed no thought-level picker and no attachment support.
  • This PR writes both capabilities into the store using the client's own schema, extracted from the ZCode CLI bundle's strict zod definitions for providerModelRules entries:
    • config.optionSpecs.reasoningLevel.values — the same Codex-vocabulary ladder the legacy block emits (minus the none sentinel). With no map, the client validates the chosen level against values and forwards it verbatim to reasoning.effort on the openai-responses api type, which is exactly the vocabulary the proxy's /v1/responses reads natively, so no mapping is emitted.
    • config.properties.inputFormat.supportsImage — only when the catalog row declares image input; text-only rows keep the client's own defaults rather than being pinned to false.
  • A model rule now ships when the row has any of: an authoritative context window, image input, or a selectable ladder. Rows with nothing authoritative to assert still ship no rule — the no-guessed-capability rule is preserved.
  • Effort filtering is shared with the legacy exporter through zcodeSelectableEfforts in model-metadata.ts, so both surfaces emit identical ladders.
  • supportsJsonSchemaOutput / supportsNativeWebSearch are deliberately not written: neither the catalog nor the vendored metadata snapshot carries an authoritative signal for them (supports_search_tool is the Codex client-side web_search tool, a different semantic from the client's "interface-native search" checkbox), and guessing a capability the model lacks fails at call time instead of degrading gracefully.

Verification

  • bun run typecheck — clean (re-run after rebasing onto dev tip 4504a563).
  • bun test tests/providers/zcode-client.test.ts — 17 pass, including 4 new regression tests: capabilities carried on a full row, text-only rows assert no inputFormat, a row without a context window still ships a rule when it has capabilities, and rows/audio-only rows with nothing to assert ship no rule.
  • bun test tests/clients/integrations-current-store.test.ts tests/config/client-config-export.test.ts tests/clients/client-export-reasoning-controls.test.ts tests/clients/client-export-effective-metadata.test.ts tests/clients/client-export-modality-enum.test.ts tests/config/client-config-export-new-clients.test.ts tests/config/client-config-export-output-limit.test.ts tests/clients/mutation-plan.test.ts tests/clients/integrations-writer.test.ts tests/clients/integrations-merge.test.ts — 312 pass, 0 fail (4 skip), re-run on the rebased head.
  • Live end-to-end check against a real install: patched a local 2.81.0 install with this change, re-applied ocx zcode enable against the running proxy, and confirmed the written store carries the same ladders/image flags the Codex-side catalog declares for all 15 personal models (e.g. opencode-go/mimo-v2.6-pro → inputFormat.supportsImage: true, reasoningLevel.values: [low, medium, high, xhigh, max]). After a full client restart the thought-level picker and image attachments appear for opencodex models.
  • Full bun run test not run locally (suite scale disproportionate for this change); the focused suites above cover the touched serializer, its shared helper, the merge/ownership machinery, and the export surface. Remaining coverage left to required CI on the PR head.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (Behavior fix only; no documented surface changed — no docs update needed.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (No auth surface touched; the serialized credential stays the non-secret loopback placeholder.)

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d6c027c1-565a-4774-a322-d3396af0b7ef

📥 Commits

Reviewing files that changed from the base of the PR and between 37e9294 and 82255de.


📒 Files selected for processing (4)
  • src/clients/config-export/model-metadata.ts
  • src/clients/config-export/zcode-store.ts
  • src/clients/config-export/zcode.ts
  • tests/providers/zcode-client.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

ZCode configuration now uses a shared helper to select reasoning efforts. Provider-store model rules can include authoritative context windows, image-input support, and selectable reasoning levels. Models without any of these capabilities are omitted.

Changes

ZCode model capabilities

Layer / File(s) Summary
Normalize selectable reasoning efforts
src/clients/config-export/model-metadata.ts, src/clients/config-export/zcode.ts
zcodeSelectableEfforts sanitizes effort lists, removes "none", and returns undefined when no selectable values remain. The ZCode client config uses this helper to determine whether to emit reasoning options.
Generate provider-store model rules
src/clients/config-export/zcode-store.ts, tests/providers/zcode-client.test.ts
Store rules can include an authoritative context window, declared image support, and selectable reasoning levels. The generator omits rules when none of these capabilities are present. Tests cover capability combinations, reasoning-level filtering, and audio-only models.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to 82255

No concrete issue remains that should delay merging after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 4 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: adding reasoning ladders and image input to the ZCode provider configuration store.


✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers: @lidge-jun @Ingwannu

@github-actions
github-actions Bot marked this pull request as draft October 9, 2026 12:55
…_config.json store

ZCode 3.14 moved custom providers to v2/provider_config.json (lidge-jun#5348), and the
store export carried over only each model's contextWindow — the reasoning
ladder lidge-jun#4147 added to the legacy v2/config.json block and the catalog's image
modality were both dropped, so every opencodex model showed no thought-level
picker and no attachment support in current ZCode builds.

Write the capabilities the client's own store schema accepts, extracted from
the ZCode CLI bundle's strict zod definitions: config.optionSpecs.reasoningLevel.
values (the same Codex-vocabulary ladder the legacy block emits, minus the none
sentinel; the chosen level is validated against values and forwarded verbatim
to reasoning.effort) and config.properties.inputFormat.supportsImage when the
catalog row declares image input. A model rule now ships when the row has any
of contextWindow, image input, or a selectable ladder; rows with none still
ship none, per the no-guessed-capability rule. Effort filtering is shared with
the legacy exporter via zcodeSelectableEfforts in model-metadata.
@Blazetes
Blazetes force-pushed the fix/zcode-store-capabilities branch from 82255de to fa95292 Compare October 9, 2026 13:37
@github-actions
github-actions Bot marked this pull request as ready for review October 9, 2026 15:34
@lidge-jun
lidge-jun merged commit aa09c2c into lidge-jun:dev Oct 10, 2026
65 of 78 checks passed
@lidge-jun lidge-jun mentioned this pull request Oct 10, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants