Skip to content

fix(omp): allow quoted # in OMP-managed YAML (treat # as comment only outside quotes) - #5787

Merged
lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:fix/omp-quoted-hash
Sep 25, 2026
Merged

lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:fix/omp-quoted-hash

Conversation

@luvs01

@luvs01 luvs01 commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

The OMP managed-YAML patcher treated every # as a comment start, so a model id like "foo#bar" was seen as "foo plus an inline comment — corrupting or refusing managed edits.

The comment scan now carries YAML scalar state: quote mode only opens where a scalar may begin, single/double-quoted strings and multiline continuations keep # as content, sequence items reset scalar state per item, and blank separators before siblings are preserved.

Verification

  • bun test tests/clients/omp-yaml-source-inline-comments.test.ts — 18 pass, covering quoted hashes, plain-scalar continuations, and separator blanks.

Checklist

  • Base is dev
  • Tests updated for the new behavior

luvs01 and others added 4 commits September 25, 2026 03:23
Co-Authored-By: Epinephrine <luvs01@hanmail.net>
…range comment scan

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
…rator blanks

- A '- ' indicator opens a new node: carrying scalarStarted across it made a
  ' #' inside a later quoted item read as a comment and refuse the patch
- A blank after a plain scalar folds only when deeper content follows; a
  shallower next line means the blank is a separator and stays outside the
  leaf range instead of being deleted on refresh/remove

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
@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, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 31b9fa7a-0737-4c8c-b1c9-71794b663b74

📥 Commits

Reviewing files that changed from the base of the PR and between ed181a0 and 782b379.

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

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.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 71 / 80

이 풀리퀘스트는 바탕이 dev예요. OMP가 관리하는 YAML을 고칠 때, 줄에 #가 보이면 전부 주석으로 여기던 처리를 고쳐요. 모델 이름 "foo#bar"처럼 따옴표 안에 있는 #까지 주석으로 보면, 관리 중인 글을 고치다 망가뜨리거나 수정을 거절했어요.

이제는 따옴표가 열릴 수 있는 자리에서만 따옴표 모드로 들어가요. 작은따옴표와 큰따옴표 안의 #는 글자로 남겨요. 여러 줄로 이어진 따옴표, 목록의 다음 칸, 형제 키 앞의 빈 줄도 같이 봐요. 따옴표 밖의 #는 여전히 주석이라서 수정을 거절해요. 사용자 메모는 그 자리에 남아요.

테스트는 tests/clients/omp-yaml-source-inline-comments.test.ts에 더해졌어요. 설명에는 18개 통과라고 적혀 있어요. types.ts와 config.ts는 그대로예요. 같은 내용의 다른 열린 글은 없어요.

헤드 782b379의 함수로 직접 넣어서 봤어요. providers.opencodex 아래에서 따옴표가 다음 줄로 이어지고 그 안에 #가 있으면 수정이 통과해요. 같은 줄에서 "model#variant" # keep처럼 따옴표 뒤에 진짜 주석이 있으면 거절해요. 목록이 다음 줄의 "model # variant"로 이어져도 통과해요.

라인 - scanScalarLine (src/integrations/omp-yaml-source.ts 157행, 이어서 121행과 childEnd 286행) — |와 >를 몰라요. name: |의 |를 보통 글의 시작으로 봐요. 다음 줄 model # variant의 #를 주석으로 보고 수정이 null이 돼요. Bun은 그 글을 값 model # variant로 읽어요. 블록 글 안에 띄어 쓴 #가 있으면 OMP 갱신과 삭제는 그대로 거절돼요.

라인 - locatePath (src/integrations/omp-yaml-source.ts 395–396행) — 키 줄에서 연 따옴표를 childEnd에 넘기지 않아요. childEnd는 다음 줄에서 따옴표가 없는 상태로 시작해요. 고치는 경로가 잎 키 하나이고, 그 키 줄에서 "alpha처럼 따옴표가 열리면, 다음 줄의 #를 주석으로 보고 거절해요. 같은 글이 providers.opencodex의 자식이면 통과해요. 레지스트리의 sourcePreservingYaml은 omp, hermes, dsh 모두 맵 경로라서 지금 호출은 이 경우에 안 들어가요. 테스트도 그 맵 경로만 봐요.

메인테이너의 판단이 필요한 지점

이번 글의 목표가 모델 id의 따옴표 안 #인지, 블록 글(|, >)까지 포함인지 정해 주세요. 블록 글까지 열려면 그 안의 #는 주석이 아니어야 해요. 잎 키 경로는 지금 레지스트리에 없어요. 키 줄의 따옴표 상태를 넘길지는 나중 경로를 보고 정하면 돼요.

너의 추천

넣어도 돼요. 바탕은 dev예요. 닫을 중복 글은 없어요. 따옴표 안의 #와 밖의 주석을 나누는 방향이 맞아요. 주석이 있으면 거절해서 메모가 남아요.

모델 id는 한 줄 따옴표라서, |와 >는 이번 글에서 꼭 막지 않아도 돼요. 블록 글까지 열 거면 그 경우 테스트를 하나 더 두면 좋아요.

이 댓글은 grok-bot이 작성했습니다

@luvs01

luvs01 commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

由щ럭 媛먯궗?⑸땲?? ?대쾲 PR??紐⑺몴 踰붿쐞??紐⑤뜽 id???곗샂????# 泥섎━?대ʼn, 釉붾줉 ?ㅼ뭡??|, >) ?덉쓽 #???섎룄?곸쑝濡?怨꾩냽 二쇱꽍?쇰줈 嫄곗젅???ъ슜??硫붾え瑜?蹂댁〈?섎뒗 履쎌쓣 ?앺뻽?듬땲?? 釉붾줉 ?ㅼ뭡?쇨퉴吏� ?щ뒗 ?뺤옣???꾩슂?댁?硫?蹂꾨룄 ?뚯뒪?몄? ?④퍡 ?꾩냽?쇰줈 ?ㅻ(寃좎뒿?덈떎.

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed exact head 782b3798ff94d16e130e944a32ccf8d1a6718a09. The scanner distinguishes quoted scalar content from comments without treating quote characters inside an already-started plain scalar as delimiters, carries quote/scalar state across owned continuation lines, and resets sequence-item state. The source-preserving parse/semantic comparison remains the final fail-closed guard. Focused bounded suite passed 18/18 under CPUQuota=200%, MemoryMax=4G, swap disabled. The previous Actions run was cancelled rather than test-failed; I re-ran its unsuccessful jobs.

luvs01 commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

Current-head verification follow-up for 782b3798ff94d16e130e944a32ccf8d1a6718a09: the previously cancelled React Doctor job was re-run individually and has now succeeded (https://github.com/lidge-jun/opencodex/actions/runs/36040983790). Cross-platform CI is also successful on this head (https://github.com/lidge-jun/opencodex/actions/runs/36040983711), and the maintainer's exact-head approval is unchanged. No code, tests or review requirements were altered and no merge was performed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun
lidge-jun merged commit 04ba23d into lidge-jun:dev Sep 25, 2026
30 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants