Skip to content

fix(responses): normalize Posit tool continuations - #2674

Merged
lidge-jun merged 1 commit into
devfrom
ingw/fix-posit-responses-continuation-2648
Aug 27, 2026
Merged

fix(responses): normalize Posit tool continuations#2674
lidge-jun merged 1 commit into
devfrom
ingw/fix-posit-responses-continuation-2648

Conversation

@Ingwannu

@Ingwannu Ingwannu commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • normalize Posit Assistant Responses continuations only at the canonical ChatGPT Codex forward boundary
  • remove nested prompt_cache_breakpoint properties with bounded, atomic traversal
  • omit item_reference rows only when store: false, while preserving tool call_id pairs and reasoning.effort
  • preserve the original extensions for key-auth public Responses providers and noncanonical forward gateways
  • update the compatibility manifest, fixture evidence, public docs, and architecture decision record

Closes #2648

This is intentionally stacked on #2672 because it extends that canonical-forward normalization boundary. Retarget to dev after the parent lands.

Verification

  • bun test tests/responses-forward-posit-continuation.test.ts tests/responses-forward-prompt-envelope.test.ts tests/compatibility-manifest.test.ts tests/openai-responses-passthrough.test.ts — 118 pass, 0 fail
  • bun run typecheck — passed
  • bun run privacy:scan — passed
  • cd docs-site && bun install --frozen-lockfile && bun run build — 393 pages built
  • parent fix(responses): normalize canonical forward prompt envelope #2672 exact-head GitHub CI — green across Linux shards, macOS, gates, keyring, and npm-global jobs
  • bun run test under the requested two-core CPU cap — 14,940 pass / 16 skip; the remaining 20 failures and 3 errors were unrelated five-second timeout/dependency failures under the constrained local runner, so this PR remains draft pending its own exact-head CI

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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 github-actions Bot added the bug Something isn't working label Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 61 / 80

설명

이 풀 리퀘스트는 Posit Assistant 가 ChatGPT Codex 앞으로 gpt-5.6-luna 를 이어서 보낼 때, 클라이언트만 아는 prompt_cache_breakpointstore: falseitem_reference 때문에 HTTP 502 가 나는 문제를 고칩니다. 이슈 #2648 이 그 경로를 이미 72점으로 열어 두었습니다. 지금 current dev HEAD 779b6090csrc/adapters/openai-responses.ts 1862줄 sanitizedBody 체인은 sanitizeReasoningInputContent, stripInvalidItemIds, stripItemIdsWhenUnstored 를 포함합니다. 저장소 전체에서 prompt_cache_breakpointitem_reference 라는 이름은 한 번도 나오지 않습니다. 그래서 Posit 이 넣는 표시는 Luna 까지 그대로 갑니다.

stripItemIdsWhenUnstored 는 238-251줄에서 store === false 일 때 입력 항목의 id 만 지웁니다. 주석은 call_id 짝은 남긴다고 적습니다. 이 함수는 typeitem_reference 인 항목 자체를 빼지 않습니다. store=false 면 업스트림은 예전 rs_... 항목을 찾을 수 없습니다. id 만 지운 채 참조 껍질을 남기면 input[1].id missing 같은 두 번째 오류가 날 수 있습니다. 139줄 stripInvalidItemIds 는 알려진 접두사 표만 보고, item_reference 타입은 표에 없습니다.

고침은 캐논 ChatGPT forward 칸에서 normalizeCanonicalForwardContinuationEnvelope 를 호출합니다. prompt_cache_breakpoint 는 깊이 64, 노드 100000 한도 안에서 재귀적으로 지우고, 한도를 넘으면 그 표시가 있는 input 을 부분 변환하지 않고 그대로 둡니다. store === false 일 때만 맨 위 item_reference 행을 뺍니다. function_call / function_call_outputcall_idreasoning.effort 는 건드리지 않습니다. 키 인증 공개 Responses 와 비캐논 forward 는 두 확장을 보존합니다. 호환 목록은 부모 #26721.1.0 위에서 1.2.0 으로 올라갑니다.

다만 베이스가 #2672 브랜치 ingw/fix-responses-forward-system-truncation-2668 입니다. 지금 HEAD 779b6090c 에는 부모의 normalizeCanonicalForwardPromptEnvelope 도 없고, 이 PR 의 이어가기 함수도 없습니다. 이 PR 만 현재 dev 에 합치면 부모 커밋이 같이 들어오거나, 부모를 빼고 다시 맞추면 충돌이 납니다. 표시 걷기가 한도를 넘으면 표시는 원자적으로 남기지만, 그 전에 store === falseitem_reference 를 뺀 결과는 그대로 남을 수 있습니다. 두 변환이 한 번의 실패 닫힘이 아닙니다. store 가 빠지거나 true 이면 참조 행은 남습니다. Posit 이 store: false 를 항상 넣는지는 이 테스트가 강제하지 않습니다.

테스트 tests/responses-forward-posit-continuation.test.ts 는 표시 제거와 참조 제거, call_id 보존, store: true 에서 참조 보존, 키 인증·비캐논 보존, 깊이 70 중첩의 원자적 유지를 봅니다. 초안입니다. 본문은 부모 #2672 exact-head CI 가 초록이라고 적고, 이 PR 자체는 로컬 전체 스위트가 제한된 CPU 에서 20실패 3오류로 끝나 초안을 유지한다고 합니다. structure 결정 로그는 공개 제공자를 넓히지 않으려는 이유를 적습니다. types.ts/config.ts 는 건드리지 않습니다.

src/adapters/openai-responses.ts:238 - 지금 HEAD 의 stripItemIdsWhenUnstoredstore=false 일 때 id 만 지우고 item_reference 항목을 빼지 않습니다
경로/심볼 - HEAD 에 prompt_cache_breakpoint 를 겹친 내용에서 지우는 코드가 없습니다
src/adapters/openai-responses.ts:139 - stripInvalidItemIds 는 알려진 접두사만 보고 item_reference 타입은 다루지 않습니다
경로/심볼 - 베이스가 #2672 라 현재 dev 779b6090c 에 혼자 합치면 안 됩니다
tests/responses-forward-posit-continuation.test.ts - store 생략과 표시 한도 초과 뒤에도 참조 행이 빠지는 혼합 실패는 검사하지 않습니다

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

  • fix(responses): normalize canonical forward prompt envelope #2672 가 먼저 들어간 뒤에만 이 PR 을 볼지 정해야 합니다
  • 표시 걷기 한도 초과 때 item_reference 제거도 원래 input 으로 되돌릴지 정해야 합니다
  • store 가 생략된 이어가기에서 item_reference 를 뺄지 정해야 합니다
  • 로컬 전체 스위트 실패를 호스트 부하로만 보고 exact-head CI 만 기다릴지 정해야 합니다

너의 추천

초안을 유지하고 지금 합치지 마세요. #2672dev 에 들어간 뒤에 이 PR 을 dev 로 다시 겨냥하세요. #2672 가 닫히거나 무효가 되면 이 PR 도 닫고, 현재 HEAD 에서 이어가기 커밋만 새 PR 로 올리세요. 쌓인 부모를 현재 dev 위에 억지로 다시 맞추지 마세요. exact-head CI 가 이 브랜치에서 초록이 되기 전에는 Ready 로 올리지 마세요. 표시 한도 초과와 item_reference 제거를 한 번의 실패 닫힘으로 묶는 검사는 합치기 전에 하나 넣는 것이 좋습니다. 미리보기 배포는 계획에 없습니다.

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

lidge-jun added a commit that referenced this pull request Aug 27, 2026
fix: land the L1 lane of the 260827 bug-PR merge round (#2672 #2674 #2671 #2684)
Base automatically changed from ingw/fix-responses-forward-system-truncation-2668 to dev August 27, 2026 04:35
@lidge-jun
lidge-jun merged commit e3b136f into dev Aug 27, 2026
26 of 27 checks passed
@lidge-jun
lidge-jun deleted the ingw/fix-posit-responses-continuation-2648 branch August 27, 2026 04:35
@lidge-jun

Copy link
Copy Markdown
Owner

Landed on dev in the L1 lane of the 260827 bug-PR merge round, via #2720 (merge commit 2feffbdc3, your work preserved as e3b136fb7).

Merged directly after its parent #2672. The bounded traversal in stripPromptCacheBreakpoints — depth 64, 100k nodes, atomic abort rather than a partially rewritten subtree — is the part that made this safe to take without hesitation.

No changes were needed.

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