Skip to content

[codex] require OpenCode release summaries#6

Merged
the-Drunken-coder merged 2 commits into
mainfrom
codex/block-opencode-summary-failures
Jun 24, 2026
Merged

[codex] require OpenCode release summaries#6
the-Drunken-coder merged 2 commits into
mainfrom
codex/block-opencode-summary-failures

Conversation

@the-Drunken-coder

@the-Drunken-coder the-Drunken-coder commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix the OpenCode CLI invocation so the release-summary prompt is passed as the message instead of being consumed by --file.
  • Make missing release tag, missing OPENCODE_API_KEY, OpenCode failures, empty summaries, and missing summary files fail the release job.
  • Remove continue-on-error from the OpenCode generation and append steps so npm publish does not proceed when summary generation fails.

Root cause

opencode-ai@1.17.9 run --file accepts an array of files. The previous argument order placed the prompt after --file, so the prompt was parsed as another file path and failed with File not found: Summarize this release diff....

Validation

  • npm test
  • npm pack --dry-run
  • env -u RELEASE_TAG_NAME -u OPENCODE_API_KEY node scripts/summarize-release-diff.mjs exits nonzero as expected

Summary by CodeRabbit

  • New Features

    • Added a changelog to published packages and linked the README to release history.
    • Release notes now include generated OpenCode summaries when available.
  • Bug Fixes

    • Release publishing now fails fast if required release configuration is missing.
    • Empty or failed OpenCode summary generation now stops the release instead of silently passing.
    • Improved release automation reliability by surfacing summary-generation errors during publishing.

Greptile Summary

This PR makes OpenCode release summaries required for publishing. The main changes are:

  • Passes the release-summary prompt before OpenCode options.
  • Fails summary generation when the tag, API key, output, or OpenCode command is missing or empty.
  • Removes non-blocking workflow behavior so publish waits on summary generation and appending.
  • Documents changelog packaging and includes CHANGELOG.md in npm artifacts.

Confidence Score: 3/5

Not yet safe to merge because the required release-summary step can fail under the default configuration.

The workflow hardening is directionally correct, but the default model used by the required summary script is rejected by the configured OpenCode CLI version, blocking releases unless users manually override the model.

scripts/summarize-release-diff.mjs

T-Rex T-Rex Logs

What T-Rex did

  • I reproduced the default model not found failure when OPENCODE_MODEL was unset while running the release summary script for tag v0.1.0 with a dummy API key, and the script exited with status 1 before writing a summary; opencode-ai reported 'Model not found: opencode/kimi-k2'.
  • I captured test-run outputs showing how missing RELEASE_TAG or OPENCODE_API_KEY affected the run, including a stubbed npx failure and differing base/head results around prompt handling.
  • I observed the CI pipeline behavior around continue-on-error and the append script's behavior when opencode-release-summary.md was missing, noting a change from base continue-on-error on to head without continue-on-error and from append exiting 0 to exiting 1.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. scripts/summarize-release-diff.mjs, line 6 (link)

    P1 Fix default model Summary generation is now required before npm publish, but the default opencode/kimi-k2 is rejected by opencode-ai@1.17.9 with Model not found: opencode/kimi-k2. When OPENCODE_MODEL is not set, the release job exits nonzero before publishing even though OPENCODE_API_KEY is configured. Use a currently accepted default model, or fail early with a clear message that OPENCODE_MODEL must be set.

    Artifacts

    Repro: runnable harness for executing the release summary script with OPENCODE_MODEL unset

    • Contains supporting evidence from the run (text/x-shellscript; charset=utf-8).

    Repro: terminal output showing opencode-ai rejects the default opencode/kimi-k2 model

    • Keeps the command output available without making the summary code-heavy.

    View artifacts

    T-Rex Ran code and verified through T-Rex

    Fix in Cursor Fix in Codex Fix in Claude Code

Fix All in Cursor Fix All in Codex Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix: include changelog in npm package" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR converts OpenCode release diff summarization from a best-effort/optional step to a hard requirement. The script now exits with code 1 on missing environment variables or empty output, the workflow removes continue-on-error from both affected steps, and README.md and CHANGELOG.md are added to the npm published files list.

Changes

Release Automation Hardening

Layer / File(s) Summary
Script hard-failure enforcement
scripts/summarize-release-diff.mjs
Missing RELEASE_TAG_NAME or OPENCODE_API_KEY now exits with code 1; spawnSync argument order moves prompt before --file; empty OpenCode response now exits 1 instead of 0.
Workflow enforcement, package files, and docs
.github/workflows/release.yml, package.json, README.md
Removes continue-on-error from both workflow steps and changes the shell guard to exit 1 when opencode-release-summary.md is absent; adds README.md and CHANGELOG.md to the npm files whitelist; README gains a new Changelog section and updated Release Automation wording reflecting the hard requirement.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • the-Drunken-coder/sidc-kit#2: Originally introduced the summarize-release-diff.mjs script and the continue-on-error / OPENCODE_API_KEY handling that this PR directly hardens into a required gate.

Poem

🐇 Hop hop, no more soft landings here,
The release gate stands firm, loud and clear.
If OpenCode fails, the pipeline too,
No sneaky exit 0 slipping through.
CHANGELOG and README ride along for the trip—
A bunny demands a tight-buttoned ship! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: requiring successful OpenCode-generated release summaries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/block-opencode-summary-failures

Comment @coderabbitai help to get the list of available commands.

@the-Drunken-coder the-Drunken-coder marked this pull request as ready for review June 24, 2026 14:32
@the-Drunken-coder the-Drunken-coder merged commit 4468fd1 into main Jun 24, 2026
2 of 3 checks passed
@the-Drunken-coder the-Drunken-coder deleted the codex/block-opencode-summary-failures branch June 24, 2026 14:37
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