Skip to content

🐛 fix(ci): apply all 10 coderabbit findings from #29 - #30

Merged
dianlight merged 2 commits into
mainfrom
opencode/issue29-coderabbit-fixes
Aug 4, 2026
Merged

🐛 fix(ci): apply all 10 coderabbit findings from #29#30
dianlight merged 2 commits into
mainfrom
opencode/issue29-coderabbit-fixes

Conversation

@dianlight

@dianlightdianlight commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Implements all 10 findings from issue #29 (Coderabbit review), keeping changes minimal and preserving existing behavior.

Findings fixed

#FindingFix
F1PREV_BODY could inject newlines/:: into workflow commandsSanitized with PREV_BODY_SAFE (tr '\n' ' ') before ::notice::
F2Retry of a bare /oc (review) routed to process-2 instead of process-3Else-branch now routes to process-3
F3TIER precedence wrong when retrying (parse before retry-parse)Swapped to retry-parse.TIER || parse.TIER
F4pull_request.number unavailable on issue_comment eventsPR number fallback issue.number || pull_request.number in prompts, gh pr checkout, and context
F5Resolve step ran even when process-2 was not applicableGuarded with if: is_bot_thread == 'true'
F6Retry jq queries ignored author_associationAuthor filter (OWNER/MEMBER/COLLABORATOR) added to all 3 retry queries
F7Resolve step ran for draft PRs despite review skip guardGuarded with if: pr-check.skip != 'true'
F8Non-atomic cache download could leave partial configDownload to .tmp + atomic mv (cleanup on failure)
F9Config errors and missing entries were indistinguishableDistinct sys.exit(4) + ::error:: for invalid/unreadable config; exit 3 for missing entry
F10Failed model resolution produced no feedbackcontinue-on-error on resolve + "Resolve model failure feedback" step (comment + -1 reaction + exit 1) in all 5 process jobs

Validation

  • mise run lint-yaml — passed
  • mise run lint-shell — passed
  • bash -n .github/scripts/auth.sh .github/scripts/resolve-model.sh — passed
  • resolve-model.sh exercised end-to-end: valid / missing entry / broken config / unreachable config

Test plan

Manual runs of /oc, /ocf, /oc retry, /ocf retry, /oc implement, /ocf implement, /oc task in downstream repos to confirm routing, tier, and PR-number resolution behave as before.

Summary by CodeRabbit

  • Bug Fixes

    • Improved model configuration handling to prevent incomplete or invalid values after download or parsing failures.
    • Retry handling now recognizes only authorized, human-issued commands and applies safer defaults.
    • Workflow notifications now sanitize multiline command text.
  • User Experience

    • Failed model resolution now provides clear issue or pull request feedback, run details, and a negative reaction.
    • Draft pull requests skip model resolution.
    • Pull request comments are supported from both issue and review comment events.

@dianlightdianlight mentioned this pull request Aug 4, 2026
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dianlight, you've reached your PR review limit, so we couldn't start this review.

Next review available in:32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 61186680-af4d-48f6-9a65-959b7bd8078c

📥 Commits

Reviewing files that changed from the base of the PR and between 29c4571 and 26594a1.

📒 Files selected for processing (3)
  • .github/scripts/resolve-model.sh
  • .github/workflows/opencode-issue-handler.yml
  • .github/workflows/opencode-pr-comment.yml
📝 Walkthrough

Walkthrough

The changes harden remote model configuration downloads and lookup errors. Issue and PR workflows now restrict retry routing, support multiple event shapes, report model-resolution failures, and stop before OpenCode runs.

Changes

Model resolution and workflow failure handling

Layer / File(s)Summary
Resolver cache and validation
.github/scripts/resolve-model.sh
Configuration downloads use temporary files and atomic replacement. Missing or invalid mappings produce an error and exit status 4.
Issue handler retry and failure flow
.github/workflows/opencode-issue-handler.yml
Retry lookup accepts authorized commands, excludes retry commands, sanitizes notices, and adds failure comments and negative reactions for Processes 4 and 5.
PR comment routing and failure flow
.github/workflows/opencode-pr-comment.yml
Retry routing uses authorized human commands and selected tiers. Processes 2, 3, and 6 report resolution failures and support issue-comment and review-comment event data.
PR review draft and failure flow
.github/workflows/opencode-pr-review.yml
Draft PRs skip model resolution. Resolution failures produce PR feedback and terminate the job before OpenCode runs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
participant Workflow
participant resolve-model.sh
participant GitHub
participant OpenCode
Workflow->>resolve-model.sh: resolve model configuration
resolve-model.sh-->>Workflow: model or status 4
Workflow->>GitHub: post failure comment and negative reaction
Workflow-->>OpenCode: stop before invocation
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately identifies the CI fixes and links them to the ten findings addressed in issue #29.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ 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 opencode/issue29-coderabbit-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/scripts/resolve-model.sh:
- Around line 75-82: Update the Python resolver around the workflow/job lookup
and entry output to validate that workflow and job mappings are objects, while
preserving an absent job mapping as an unresolved result. Within the existing
try block, also validate any present go and free values are strings; malformed
mappings or tier values must raise the existing configuration error path and
exit with status 4 before printing model outputs.
In @.github/workflows/opencode-issue-handler.yml:
- Around line 59-67: Paginate each retry-history query with gh api --paginate
and flatten the returned page arrays before applying the existing authorization,
retry-exclusion, and final-comment selection logic. Apply this to
.github/workflows/opencode-issue-handler.yml lines 59-67,
.github/workflows/opencode-pr-comment.yml lines 64-71, and
.github/workflows/opencode-pr-comment.yml lines 430-439; all three sites require
the same change.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b65f6fa-d302-4996-b9fb-0913b9e90abd

📥 Commits

Reviewing files that changed from the base of the PR and between 58ae2bb and 29c4571.

📒 Files selected for processing (4)
  • .github/scripts/resolve-model.sh
  • .github/workflows/opencode-issue-handler.yml
  • .github/workflows/opencode-pr-comment.yml
  • .github/workflows/opencode-pr-review.yml

Comment thread.github/scripts/resolve-model.sh Outdated
Comment thread.github/workflows/opencode-issue-handler.yml
@dianlight
dianlight merged commit 9ccc289 into mainAug 4, 2026
11 checks passed
Sign up for freeto 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

@dianlight