GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@dezren39 dezren39 commented Oct 25, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

View with [code]smith Autofix with [code]smith
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
All reactions
  • 👍 1 reaction
@dezren39
fix(schema): reject model reference segments with internal whitespace
77c312a
@github-actions github-actions Bot added the needs:compliance label Oct 25, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 25, 2026

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

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:

  • 🔍 Trigger review

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

  • fix(schema): ModelAlias accepts segments with internal whitespace — resolved refs can never match a model #443 — This change addresses internal whitespace validation in OpenCode references and alias targets. The OpenChamber portion of the issue is not covered here.

Possibly related PRs

  • developing-today/opencode#415 — Adds padded alias-target validation, which this change extends to internal whitespace.
  • developing-today/opencode#410 — Validates malformed provider and variant alias targets, which this change extends to whitespace-containing segments.
  • developing-today/opencode#413 — Rejects empty model alias targets; this change adds whitespace checks to those alias validation paths.
Merge Risk: Minimal · up to 77c31

The change aligns with the stated whitespace-validation objective and reported test coverage.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning 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 Warning 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 Passed checks: 3 passed
Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 25, 2026

Copy link
Copy Markdown

The following comment was made by an LLM, it may be inaccurate:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 25, 2026
fix(tui): footer test fixture missing label/description — typecheck job red on main (TS2739) #447
Closed
fix(tui): give the footer form-draft fixture a label and description #449
Merged
fix(client): generated client is stale — check:generated fails on main (ConfigEntry aliases missing) #450
Closed
chore(client): regenerate generated client for ConfigEntry aliases #451
Merged
@dezren39
chore: merge main into creator/443-internal-whitespace (pick up #447/#…
f09361b
…450/#452 fixes)
@dezren39 dezren39 mentioned this pull request Oct 25, 2026
fix(schema): Model.Ref.parse accepts padded, empty and internal-whitespace segments that ModelAlias rejects — PR #445 leaves the sibling parser unvalidated #456
Closed
4 tasks
@dezren39
dezren39 merged commit f96fd68 into main Oct 25, 2026
14 of 20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the creator/443-internal-whitespace branch October 25, 2026 16:54
This was referenced Oct 25, 2026
docs: ROADMAP Done table omits the #443 and #452 completions (PRs #445, #453) #457
Closed
docs: record the #443 and #452 completions in ROADMAP Done #458
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Oct 25, 2026
fix(schema): reject padded, empty and whitespace segments in Model.Ref.parse #459
Merged
@dezren39 dezren39 mentioned this pull request Oct 26, 2026
ci(dependabot): security updates in uncovered directories still arrive package.json-only and fail frozen-lockfile — PRs #475/#476/#477 unmergeable, electron security fix stranded (recurrence of #196) #480
Closed
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue needs:compliance

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fix(schema): ModelAlias accepts segments with internal whitespace — resolved refs can never match a model

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.