Skip to content

fix(opencode): parse model IDs containing spaces - #7834

Open
yeaen wants to merge 1 commit into
pingdotgg:mainfrom
yeaen:parse-space-in-model-id
Open

fix(opencode): parse model IDs containing spaces#7834
yeaen wants to merge 1 commit into
pingdotgg:mainfrom
yeaen:parse-space-in-model-id

Conversation

@yeaen

@yeaen yeaen commented Aug 21, 2026

Copy link
Copy Markdown

What Changed

Update regex to detect opencode models with whitespaces in id.

Before:
my-provider/Kimi K3 model and preceding model my-provider/grok-4.6 missing
shapes at 26-08-21 13 52 00

After:
my-provider/Kimi K3 model and preceding model my-provider/grok-4.6 correctly discovered and included
shapes at 26-08-21 13 53 49

Why

  • Custom provider for opencode has spaces in model ids, ie custom-provider/Kimi K3
  • Whitespaces prevents loading of the whitespaced model and its preceding model

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Parser-only regex tweak with a targeted unit test; no auth, data, or runtime-control changes.

Overview
Fixes OpenCode CLI model inventory so slugs like custom/Kimi K3 are recognized instead of being skipped (which also dropped the following model).

SLUG_LINE_RE now allows spaces in the model-id portion after provider/, and a unit test covers a spaced ID without losing the previous model.

Reviewed by Cursor Bugbot for commit d2f5b9a. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix SLUG_LINE_RE to parse model IDs containing spaces in opencode runtime

Broadens the SLUG_LINE_RE regex in opencodeRuntime.ts so the model segment of a provider/model line may include internal spaces, as long as it does not start or end with whitespace. Adds a test case in opencodeRuntime.cliParsers.test.ts verifying that models with spaces in their IDs are parsed correctly and existing models under the same provider are preserved.

Macroscope summarized d2f5b9a.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 20345228-b180-4ef7-b60f-e800b7eaff91

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 21, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d2f5b9a

Macroscope's review found this PR approvable — Simple bug fix adjusting a regex to allow spaces in model IDs during CLI output parsing. The change is minimal, well-scoped, and includes a test case to verify the fix.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant