anomalyco / anomalyco/opencode

GitHub agent: summary commit is not conventional-commit-safe; failed hook turns a completed review into a failed run

Open
#49,754 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

What happens

When opencode/github runs an agent on a PR (comment-triggered review), and the agent leaves the working tree dirty, the wrapper:

  1. Asks the agent: "Summarize the following in less than 40 characters" (the full review answer)
  2. Commits everything as git commit -m "<summary>" -m "Co-authored-by: <actor>@users.noreply.github.com"
  3. Pushes

The summaries the model produces are natural sentences — "Approve: solid port, tests pin behavior", "Solid PR, but brreg left out of the retry/CI fix." — not Conventional Commits. Any repo with a commitlint/commit-msg hook rejects them:

✖   type must be lower-case [type-case]
✖   type must be one of [build, chore, ci, docs, feat, fix, ...] [type-enum]
husky - commit-msg script failed (code 1)

The review itself completed fine (and its text is then posted only to the run log or an error comment), but the workflow run is reported failure. Observed twice in one week:

  • run 35273369797 (dotlegal-compliance/dotlegal-mcp, 2026-09-17): review verdict "Approve", commit rejected
  • run 35322806369 (same repo, 2026-09-18): same pattern, second subject form also rejected (subject may not end with full stop)

Why this matters

A bot review that succeeded reports as a red ❌ run. Anything keying on run conclusion (our reviewctl wait returns .conclusion) sees failure for a successful review, and the review text can end up stranded in an error comment instead of a review comment.

Suggested directions

  1. Hook-aware fallback: if the commit-msg hook rejects the generated summary, retry with a synthetic conventional message (chore: opencode agent review (<pr-number>)) or skip the commit/push entirely and let the review live as a comment only.
  2. Configurable summary prompt: let the repo supply a commit-message template/prompt so generated summaries can be guaranteed conventional.
  3. Document the interaction: if neither, document that repos with strict commit-msg hooks must instruct the agent (via AGENTS.md) to leave the tree clean — we have done exactly that as a workaround (dotlegal-mcp PR #14).

Environment

  • opencode 1.18.31 (current latest)
  • GitHub workflow: anomalyco/opencode/github@latest, reusable-workflow setup with named agent, comment-triggered (issue_comment / pull_request_review_comment)
  • Repo: private monorepo, husky + commitlint (@commitlint/config-conventional), lint-staged on pre-commit (passes — the rejection is commit-msg only)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the opencode/github wrapper path that summarizes the review, commits the dirty working tree, and pushes it. Reproduce the failure with a repository using a commit-msg hook such as commitlint, then verify that a completed review remains successful and its text is posted appropriately when the generated summary is rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, typescript
Domain
ci-cd, devops, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.