Skip to content

TBN-95 Run the GitHub PR agent on Tabnine OpenCode - #42

Open
sthuck wants to merge 10 commits into
mainfrom
feat/github-opencode-action
Open

sthuck wants to merge 10 commits into
mainfrom
feat/github-opencode-action

Conversation

@sthuck

@sthuck sthuck commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Switch the GitHub composite action and copy-paste workflow from the legacy Tabnine CLI to the OpenCode installer ($TABNINE_HOST/update/opencode/install.sh).
  • Require an explicit Tabnine model (model_id / TABNINE_MODEL_ID), normalize it to tabnine/<slug>, and run tabnine run --model … --auto.
  • Authenticate with TABNINE_TOKEN and GH_TOKEN env vars, isolate OpenCode auth under runner temp, and keep the optional self-hosted uninstall plus summary-comment failsafe.

Test plan

  • Point a test repo at this branch (uses: codota/tabnine-pr-agent@feat/github-opencode-action) with TABNINE_KEY and model_id.
  • Confirm install comes from /update/opencode/install.sh and tabnine --version succeeds.
  • Confirm a PR review posts inline comments and a summary (including the failsafe path if the model does not run gh api).
  • Confirm a bare slug and tabnine/<slug> both work, and a non-Tabnine prefix is rejected.
  • Confirm GitLab and Bitbucket configs are unchanged.

Made with Cursor

The legacy CLI installer and settings.json auth no longer match the OpenCode distribution, so GitHub workflows now install OpenCode, require an explicit Tabnine model, and pass PAT credentials through env vars.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sthuck sthuck changed the title Run the GitHub PR agent on Tabnine OpenCode TBN-95 Run the GitHub PR agent on Tabnine OpenCode Sep 23, 2026
sthuck and others added 3 commits September 23, 2026 10:54
…ner.

install.sh reopens /dev/tty so it can prompt, but [ -r /dev/tty ] only checks
permission bits: on a runner with no controlling terminal the open fails with
ENXIO, which kills dash before anything is installed. Resolve the version and
fetch the platform .run instead; its installer is already non-interactive.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread GitHub/tabnine-review.yml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@sthuck please add the changes to the other git providers (GL, BB)

sthuck and others added 6 commits October 6, 2026 16:21
…d runs.

Stop deleting bot comments before every run. Existing comments are fetched
with gh and passed to the agent, which does a clean review for substantial
changes or a fix review (checking replies and resolutions) when new commits
only address earlier findings. Summaries carry a reviewed-commit marker.
Head commits starting with [skip-review] are not reviewed, and the workflow
cancels in-progress runs for the same PR. Also escape the suggestion fence
in the workflow prompt.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GITHUB_TOKEN gets a 403 from /user. On an HTTP error gh skips --jq and
writes the error body to stdout, so the `|| printf` fallback was appended
to it instead of replacing it. BOT_LOGIN then matched no comment: the
previous summary went unnoticed (clean mode again), the fallback step
posted a duplicate summary, and the cleanup step failed.

Keep gh's output only on success, and log the bot login, matched bot
comments, and review mode so the next run shows the state directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collect Tabnine and OpenCode logs plus agent output when the run fails or
is cancelled, and upload them before temp data is cleaned up. Reword the
review prompt so the agent writes review_mode without reading it first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a debug input (--print-logs --log-level DEBUG), kill the agent after
agent_timeout_minutes (default 20) so failure logs are still collected,
and include the OpenCode session database in the failure artifact.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

2 participants