Skip to content

test(openai-chat): align dangling barriers with role folding - #5343

Closed
Ingwannu wants to merge 1 commit into
devfrom
fix/dangling-toolcalls-folded-developer-role
Closed

Ingwannu wants to merge 1 commit into
devfrom
fix/dangling-toolcalls-folded-developer-role

Conversation

@Ingwannu

@Ingwannu Ingwannu commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • update the three dangling-toolcall barrier assertions to the generic OpenAI Chat destination contract introduced on current dev
  • keep the original developer-role input so the tests still prove the adapter folds unsupported developer roles to system
  • preserve every existing ordering, tool-call pairing, and synthetic-result assertion

Why

Current dev folds developer to system when an OpenAI Chat destination does not explicitly advertise developer-role support. The dangling-toolcall hardening tests still expected the pre-change wire role, causing test 3/4 to fail on dev and on otherwise unrelated PRs such as #5338.

This is test-contract repair only; it does not change runtime behavior.

Validation

Run with isolated HOME, CODEX_HOME, and OPENCODEX_HOME:

  • bun test tests/adapters/openai/openai-chat-dangling-toolcalls.test.ts — 9 pass, 0 fail
  • git diff --check — clean

Integration note

No Go counterpart is required: this changes only a TypeScript adapter regression test, and the repository currently has no remote dev2-go branch despite the stale transition wording in MAINTAINERS.md.

Summary by CodeRabbit

  • Tests
    • Updated OpenAI chat adapter test expectations for developer-message serialization.
    • Adjusted test coverage to reflect corrected ordering around tool results.

@Ingwannu
Ingwannu requested a review from lidge-jun as a code owner September 20, 2026 13:11
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 20, 2026
@coderabbitai

coderabbitai Bot commented Sep 20, 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: 05ab5930-d290-4610-8e23-4791c9e49a88

📥 Commits

Reviewing files that changed from the base of the PR and between 600075d and c16b719.

📒 Files selected for processing (1)
  • tests/adapters/openai/openai-chat-dangling-toolcalls.test.ts

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


📝 Walkthrough

Walkthrough

The OpenAI dangling-tool-call tests now document and verify that generic provider configuration serializes developer barriers as system messages while preserving repaired message ordering.

Changes

OpenAI message serialization tests

Layer / File(s) Summary
Update serialization expectations
tests/adapters/openai/openai-chat-dangling-toolcalls.test.ts
The test documentation states that generic destinations lack native developer-role support. T1, T5, and T6 now expect the injected guidance, pending-call barrier, and deferred barrier as system messages.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the test-only change: updating OpenAI chat dangling-toolcall barrier expectations to match developer-to-system role folding. It is concise, specific, and related to the mai…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

@Ingwannu

Copy link
Copy Markdown
Owner Author

Folded this test-only repair into #5338 as 4d427602b2 to break the CI dependency cycle: #5338 needed these current-dev assertions, while this branch needed #5338 unsigned macOS bundle override. The focused isolated test and CodeRabbit review were green here; replacement exact-head CI now runs on #5338. Closing this duplicate without merging.

@Ingwannu Ingwannu closed this Sep 20, 2026
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 22 / 80

이 PR은 OpenAI Chat 어댑터의 “dangling tool_calls” 회귀 테스트 세 곳에서, 와이어로 나가는 barrier 역할 기대를 developer에서 system으로 바꿉니다. 입력은 그대로 developer(...)로 넣어서, 개발자 역할을 지원한다고 광고하지 않는 일반 Chat 목적지에서는 어댑터가 developer를 system으로 접는다는 계약만 맞춥니다. 순서·tool_call 짝·합성 결과 단언은 건드리지 않았고, 런타임 코드 변경은 없습니다. base는 dev이고 방향은 맞습니다. 다만 작성자가 같은 수정을 #5338에 4d427602b2로 넣고 이 PR은 이미 닫았습니다. 지금 dev에는 예전 developer 기대가 아직 남아 있어, 살아 있는 착륙 경로는 #5338입니다.

tests/adapters/openai/openai-chat-dangling-toolcalls.test.ts - 세 barrier 기대값(injected guidance, barrier while call_1 pending, deferred barrier)은 모두 system으로 맞춰졌고, 입력 helper는 developer를 유지합니다. 이 파일만 보면 계약 수리로 충분합니다. 문제는 이 브랜치 자체가 더 이상 merge 대상이 아니라는 점입니다. 같은 diff가 #5338에 들어가 있으니, 여기서 다시 열거나 따로 머지하면 중복이 납니다.

PR 상태 - closed(미머지)입니다. CI나 head SHA c16b719c…를 이 번호로 다시 추적할 필요는 없습니다. 같은 테스트가 #5338에서 초록인지만 보면 됩니다.

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

이 이슈를 #5338 하나로만 관리할지, 아니면 닫힌 #5343을 문서/링크용으로만 남겨둘지 정하면 됩니다. types.ts/config.ts 분할이나 미리보기 배포와는 무관합니다. 같은 테스트 수리의 열린 중복은 #5338이 유일합니다.

너의 추천

이 PR은 닫힌 채로 두세요. 같은 패치는 #5338에서 리뷰·머지하세요. dev에 예전 developer 와이어 기대가 남아 있으니, #5338이 들어가기 전에는 그 테스트가 다른 PR CI를 계속 깨뜨릴 수 있습니다. 추가 코드 수정은 이 번호로는 하지 마세요.

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

@lidge-jun
lidge-jun deleted the fix/dangling-toolcalls-folded-developer-role branch September 26, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants