Skip to content

fix(gui): distinguish unmapped prompt layers from the unprintable base prompt - #5102

Merged
lidge-jun merged 3 commits into
lidge-jun:devfrom
luvs01:fix/prompt-layer-unmapped
Sep 19, 2026
Merged

lidge-jun merged 3 commits into
lidge-jun:devfrom
luvs01:fix/prompt-layer-unmapped

Conversation

@luvs01

@luvs01 luvs01 commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Prompt layers whose rendered tag is not yet confirmed against live output were reported with reason: "not-exposed". That reason is base-prompt-specific — its copy names the base prompt and model_instructions_file — so an operator opening an unrelated layer read an explanation that does not apply to it. A probe that succeeded but simply has no confirmed mapping for a layer should say exactly that.

Description

  • probePromptText: UNMAPPED_LAYER_IDS now report reason: "unmapped", distinct from the base prompt''s confirmed not-exposed.
  • PromptLayerDialog renders the new reason with its own copy ("no confirmed mapping in the prompt output") in all locales, instead of the base-prompt explanation.

Tests

  • bun test tests/codex-integration/codex-prompt-text-probe.test.ts — 42 pass; new case asserts unmapped layers stay distinct from the unprintable base prompt.
  • bun test tests/codex-integration/codex-prompt-route.test.ts — 76 pass.
  • cd gui && bun test tests/codex-set-prompt-layers.test.tsx — 17 pass; new case asserts the dialog shows the unmapped copy without base-prompt wording.
  • bun run typecheck — clean.

Screenshots

[Prompt layer dialog for an unmapped layer: the no-confirmed-mapping notice without base-prompt wording] (screenshot removed; was hosted on the contributor fork)

Summary by CodeRabbit

  • Bug Fixes

    • Prompt layers without a confirmed mapping now display a dedicated explanation instead of being grouped with unavailable text.
    • The base prompt remains distinguishable from unmapped layers, preserving accurate status information.
  • Localization

    • Added translated messaging for the unmapped-layer state across supported languages.
  • Tests

    • Added coverage confirming correct status reporting and dialog messaging for unmapped layers.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Advanced

Run ID: bb2841ad-b886-45b1-b282-e7701993de24

📥 Commits

Reviewing files that changed from the base of the PR and between 7805f2d and 608ac1f.

📒 Files selected for processing (2)
  • src/codex/prompt-text-probe.ts
  • tests/codex-integration/codex-prompt-route.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The prompt probe now distinguishes unmapped layers from unexposed base prompt text. The prompt layer dialog displays a localized unmapped message. Regression and integration tests cover the behavior.

Changes

Unmapped Prompt Layers

Layer / File(s) Summary
Probe state and coverage
src/codex/prompt-text-probe.ts, tests/codex-integration/*
LayerText.reason now includes "unmapped". Unconfirmed layers use this reason with zero bytes, while the base prompt keeps its existing reason. Integration tests verify the distinction.
Dialog messaging and localization
gui/src/components/codex-set/PromptLayerDialog.tsx, gui/src/i18n/*, gui/tests/codex-set-prompt-layers.test.tsx
The dialog renders codexSet.dialog.unmapped. All listed locale catalogs define the key. The UI test verifies the dedicated message.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 15 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: distinguishing unmapped prompt layers from the unprintable base prompt. It matches the implementation and test changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

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

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • UI screenshot required.

What to do

  • Add a screenshot of the UI change to the PR description.

Automatic draft conversion failed (token cannot change draft status). Please convert this pull request to a draft manually. The required enforce-target check will keep failing until every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as ready for review September 19, 2026 06:20
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 72 / 80

이 PR은 프롬프트 레이어 창이 엉뚱한 이유를 보여주던 문제를 고칩니다. 프로브는 성공했는데, 아직 확인된 태그가 없는 레이어는 reason: "not-exposed"를 받았습니다. 그 이유는 기본 프롬프트 전용입니다. 창 문구는 기본 프롬프트가 메시지 목록 밖으로 지나가고, model_instructions_file로 바꿀 수 있다고 말합니다. 성격이나 도구 레이어를 연 사람은 자기 레이어와 상관없는 설명을 읽게 됩니다. 이제 UNMAPPED_LAYER_IDS는 reason: "unmapped"를 넣고, 창은 "확인된 매핑이 아직 없다"는 문장을 열 개 언어로 보여줍니다. 이미 매핑된 레이어는 ??= 때문에 덮어쓰지 않습니다. 기본 프롬프트의 not-exposed는 그대로입니다.

베이스는 dev입니다. types.ts와 config.ts 분리와는 관계가 없습니다. 지금 dev tip은 e668aa1f입니다. 제목은 fix(cursor): state the T04 re-arming contract on an injectable clock (#5131)이고, 시각은 2026-09-19 18:15 KST입니다. 이 head는 그 tip과 충돌이 없습니다. Draft가 아닙니다. 리뷰가 없어서 머지 버튼은 막혀 있습니다. 이 head에서 끝난 검사는 위생, 라벨, 타깃 브랜치, CodeRabbit입니다. Cross-platform CI와 React Doctor는 포크 PR 승인 대기라 원격 테스트는 아직 안 돌았습니다. 작성자는 로컬에서 probe 42개, route 76개, GUI 17개, typecheck가 통과했다고 적었습니다.

라인 src/codex/prompt-text-probe.ts:78 - git-attribution 주석이 아직 "not exposed라고 보고한다"고 적혀 있습니다. 바로 아래 코드는 reason: "unmapped"를 넣습니다. 주석만 보면 그 레이어가 여전히 not-exposed인 줄 알 수 있습니다.

라인 src/codex/prompt-text-probe.ts:106 - LayerText.reason은 이제 여섯 값인데 주석은 다섯 값이라고 합니다. 377행의 "five coarse reasons"도 같은 숫자입니다. 377행 함수는 여전히 ok, not-exposed, unavailable만 내보내므로 동작은 안 바뀝니다.

라인 tests/codex-integration/codex-prompt-route.test.ts - 41번 테스트는 라우트를 호출하지 않고, 소스 파일에 "unmapped" 글자가 있는지만 확인합니다. 실제 동작은 tests/codex-integration/codex-prompt-text-probe.test.ts가 봅니다. 막지는 않습니다.

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

  • 틀린 주석을 머지 전에 고칠지, 후속으로 둘지
  • 포크 CI를 승인하지 않고 작성자의 로컬 테스트 기록만으로 넣을지

너의 추천
동작은 맞습니다. 매핑이 없는 레이어와 기본 프롬프트를 나눈 좁은 수정이고, GUI 테스트가 기본 프롬프트 문구가 안 나오는 것까지 확인합니다. 주석은 고치면 더 낫지만, 없어도 머지를 막을 이유는 아닙니다. 원격 CI는 아직 안 돌았습니다. 로컬 결과를 받아들이면 머지하세요. 로컬 스위트는 돌리지 마세요.

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

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 54 / 80

프롬프트 레이어 창을 열면, 프로브는 성공했는데 그 레이어의 태그를 아직 확인하지 못한 경우에도 기본 프롬프트용 설명이 나왔다. 문장은 "기본 프롬프트는 메시지 목록 밖으로 가서 여기 안 보인다. model_instructions_file로 바꿀 수 있다"이다. personality나 tools처럼 기본 프롬프트가 아닌 레이어를 연 사람에게는 틀린 안내였다.

이 PR은 그 경우를 새 이유 unmapped로 나눈다. 서버는 UNMAPPED_LAYER_IDS에 텍스트가 없을 때 not-exposed 대신 unmapped를 넣는다. 대화창은 그 이유만 "프롬프트 출력에 확인된 매핑이 없다"로 보여 준다. 열 개 언어에 문장을 넣었다. 기본 프롬프트의 not-exposed는 그대로다. 베이스는 dev다. types.ts/config.ts 나누기와는 관계없다. 지금 보이는 체크(enforce-target, hygiene, label, resolve-pr)는 통과다.

src/codex/prompt-text-probe.ts UNMAPPED_LAYER_IDS git-attribution 주석 - 아직 "not exposed라고 보고한다"고 적혀 있다. 이 PR 이후 그 id는 unmapped다
LayerText 주석 - "이유가 다섯 개"라고 적혀 있다. unmapped가 들어가 여섯 개다. promptLayerForBase 주석의 "five coarse reasons"도 같은 숫자다. 그 함수가 내는 값은 여전히 ok / not-exposed / unavailable뿐이다
tests/codex-integration/codex-prompt-route.test.ts 테스트 41 - 라우트를 호출하지 않고 소스 문자열만 찾는다. 동작은 codex-prompt-text-probe.test.ts가 확인한다
probePromptText의 ??= - 이미 채워진 레이어는 덮지 않는다. 맞다
PromptLayerDialog - unmapped를 not-exposed보다 먼저 본다. 기본 프롬프트 문장이 다른 레이어로 새지 않는다

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

  • 주석(not exposed, 이유 다섯 개)을 이 PR에서 고칠지
  • git-attribution을 unmapped 목록에 계속 둘지. 주석은 "이번 턴에 안 나왔다"는 DIFF 이야기도 한다. 확인된 태그가 없으면 unmapped가 더 작은 주장이다

너의 추천
동작은 맞다. 주석만 코드와 어긋난다. 주석을 고치면 더 낫고, 안 고쳐도 사용자에게 보이던 틀린 안내는 막힌다. 보이는 체크가 이미 통과했으니 merge해도 된다. types/config 스플릿으로 닫을 PR이 아니다.

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

@github-actions
github-actions Bot marked this pull request as draft September 19, 2026 11:28
…e prompt

UNMAPPED_LAYER_IDS reused the base prompt's not-exposed reason, so the dialog showed a base-prompt-specific explanation (model_instructions_file) for unrelated layers. Give them a distinct unmapped reason, render dedicated copy in the read-only dialog, and localize it across all ten locales.
@lidge-jun
lidge-jun force-pushed the fix/prompt-layer-unmapped branch from 608ac1f to 2298006 Compare September 19, 2026 12:39
@lidge-jun
lidge-jun marked this pull request as ready for review September 19, 2026 12:49
@github-actions
github-actions Bot marked this pull request as draft September 19, 2026 12:58
@lidge-jun
lidge-jun marked this pull request as ready for review September 19, 2026 13:08
@lidge-jun
lidge-jun merged commit 45a5ca5 into lidge-jun:dev Sep 19, 2026
27 of 29 checks passed
@luvs01
luvs01 deleted the fix/prompt-layer-unmapped branch September 19, 2026 20:24
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.

2 participants