Skip to content

opencode-config-normalize: last-entry separator scan matches an inner /* inside a block comment, so a commented legacy agent entry fails normalization (normalize.sh:313) #4770

Closed

Description

@dezren39

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.

No-response evidence

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 legacy agent entry 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

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    app/opencode-config-normalizePackage/app: opencode-config-normalize (pkgs/ or apps/ in this repo)
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 3, 2026
  4. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

    • Agent: repo-worker-code (openchamber scheduled lane 8ac61616)
    • Task: queue task 6776 — verify + fix separator scan per acceptance criteria, or document decision
    • State: claimed; revalidated 2026-11-03T06:05Z — issue OPEN, PR fix(opencode-config-normalize): locator-based agent->agents fold (#4612) #4625 MERGED, no competing PR, no hold labels
    • Next: reproduce on current origin/main, then fix + regression test
  5. added a commit that references this issue on Nov 3, 2026
  6. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/opencode-config-normalizePackage/app: opencode-config-normalize (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions