Skip to content

[WRONG BRANCH] fix(omp): allow quoted # in OMP-managed YAML (treat # as comment only outside quotes) - #251

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-quoted-#-in-omp-model-ids
Draft

[WRONG BRANCH] fix(omp): allow quoted # in OMP-managed YAML (treat # as comment only outside quotes)#251
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-quoted-#-in-omp-model-ids

Conversation

@luvs01

@luvs01 luvs01 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The OMP YAML writer conservatively rejected any # byte inside a managed block as an inline comment, which also blocked legitimate generated YAML that contains # inside quoted scalars (for example model IDs or names like "provider/model#variant").
  • This made normal integration refresh/disable operations fail when model IDs or labels include #, creating an availability/integrity problem for OMP-managed blocks.

Description

  • Replace the naive hasInlineComment(line: string) implementation with a scanner that tracks single- and double-quoted YAML scalars and treats # as an inline comment only when it appears outside quotes and after YAML separation whitespace; the scanner also handles escaped double-quote sequences and doubled single quotes. (change in src/integrations/omp-yaml-source.ts).
  • Preserve the conservative refusal behavior for true nested inline comments so user-authored comments are still protected by the writer's safety checks. (existing childEnd / container logic remains guarded.)
  • Add focused regression tests that assert refresh and disable succeed for quoted # scalars while still refusing real nested inline comments. (added test cases in tests/omp-yaml-source-inline-comments.test.ts).

Testing

  • Ran the focused test file with Bun: node_modules/@oven/bun-linux-x64-baseline/bin/bun test tests/omp-yaml-source-inline-comments.test.ts, which passed (4/4 tests passed).
  • Ran typecheck with Bun/tsc: node_modules/@oven/bun-linux-x64-baseline/bin/bun run typecheck, which completed successfully.
  • Attempted a full test run node_modules/@oven/bun-linux-x64-baseline/bin/bun run test; the full suite run exposed unrelated pre-existing failures/timeouts in other tests (lab-live-review regressions and a sideband timeout), so the change was validated with the focused regression and typecheck but a green full-suite run was blocked by unrelated existing failures.

Codex Task

@github-actions github-actions Bot added the bug Something isn't working label Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 50c19c5c-b1f5-4706-b466-38be9f50c645

📥 Commits

Reviewing files that changed from the base of the PR and between 6d881db and e0fdbaf.

📒 Files selected for processing (2)
  • src/integrations/omp-yaml-source.ts
  • tests/omp-yaml-source-inline-comments.test.ts

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

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions github-actions Bot changed the title fix(omp): allow quoted # in OMP-managed YAML (treat # as comment only outside quotes) [WRONG BRANCH] fix(omp): allow quoted # in OMP-managed YAML (treat # as comment only outside quotes) Aug 11, 2026
@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 00:55

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0fdbaf26a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

else quote = null;
continue;
}
if (character === "'" || character === "\"") quote = character;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restrict quote tracking to quoted-scalar starts

When an OMP-managed plain scalar contains an apostrophe or double quote before a real inline comment—for example, name: user's model # keep this note, which is valid YAML—hasInlineComment enters quote mode even though YAML treats that quote as ordinary plain-scalar content. The whitespace-separated # is therefore missed, so refresh or disable proceeds and silently deletes the user-authored comment instead of returning null. Only enter quote state where a quoted scalar can syntactically begin (or use a YAML lexer/CST), and add regression coverage for quoted characters inside plain scalars.

AGENTS.md reference: src/AGENTS.md:L10-L10

Useful? React with 👍 / 👎.

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

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant