Skip to content

feat: integrate opencode CLI provider with automatic model fallback a…#37

Open
fcmiranda wants to merge 1 commit intom7medVision:mainfrom
fcmiranda:feature/opencode-support
Open

feat: integrate opencode CLI provider with automatic model fallback a…#37
fcmiranda wants to merge 1 commit intom7medVision:mainfrom
fcmiranda:feature/opencode-support

Conversation

@fcmiranda
Copy link
Copy Markdown

feat: integrate opencode CLI provider with automatic model fallback and update configuration workflows

Summary

This PR adds opencode as a first-class provider for commit message and PR title generation, makes it the default provider, and updates config and docs to support CLI-based workflows without API keys.

Main Features

  • Added new opencode provider integration for both commit and pr commands.
  • Implemented automatic model fallback for opencode execution:
    • Tries configured primary model first.
    • Falls back through configured free-model candidates if a model fails.
  • Switched default provider to opencode in configuration defaults.
  • Added provider-level fallback_models support in config schema.
  • Updated interactive config flow to:
    • Include opencode as a selectable provider.
    • Skip API key and endpoint prompts for CLI-backed providers (anthropic, gemini, opencode).
    • Support opencode model selection and num_suggestions.
  • Expanded provider model catalog with opencode free model entries.
  • Added tests for opencode model candidate normalization and deduplication.
  • Updated README with:
    • New provider list and default behavior.
    • opencode setup guidance and troubleshooting note.

Files Changed

  • README.md
  • cmd/commit.go
  • cmd/config.go
  • cmd/pr.go
  • internal/config/config.go
  • internal/provider/models/models.go
  • internal/provider/opencode.go
  • internal/provider/opencode_test.go

Why

  • Provides a zero-API-key default path using the opencode CLI and free models.
  • Improves resilience by retrying across fallback models when the first choice fails.
  • Aligns configuration UX with CLI-backed provider behavior.

Notes

  • opencode CLI must be installed and authenticated for default flow.
  • Existing non-CLI providers remain available (copilot, openai, anthropic, gemini).

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