GeezerVison is showing github.com — fix(schema): reject model reference segments with internal whitespace by dezren39 · Pull Request #445 · developing-today-forks/opencode
Conversation
dezren39
commented
Oct 25, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #443 (OpenCode part of the set; the OpenChamber port is the set-remainder recorded against #443).
Change
ModelAlias.resolve/resolveRef rejected padded and empty provider/model/variant segments (#436/#437) but accepted segments with internal whitespace — open ai/gpt-4, openai/gpt 4, openai/gpt-4#hi there, a tab inside a model name, and the same spellings arriving via provider, model (global and scoped), and variant alias targets all resolved into references that can never match a real model.
Adds a hasWhitespaceSegment check beside the existing padded/empty checks at every gate: the input check, the global/scoped/provider alias-target checks, the settled-base check, the final-variant check, checkedVariantTarget, and parseRefString.
Verification
- Probe before the fix: all of the spellings above RESOLVED; after the fix all THROW
Invalid model reference, and a normal reference still resolves.
packages/core model-alias tests: 32/32 pass, including the new test 32 covering each position and each alias kind. Ablation: with the schema change stashed, exactly the new test fails (31 pass / 1 fail).
bun typecheck passes in both packages/schema and packages/core.
- Nested model IDs (
openrouter/anthropic/claude-sonnet-4) and slash-containing variants still resolve (asserted in the new test and the existing suite).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
- Bug Fixes
- Model references and alias targets containing whitespace within provider, model, or variant segments are now rejected as invalid.
- Leading or trailing whitespace around a complete reference remains accepted, and multi-part provider paths continue to work.
- The validation applies whether aliases are configured or not, helping ensure references are handled consistently across these cases.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
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-25T16:43:29.328852Z |
f09361b |
New commits |
ℹ️ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This PR doesn't fully meet our contributing guidelines and PR template.
What needs to be fixed:
- PR description is missing required template sections. Please use the PR template.
Please edit this PR description to address the above within 72 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b3587486-49f3-42e6-a0ed-74bce0959c63
Commits
-
Reviewing files that changed from the base of the PR and between 77c312a and f09361b.
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:
No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
114db430-8a8a-4baf-a13c-aec1e43231d0
Commits
-
Reviewing files that changed from the base of the PR and between e791e49 and 77c312a.
Files selected for processing: 2
-
packages/core/test/model-alias.test.ts
packages/schema/src/model-alias.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Walkthrough
-
Model reference parsing and alias resolution now reject whitespace within provider, model, and variant segments. Tests cover direct references and alias targets, while preserving acceptance of surrounding input whitespace and multi-segment provider paths.
Changes: Model reference validation
| Layer / File(s) |
Summary |
Reject whitespace in references and aliases packages/schema/src/model-alias.ts, packages/core/test/model-alias.test.ts |
Reference parsing and alias resolution reject whitespace within segments, including alias targets and variants. Tests also verify that surrounding input whitespace and multi-segment provider paths remain accepted. |
Priority: Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related issues
Possibly related PRs
Merge Risk: Minimal · up to 77c31
-
The change aligns with the stated whitespace-validation objective and reported test coverage.
Pre-merge checks: 3 · 2
-
Failed checks: 2 warnings
| Check name |
Status |
Explanation |
Resolution |
| Linked Issues check |
 |
Issue #443 requires two coding areas. The OpenCode changes add hasWhitespaceSegment checks in packages/schema/src/model-alias.ts and add model-alias tests for direct inputs, alias targets, nested … |
Add the OpenChamber targetReferenceSpellingProblem and validateTarget whitespace checks, with corresponding tests in model-routes.test.js, or provide a reviewable change that satisfies this part of issue #443. |
| Docstring Coverage |
 |
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
Passed checks: 3 passed
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: the schema now rejects model reference segments that contain internal whitespace. It uses the conventional fix(schema) prefix and is specific. It matches the raw summa… |
| Description check |
 |
The description follows the template structure. It has an issue reference (Fixes #443), a change description that explains the bug and the fix, and a verification section with test results and a typec… |
| Out of Scope Changes check |
 |
The reviewed changes are limited to ModelAlias validation and its automated tests. The changes directly support the OpenCode whitespace-rejection requirements in issue #443. No unrelated change is s… |
Full details: Title check
-
Explanation
The title names the main change: the schema now rejects model reference segments that contain internal whitespace. It uses the conventional fix(schema) prefix and is specific. It matches the raw summary, the objectives, and the linked issue #443.
Full details: Description check
-
Explanation
The description follows the template structure. It has an issue reference (Fixes #443), a change description that explains the bug and the fix, and a verification section with test results and a typecheck result. The 'Type of change' checkboxes are not ticked, and the screenshots section and the 'I have tested my changes locally' and 'not included unrelated changes' checklist items are not marked. These gaps are minor. The description also notes that the OpenChamber port is out of scope, which is useful context.
Full details: Out of Scope Changes check
-
Explanation
The reviewed changes are limited to ModelAlias validation and its automated tests. The changes directly support the OpenCode whitespace-rejection requirements in issue #443. No unrelated change is shown.
Full details: Linked Issues check
-
Explanation
Issue #443 requires two coding areas. The OpenCode changes add hasWhitespaceSegment checks in packages/schema/src/model-alias.ts and add model-alias tests for direct inputs, alias targets, nested model IDs, and slash-containing variants. The linked issue also requires the OpenChamber validator and model-routes.test.js updates. The supplied PR evidence lists only the two OpenCode files, so the OpenChamber requirement is not implemented in this pull request.
Resolution
Add the OpenChamber targetReferenceSpellingProblem and validateTarget whitespace checks, with corresponding tests in model-routes.test.js, or provide a reviewable change that satisfies this part of issue #443.
Finishing Touches: 💡 2
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
🛠️ Fix failing CI checks: 💡
-
- 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate:
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|