Skip to content

Pin opencode and don't let Bonk push to PRs#6359

Merged
harrishancock merged 2 commits intomainfrom
harris/2026-03-19-bonk-no-push
Mar 19, 2026
Merged

Pin opencode and don't let Bonk push to PRs#6359
harrishancock merged 2 commits intomainfrom
harris/2026-03-19-bonk-no-push

Conversation

@harrishancock
Copy link
Collaborator

Bonk keeps pushing .opencode/package.json updates to our PR branches, and it's getting frustrating. For example:

This PR is an attempt to fix the situation by:

  • Pinning the opencode version used by Bonk workflows using the opencode_version feature introduced in Add OpenCode version pinning support ask-bonk/ask-bonk#144.
  • Deleting the .opencode/package.json file. Now that opencode is pinned in the Bonk workflows, this file should no longer be necessary -- we originally needed it only to work around CI breakages when the main opencode package was published before its associated plugin package.
  • Adding .opencode/package.json and some other files autogenerated by opencode to .gitignore, so Bonk should no longer see them as dirty.
  • Setting Bonk's new-pr-review.yml workflow token_permissions to NO_PUSH, which should prevent it from being able to push, even if it does see a dirty state.
  • Integrating opencode version updating into our weekly deps update workflow.

Bonk (our AI PR reviewer) was committing auto-generated .opencode/package.json
changes to PR branches, causing merge conflicts across PRs. Root cause: opencode
regenerates package.json at startup with the plugin version matching its CLI
version, and in CI the auto-generated .opencode/.gitignore doesn't exist in the
checkout, so git sees the file as dirty.

Three fixes:

1. Pin opencode_version to 1.2.27 in all three Bonk workflows. This prevents
   version drift that would modify package.json, and avoids the partially-
   published-release breakage from ask-bonk/ask-bonk#143.

2. Add .opencode/package.json, bun.lock, and .gitignore to the root .gitignore.
   These are runtime artifacts auto-generated by opencode. The root .gitignore
   is committed (unlike the auto-generated .opencode/.gitignore), so the rules
   work in CI checkouts too.

3. Add token_permissions: NO_PUSH to the auto-reviewer workflow. The reviewer
   prompt already forbids git write ops; this enforces it at the token level.

Also git rm --cached .opencode/package.json to stop tracking it.

Co-Authored-By: Claude <noreply@anthropic.com>
@harrishancock harrishancock requested review from a team as code owners March 19, 2026 13:17
@harrishancock harrishancock force-pushed the harris/2026-03-19-bonk-no-push branch from 5709c2e to 7441b36 Compare March 19, 2026 13:18
Copy link
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR pins the opencode version in Bonk workflows, removes the committed .opencode/package.json, gitignores opencode-generated files, restricts the reviewer workflow to NO_PUSH, and adds an automated version updater.

  1. [LOW] update_opencode_version.py calls sys.exit(1) on npm fetch failure, which will fail the entire deps-updater.yml workflow step and prevent the dependency update PR from being created if npm happens to be unreachable during the weekly cron run. Consider adding continue-on-error: true to that step so a transient npm outage doesn't block the more important dependency updates.

This review was generated by an AI assistant and may contain mistakes.

@harrishancock harrishancock requested review from a team and jasnell March 19, 2026 13:19
@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 19, 2026

Review posted successfully. Here's a summary of my review:

One low-severity finding: The update_opencode_version.py script exits with code 1 on npm fetch failure, which would fail the entire deps-updater.yml workflow and prevent the dependency update PR from being created if npm is unreachable during the weekly cron. I suggested adding continue-on-error: true to that workflow step.

The rest of the PR looks clean -- the version pinning, .gitignore additions, NO_PUSH token restriction, and the update script logic are all sound.

github run

@harrishancock harrishancock requested a review from elithrar March 19, 2026 13:19
New script tools/update_opencode_version.py fetches the latest opencode-ai
version from npm and updates the opencode_version field in all Bonk workflow
files. Integrated into the weekly deps-updater workflow and available as
`just update-opencode` for manual use.

If a new opencode release has a missing @opencode-ai/plugin package (the
issue from ask-bonk/ask-bonk#143), the Bonk CI jobs will fail and the
deps-update PR simply won't be merged.

Co-Authored-By: Claude <noreply@anthropic.com>
@harrishancock harrishancock force-pushed the harris/2026-03-19-bonk-no-push branch from 65c7c21 to c72ad8d Compare March 19, 2026 13:22
@harrishancock
Copy link
Collaborator Author

Force-pushed to squash Bonk's suggestion into my commit, and re-added the tools/update_opencode_version.py script that I accidentally dropped in an earlier rebase.

@harrishancock harrishancock merged commit 7a7288e into main Mar 19, 2026
24 checks passed
@harrishancock harrishancock deleted the harris/2026-03-19-bonk-no-push branch March 19, 2026 14:52
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.

3 participants