Skip to content

Conversation

@ghtndl
Copy link

@ghtndl ghtndl commented Jan 27, 2026

  • Add uiSelectedModel parameter to resolveModelWithFallback()
  • Update model resolution priority: UI Selection → Config Override → Fallback → System Default
  • Pass config.model as uiSelectedModel in createBuiltinAgents()
  • Fix ProviderModelNotFoundError when model is unset in config but selected in UI

Summary

  • Fix Sisyphus and other agents ignoring UI model selection when model is not set in config
  • Prevent ProviderModelNotFoundError crash when user selects model in OpenCode UI but config has no model override

Changes

  • src/shared/model-resolver.ts: Add uiSelectedModel parameter to ExtendedModelResolutionInput type and resolveModelWithFallback() function. UI selection now takes highest priority (Step 1) in model resolution chain.
  • src/agents/utils.ts: Add uiSelectedModel parameter to createBuiltinAgents() and pass it to all resolveModelWithFallback() calls for Sisyphus, Atlas, and other agents.
  • src/plugin-handlers/config-handler.ts: Pass config.model (OpenCode's active model including UI selection) as uiSelectedModel to createBuiltinAgents() and Prometheus model resolution.
  • src/shared/model-resolver.test.ts: Add test cases for UI model selection priority, including edge cases for empty/whitespace values.

Screenshots

N/A - Backend logic change, no UI modifications.

Testing

bun run typecheck
bun test model-resolver
bun run buildManual testing:

  1. Start OpenCode with oh-my-opencode plugin
  2. Select a model in OpenCode UI (e.g., opencode/some-model)
  3. Do NOT set model in oh-my-opencode.json config
  4. Send a message - Sisyphus should now use the UI-selected model instead of throwing ProviderModelNotFoundError

Related Issues

#959


Summary by cubic

Fixes agents ignoring the model chosen in the OpenCode UI by making UI selection the top priority. Prevents ProviderModelNotFoundError when config has no model.

  • Bug Fixes
    • Added uiSelectedModel to resolveModelWithFallback and createBuiltinAgents.
    • Updated resolution order: UI selection → config override → provider fallback → system default.
    • Passed OpenCode’s active model (config.model) as uiSelectedModel for Sisyphus, Atlas, and Prometheus.
    • Added tests for UI priority and empty/whitespace edge cases.

Written for commit 01dd899. Summary will update on new commits.

- Add uiSelectedModel parameter to resolveModelWithFallback()
- Update model resolution priority: UI Selection → Config Override → Fallback → System Default
- Pass config.model as uiSelectedModel in createBuiltinAgents()
- Fix ProviderModelNotFoundError when model is unset in config but selected in UI
@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@ghtndl
Copy link
Author

ghtndl commented Jan 27, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 27, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant