Repository navigation
Description
Finding (from PR review, never addressed)
delete_top_level_entry in pkgs/opencode-config-normalize/normalize.sh finds the start of a preceding block comment with a plain backward rfind('/*'). When the block comment before the final legacy agent entry itself contains literal /* text — e.g. /* example syntax: /* text */ — the scan selects the delimiter inside the comment rather than its actual opening. The next scan iteration then encounters the remaining comment text and returns None, so normalization exits 1 without repairing the file. The pre-existing regex implementation handled this layout, so previously supported commented configs regressed.
- Raised by: Codex (P2), 2026-11-02T23:05:32Z, on PR fix(opencode-config-normalize): locator-based agent->agents fold (#4612) #4625 (fix(opencode-config-normalize): locator-based agent->agents fold, opencode-config-normalize: agent->agents fold uses layout-bound regex splices — inline/other-indent/comment-lookalike configs exit 1 or silently never converge #4612)
- Comment: fix(opencode-config-normalize): locator-based agent->agents fold (#4612) #4625 (comment) — "Match the actual opening delimiter of block comments" (
pkgs/opencode-config-normalize/normalize.sh:316in the PR diff) - Essence: "Use lexical comment boundaries when locating the preceding separator."
No-response evidence
- The comment was posted in Codex's re-review of the fix commit
5d3396b8b7(2026-11-02T23:05:32Z); PR fix(opencode-config-normalize): locator-based agent->agents fold (#4612) #4625 merged at 2026-11-02T23:05:35Z with no later commit. - GraphQL
reviewThreadsfor PR fix(opencode-config-normalize): locator-based agent->agents fold (#4612) #4625 (checked this run): all 3 threads unresolved; this thread has the single Codex comment and no replies.
Still live on current main (verified 2026-11-03 via gh api raw reads, cross-checked twice)
pkgs/opencode-config-normalize/normalize.sh on main, delete_top_level_entry (line 313):
start = text.rfind('/*', 0, k - 2)The backward scan still picks the nearest /* before the closing */, which is the inner literal when the comment body contains /* — the failure mode Codex described is unchanged.
Dedupe: gh issue list --state all searches for normalize/block-comment/failure-counter terms found no issue tracking this finding (related but distinct: issue #3180 permissions/symlink, issue #4639/#3179/#4612 closed on other defects).
Acceptance criteria
- Separator discovery in the last-entry path uses lexical comment boundaries, so a block comment containing a literal
/*before a final legacyagententry normalizes successfully (and the comment text is preserved, per the file's never-a-data-loss-path rule). - A regression case covering that layout is added to
normalize_test.sh— and its result actually affects the suite exit status (see the companion finding about the failure-counter placement). - Or: a documented decision on this issue explaining why this layout is unsupported, stated explicitly.
Found by the pr-comment-review job from an unaddressed PR review comment.
Activity
dezren39 commentedon Nov 3, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
Merge pull request #4775 from developing-today/queue/6776-4770-block-…
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
_block_comment_start_ending_atlexical scan indelete_top_level_entry; regression case 24; failure gate at suite end (main's opencode-config-normalize: normalize_test.sh checks the failure counter before the final regression case, so comment-before-agent-last can fail and the suite still exits 0 (normalize_test.sh:503) #4771 gate kept, case inserted before it)