Skip to content

fix(opencode-config-normalize): match actual block-comment opener in last-entry separator scan (#4770) - #4775

Merged
dezren39 merged 2 commits into
mainfrom
queue/6776-4770-block-comment-separator
Nov 3, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/6776-4770-block-comment-separator

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #4770.

What

delete_top_level_entry in normalize.sh located a preceding block comment with a plain backward rfind('/*'), which selects an inner literal /* inside the comment body (e.g. /* example syntax: /* text */) instead of the real opening delimiter. The scan then failed closed with exit 1 on a previously supported commented layout before a final legacy agent entry.

Change

  • normalize.sh: new _block_comment_start_ending_at helper — a forward lexical scan (string- and //-aware) finds the comment closing exactly at the scan point. Replaces the rfind in the last-entry separator loop.
  • normalize_test.sh: regression case 24 (inner-/* block comment before final agent, comment text asserted byte-identical), and the failure-count gate moved to the end of the file so every case — including the previously ungated comment-before-agent-last case — affects the suite exit status.

Verification

  • Reproduced on origin/main \Μ΅f1577891e: fixture exits 1, file byte-identical.
  • After fix: exit 0, fold correct, comment preserved byte-identical; full suite 25/25 PASS.
  • Negative checks: old code exits 1 on the new fixture; injected suite failure exits 1.

Queue task 6776 (repo-worker-code, openchamber scheduled lane 8ac61616).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…last-entry separator scan (#4770)

delete_top_level_entry located the preceding block comment with a plain
backward rfind('/*'), which selects an inner literal /* inside the
comment body (e.g. /* example syntax: /* text */) instead of the real
opening delimiter, failing closed with exit 1 on a previously supported
commented layout. Use a forward lexical scan for the comment closing
exactly at the scan point, so string contents and // comments never
open a block comment.

Also add the regression case and move the suite failure gate to the end
of normalize_test.sh so every case affects the exit status.
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 06:05
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T06:06:00.666341Z
We couldn’t complete this review. Comment @codex review to try again.
c3fb054 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed6c12ca-b461-4e83-8014-71959fa06ff2
Commits

Reviewing files that changed from the base of the PR and between 990f5c3 and ae7e46b.

Files selected for processing: 2
  • pkgs/opencode-config-normalize/normalize.sh
  • pkgs/opencode-config-normalize/normalize_test.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39

dezren39 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · pr opened

…-comment-separator

# Conflicts:
#	pkgs/opencode-config-normalize/normalize_test.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant