Skip to content

fix(config): preserve legacy OpenCode Go configs after native wire pins - #7238

Merged
lidge-jun merged 2 commits into
devfrom
codex/fix-go-gemini-pin-upgrade
Oct 16, 2026
Merged

lidge-jun merged 2 commits into
devfrom
codex/fix-go-gemini-pin-upgrade

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Existing OpenCode Go configs with modelAdapters["qwen3.7-plus"] = "openai-chat" (or analogous Gemini/Qwen Chat/Responses overrides) fail validation after fix(providers): carry Zed, Qoder, and OpenCode Gemini compatibility #7216 adds native wire pins, causing the entire saved config to fall back to defaults. Normalize these formerly valid overrides before validation in both runtime loading and diagnostics; the native pin wins while providers, accounts and routing survive.
  • Remove formerly valid Responses-only image-generation preferences alongside migrated overrides. Preserve strict validation for new writes, malformed values, historical pins and unsupported authentication modes. File reads warn without rewriting saved bytes; a later explicit edit persists the normalized config. Reuse the existing Zen migration.
  • Reviewed git diff 4ae49360b..origin/dev -- src/config src/types through 4ed45e9516e4421197d7cb0dd95a3d2f316aa0c9: Zen Gemini is the other hard-pin tightening and already has load/diagnostics migration. Other additions are optional fields, relaxed request-pacing validation, or independently degraded blocks (autoReviewOverride, reasoning retention, native reasoning retention). No additional previously valid configuration rejection requiring a same-class fix was identified.

Verification

  • Merged current origin/dev, including fix(gui): restore keep-native-v1 qualifier placement #7237 (050bb444a0), into this branch without conflicts. Current pushed head: e962a91b686b1bcff3e86b1597a756dc3a66b714. The PR diff remains the eight config-migration/test/docs files.
  • Remote Linux verification on lidge passed at the new head, label f1-7238-e962a9-1016, via OCX_LANE_SLOTS=3 ~/bin/ocx-lane-ci2.sh <sha> <label> with tests/config/config-opencode-go-upgrade.test.ts, tests/config/config-opencode-zen-upgrade.test.ts, tests/config/config-commandcode-claude-pin.test.ts, tests/test-layout.test.ts, tests/test-layout-tooling.test.ts, and tests/ci-workflows/file-size-ratchet.test.ts. Result: typecheck exit 0, 87 tests passed, 0 failed across those six files, Bun 1.4.3. Evidence: ~/ocx-lane/logs/f1-7238-e962a9-1016.summary and corresponding .log.
  • At the current head, remote bun run structure:check and bun run privacy:scan passed. The isolated formerly failing GUI test also passed on lidge: 6 passed, 0 failed (remote system Bun 1.3.14).
  • The previous head passed remote typecheck and all 87 focused tests (Bun 1.4.3), plus remote structure and privacy checks. Its hosted gates failure was four inherited source-placement assertions in gui/tests/models-keep-native-v1-placement.test.ts; the test and both input files had identical Git blobs at its base. The coordinator fixed that issue in fix(gui): restore keep-native-v1 qualifier placement #7237, now included above. The final authority is new-head hosted PR run 38882493759, attempt 1, bound to the current head above; superseded old-head results do not certify this head.
  • Before the coordinator corrected the rule to prohibit all local tests/typecheck, local focused checks had completed: 87 distinct tests passed, plus typecheck, structure, privacy and docs build. No local execution checks ran after the correction. All subsequent checks are remote or hosted. Full suite was not run locally.
  • Red/green evidence collected before the correction: disabling only Go normalization makes the old Qwen Chat regression fail with source: "fallback" and the native-wire validation error; restoring normalization passes. Initial missing-dependency failure was resolved and was not counted as red evidence.
  • Tests cover file-read preservation, diagnostics parity, strict writes, idempotence, unchanged saved bytes, native pin selection and explicit-edit persistence. No live provider request was made.

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.

Co-authored-by: Georgiy Bukharov souljorje@gmail.com
Co-authored-by: norths7ar guicaitiandu@gmail.com

Preserve saved providers, accounts and routing when native Gemini/Qwen wire
pins invalidate previously supported Chat or Responses overrides. Share the
file-read migration across runtime and diagnostics while retaining strict
candidate-write validation and the existing Zen migration.

Co-authored-by: Georgiy Bukharov <souljorje@gmail.com>
Co-authored-by: norths7ar <guicaitiandu@gmail.com>
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 16, 2026 09:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T09:35:16.232621Z 88c66a6 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Oct 16, 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: e7e16c5c-1f65-4091-98ea-37ad4ce94d57
📥 Commits

Reviewing files that changed from the base of the PR and between 4ed45e9 and 88c66a6.

📒 Files selected for processing: 8
  • docs-site/src/content/docs/guides/providers.md
  • scripts/test-layout/layout.json
  • src/config.ts
  • src/config/diagnostics.ts
  • src/config/opencode-wire-upgrade.ts
  • structure/config.md
  • tests/config/config-opencode-go-upgrade.test.ts
  • tests/fixtures/test-layout-expected.json

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

📝 Walkthrough

Configuration reads now sanitize saved OpenCode Go overrides for newly pinned Gemini and Qwen models. Runtime loading and diagnostics use the shared sanitizer. Explicit edits can persist normalized values, while new incompatible overrides remain rejected.

Changes: OpenCode Go configuration upgrade

Layer / File(s) Summary
Normalize saved Go overrides
src/config/opencode-wire-upgrade.ts, tests/config/config-opencode-go-upgrade.test.ts
The load sanitizer removes eligible Chat and Responses overrides and specified hosted-tool preferences for newly pinned models. Tests cover the affected preferences, model pins, boundary cases, and repeated sanitization.
Apply upgrade through configuration readers
src/config.ts, src/config/diagnostics.ts, tests/config/config-opencode-go-upgrade.test.ts, docs-site/src/content/docs/guides/providers.md, structure/config.md, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json
Both readers use the shared sanitizer. Tests cover read-only normalization, persistence on explicit edits, historical Go URL pins, and strict validation of new overrides. Documentation and test-layout mappings are updated.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 88c66

Saved OpenCode Go configurations that carry older Chat or Responses overrides should keep loading after the Gemini and Qwen pins, with providers, accounts and routing retained. No merge-blocking risk is evident from the supplied change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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 summarizes the main change: preserving legacy OpenCode Go configurations after native wire pins. It is concise, specific, and directly related to the changeset.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (4 skipped: 4 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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 added the bug Something isn't working label Oct 16, 2026
@lidge-jun
lidge-jun merged commit e498fde into dev Oct 16, 2026
34 of 36 checks passed
@lidge-jun
lidge-jun deleted the codex/fix-go-gemini-pin-upgrade branch October 16, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant