Skip to content

Conversation

@justsisyphus
Copy link
Collaborator

@justsisyphus justsisyphus commented Jan 26, 2026

Summary

Make systemDefaultModel optional throughout the plugin, allowing OpenCode's built-in model fallback to work when user doesn't explicitly configure a default model.

Problem

Previously, the plugin threw an error when no default model was configured:

oh-my-opencode requires a default model.

Add this to ~/.config/opencode/opencode.jsonc:

  "model": "anthropic/claude-sonnet-4-5"

However, OpenCode has its own fallback mechanism that automatically picks the best available model when none is specified. The plugin was blocking this behavior unnecessarily.

Changes

Core Changes

  • model-resolver.ts: Made systemDefaultModel optional in types, returns undefined when no model can be resolved
  • config-handler.ts: Removed the entire throw block (lines 108-141) that required a default model
  • delegate-task/tools.ts: Removed the guard that blocked category delegation without systemDefaultModel
  • agents/utils.ts: Removed throw, agents are created only if model resolution succeeds
  • agents/atlas.ts: Made ctx.model optional

Test Updates

  • Added tests for optional systemDefaultModel scenarios
  • Updated existing tests to use non-null assertions where appropriate

Verification

  • bun run typecheck passes
  • All modified test files pass (50+ tests)
  • Backward compatible: if user specifies model, it's used; if not, OpenCode decides

Closes #1129


Summary by cubic

Make the default model optional so OpenCode can use its own fallback when a user doesn’t configure one. This removes hard errors and lets agents and category delegation run without a pre-set model. Closes #1129.

  • New Features
    • Made systemDefaultModel optional in the resolver; returns undefined when no override or fallback is found so OpenCode can pick the model.
    • Removed throws in config-handler, agents/utils, atlas, and delegate-task; Sisyphus and Atlas now use fallback chains and proceed without a default model.
    • Added tests for optional model scenarios and bumped optional oh-my-opencode binaries to 3.1.0.

Written for commit 840a76d. Summary will update on new commits.

- Remove mandatory model requirement from plugin initialization
- Allow OpenCode to use its built-in model fallback when user doesn't specify
- Update model-resolver to handle undefined systemDefaultModel
- Remove throw errors in config-handler, utils, atlas, delegate-task
- Add tests for optional model scenarios

Closes #1129
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 9 files

Confidence score: 5/5

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

@justsisyphus justsisyphus merged commit 3ee519c into dev Jan 26, 2026
8 checks passed
@justsisyphus justsisyphus deleted the feat/optional-default-model branch January 26, 2026 08:01
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.

delegate_task fails with 'oh-my-opencode requires a default model' despite valid model configuration

2 participants