Skip to content

Add OpenCode provider support for discover#417

Open
vadika wants to merge 2 commits intortk-ai:masterfrom
vadika:feat/discover-opencode-provider
Open

Add OpenCode provider support for discover#417
vadika wants to merge 2 commits intortk-ai:masterfrom
vadika:feat/discover-opencode-provider

Conversation

@vadika
Copy link

@vadika vadika commented Mar 8, 2026

Summary

  • add a new OpenCode session provider for rtk discover that reads command history from ~/.local/share/opencode/opencode.db (with OPENCODE_DB_PATH override)
  • add --provider auto|claude|opencode to rtk discover and make auto prefer OpenCode when available
  • improve discover signal quality by ignoring multiline/comment script snippets and normalizing absolute RTK binary paths (for example: /home/user/.cargo/bin/rtk ...) before classification

Validation

  • cargo check
  • cargo test test_classify_ -- --nocapture
  • cargo run --quiet -- discover --provider opencode --all --since 30 --limit 5 --format text

Notes

  • this preserves existing Claude behavior while enabling OpenCode-first workflows without requiring Claude session logs

wouter-intveld added a commit to wouter-intveld/rtk that referenced this pull request Mar 10, 2026
Add rtk init --opencode to install an OpenCode plugin that
transparently rewrites bash commands via the tool.execute.before
hook, equivalent to the existing Claude Code PreToolUse hook.

The plugin is embedded in the binary and written to
~/.config/opencode/plugins/opencode-rtk.js on install.

Complements rtk-ai#417 (OpenCode discover provider).
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