GeezerVison is showing github.com — fix(core): expand bare model aliases in the session runner by dezren39 · Pull Request #390 · developing-today-forks/opencode
Conversation
dezren39
commented
Oct 24, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #385
Problem
PR #382 (Drew's, still open) makes the CLI pass a bare model alias through as { providerID: "flash", id: "" }, and fixes ModelResolver.resolve to expand it — but the path a CLI session actually runs through, SessionRunnerModel.resolve, still built the alias reference as `${providerID}/${id}`, producing "flash/". ModelAlias.resolveRef throws on the trailing slash, the throw is swallowed, and the run fails with Model unavailable: flash/.
Solution
packages/core/src/session/runner/model.ts: when the target's model id is empty, build the alias reference from the alias name alone — flash, or flash#<variant> when the target carries a variant — mirroring the construction PR fix(cli,core): resolve bare model aliases through the server path #382 adds to ModelResolver.resolve (and preserving the variant, which a provider-only string would drop). Non-empty targets are unchanged. This PR does not touch any file PR fix(cli,core): resolve bare model aliases through the server path #382 touches, so the two merge in either order.
ModelUnavailableError with an empty model id now renders Model unavailable: flash — the original user input — instead of flash/.
- The runner's
layer is now exported, matching ModelResolver.layer, so the service can be driven in tests.
Tests
New packages/core/test/session-runner-model.test.ts drives the real SessionRunnerModel service (mocked catalog/config/resolver dependencies, following generate.test.ts):
- a bare-alias target
{ providerID: "flash", id: "" } with flash → deepseek/deepseek-chat#high configured resolves to the catalog model with variant high;
- a bare-alias target carrying its own variant expands the same way;
- an unknown bare name fails with
Model unavailable: nope (not nope/).
Pre-fix all 3 fail (including the exact Model unavailable: nope/ message); post-fix 3/3 pass. Neighbouring suites pass: model-resolver.test.ts + config/aliases-normalize.test.ts + config/model.test.ts 58/58. Prettier clean on both changed files.
Note: GitHub Actions is still creating no runs repo-wide (#365), so verification is local.
![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
- Bare provider aliases now resolve with their configured variant, and aliases targeting a provider and model resolve to the intended model.
- Errors for unavailable models with an empty model ID now show the provider without a trailing slash.
- Unknown bare model inputs continue to report the original input in the error message.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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-24T14:14:39.239127Z |
48f234c |
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.
coderabbitai
Bot
commented
Oct 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 11 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
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:
b463ddd8-e015-4300-b82c-712b49630274
Commits
-
Reviewing files that changed from the base of the PR and between bd51c78 and 48f234c.
Files selected for processing: 1
-
packages/core/test/session-runner-model.test.ts
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:
fedda7fa-d971-4534-93cb-8c4db2c82beb
Commits
-
Reviewing files that changed from the base of the PR and between 977ff07 and bd51c78.
Files selected for processing: 2
-
packages/core/src/session/runner/model.ts
packages/core/test/session-runner-model.test.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
-
The session runner now resolves bare provider aliases with empty model IDs, retains optional variants, and reports unknown bare inputs in ModelUnavailableError without a trailing slash.
Changes: Session runner alias resolution
| Layer / File(s) |
Summary |
Resolve bare aliases and validate results packages/core/src/session/runner/model.ts, packages/core/test/session-runner-model.test.ts |
Alias reference construction uses the provider ID alone when the model ID is empty and retains an optional variant. layer is now exported. Tests cover configured aliases, variants, and unknown inputs. |
Priority: Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: kitlangton
Merge Risk: Minimal · up to bd51c
-
No actionable issue remains; the change is ready to merge after normal checks.
Pre-merge checks: 5
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly identifies the main change: expanding bare model aliases in the session runner. |
| Description check |
 |
The description is detailed and on-topic. It identifies issue #385, explains the problem and solution, lists the tests and verification results, and notes the CI limitation. The template checkboxes an… |
| Linked Issues check |
 |
The changes satisfy the coding requirements in [#385]. SessionRunnerModel.resolve now builds flash or flash#<variant> for an empty model ID, so configured aliases can expand. The new session-run… |
| Out of Scope Changes check |
 |
The changes stay within [#385]. The ModelUnavailableError message fixes the required empty-ID error. Exporting layer supports the required service-level tests. The added test file verifies the ses… |
| Docstring Coverage |
 |
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2… |
Full details: Description check
-
Explanation
The description is detailed and on-topic. It identifies issue #385, explains the problem and solution, lists the tests and verification results, and notes the CI limitation. The template checkboxes and UI screenshot section are not completed, but they are non-critical for this non-UI change.
Full details: Linked Issues check
-
Explanation
The changes satisfy the coding requirements in [#385]. SessionRunnerModel.resolve now builds flash or flash#<variant> for an empty model ID, so configured aliases can expand. The new session-runner tests cover alias expansion without and with a variant. The unknown-name test expects Model unavailable: nope. The PR reports that the existing model-resolver, model-alias, and aliases-normalize tests pass.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within [#385]. The ModelUnavailableError message fixes the required empty-ID error. Exporting layer supports the required service-level tests. The added test file verifies the session-runner behavior. No unrelated change is shown.
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.
Finishing Touches
-
📝 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd51c78ce7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
import { Provider } from "@opencode/core/provider"
|
|
|
import { SessionSchema } from "@opencode/core/session/schema"
|
|
|
import { SessionRunnerModel } from "@opencode/core/session/runner/model"
|
|
|
import { Info as ConfigInfo } from "@opencode/schema/config"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the renamed ConfigInfo import
The new Info as ConfigInfo value import violates the explicit no-import-alias rule in AGENTS.md; the exception for unavoidable type-only collisions does not apply here. Use the already imported Model namespace for Model.Info, freeing the unaliased Info name for the configuration schema.
AGENTS.md reference: AGENTS.md:L83-L84
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Test strengthened in 48f234c (sweep follow-up): the bare-alias variant case now uses a target variant (low) that differs from the alias target's variant (flash -> deepseek/deepseek-chat#high) and asserts the full resolved ref, so it actually distinguishes preservation from replacement — the gap #391 flagged in this PR's own test.
Verified locally: session-runner-model 3/3; ablation with the variant dropped from the ref construction (provider-only string) fails exactly that one test; neighbouring suites (model-resolver + aliases-normalize + config/model) 58/58, 61/61 combined; prettier clean.
On #391: the ModelResolver half cannot land in this PR — the empty-id branch it would fix exists only in PR #382 (Drew's, hands-off, still open), and this PR deliberately touches no file #382 touches so the two merge in either order. The ModelResolver-side fix + a both-resolvers test is recorded as a SET-REMAINDER gated on #382 merging.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 24, 2026
This was referenced Oct 25, 2026
Reviewers
1 more reviewer
Reviewers whose approvals may not affect merge requirements
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.
|