Repository navigation
Posit Assistant Responses tool continuation fails for Luna after tool calls #2648
Description
Client or integration
Codex CLI
Provider or upstream service
ChatGPT Codex forward / Posit Assistant
OpenCodex version
2.32.1
Endpoint or capability
/v1/responses, Responses tool continuation, prompt caching, reasoning replay
Current behaviour
The first OpenAI Responses request from Posit Assistant succeeds and returns tool calls. When the tool results are sent back in the next continuation request, Posit Assistant reports Error making request and Turn failed. OpenCodex returns HTTP 502 upstream_server_error for the gpt-5.6-luna request.
Expected behaviour
The OpenAI Responses compatibility layer should accept the Posit Assistant continuation request, remove or normalize client-only prompt cache markers, handle unpersisted item references when store=false, preserve function call_id pairing, and return a valid Responses SSE stream while preserving reasoning.effort.
Minimal redacted request or reproduction
1. Start OpenCodex 2.32.1 on the macOS host with: ocx start --port 7861
2. Connect Positron 2026.08.2 to a remote Linux container using Remote-SSH. Posit Assistant runs in the remote container and port 7861 is forwarded to the macOS host.
3. Configure Posit Assistant to use gpt-5.6-luna through the openai-responses protocol at http://127.0.0.1:7861/v1.
4. Submit a task that requires tools, for example: list the files in the workspace and find the relevant R script.
5. The first Responses request succeeds and returns tool calls.
6. After tool results are returned, the next continuation request fails.
The failing continuation is a store=false Responses request containing client-side prompt_cache_breakpoint markers in nested input content and an item_reference to a previous reasoning item. A sanitized copy of the failing request can be replayed through POST /v1/responses.Actual response or error
HTTP 502
errorCode: upstream_server_error
inboundProtocol: responses
requestedModel: gpt-5.6-luna
Observed upstream errors while replaying the continuation include:
- prompt_cache_breakpoint is not supported on this model
- Item with id 'rs_...' not found. Items are not persisted when store is set to false.
- input[1].id missing after incompatible item-id cleanup
After removing the cache-breakpoint markers recursively and removing the unpersisted item_reference while preserving tool call_id pairing, the exact replay returns HTTP 200 with a complete Responses SSE stream.Upstream documentation
https://platform.openai.com/docs/api-reference/responses
Suggested mapping or implementation notes
The proxy should apply this normalization in the canonical OpenAI Responses forward sanitization pipeline. The transform should be narrow: remove prompt_cache_breakpoint recursively and drop item_reference only when store=false, while preserving reasoning.effort and function call_id pairing.
Additional context and attachments
Related issue: #2645. The original issue was automatically closed because its structured Reproduction field was empty. This replacement uses the Provider or API compatibility form and fills all required fields.
Checks
- I searched existing provider and compatibility issues.
- The request and response were redacted.
- The expected behaviour is based on an upstream specification or a concrete client requirement.
Activity
lidge-jun commentedon Aug 26, 2026
리뷰 · 우선순위 72 / 80
설명
이 이슈는 Posit Assistant가 ChatGPT Codex 앞으로
gpt-5.6-luna를 쓸 때, 첫 도구 호출은 성공하지만 도구 결과를 보내는 다음 요청이 HTTP 502upstream_server_error로 죽는 문제입니다. 재현은 분명합니다.store=false인 Responses 이어가기 안에 클라이언트만 아는prompt_cache_breakpoint표시가 겹친 내용으로 들어 있고, 예전에 만든 추론 항목을 가리키는item_reference도 있습니다. 이슈 작성자는 그 두 가지만 치우고call_id짝은 남기면 같은 요청이 HTTP 200과 완전한 SSE로 돌아온다고 적었습니다.지금
dev의 살균 체인은src/adapters/openai-responses.ts1862줄에 있습니다.sanitizeReasoningInputContent,stripInvalidItemIds,stripItemIdsWhenUnstored가 이어집니다. 하지만 저장소 전체에서prompt_cache_breakpoint와item_reference라는 이름은 한 번도 나오지 않습니다. 그래서 Posit이 넣는 표시는 손대지 않은 채 Luna 업스트림까지 갑니다.stripItemIdsWhenUnstored(238-251줄)는store === false일 때 입력 항목의id만 지웁니다.call_id는 남긴다고 주석에 적혀 있습니다. 이 함수는type이item_reference인 항목 자체를 빼지 않습니다.store=false면 업스트림은 예전rs_...항목을 찾을 수 없어서, 이슈에 적힌Item with id 'rs_...' not found가 납니다.id만 지운 채 참조 항목을 남기면input[1].id missing같은 두 번째 오류가 날 수도 있습니다.prompt_cache_breakpoint는 더 깊게 숨어 있습니다. 메시지의 겹친content배열 안에 들어 있을 수 있는데, 지금 살균기는 그 안을 재귀적으로 걷지 않습니다. Luna는 이 표시를 모름 모델에서 거절합니다.reasoning.effort는 다른 함수들이 함부로 지우지 않으므로, 새 변환은 그 필드를 건드리면 안 됩니다.닫힌 #2645는 같은 이야기입니다. 재현 칸이 비어 자동으로 닫혔고, 이 이슈가 그 자리를 대신합니다. #2645는 다시 열지 마세요.
라인 238 -
stripItemIdsWhenUnstored는store=false일 때id만 지우고,item_reference항목을 빼지 않아 없는 저장 항목을 계속 가리킵니다.경로/심볼 -
prompt_cache_breakpoint를 겹친 내용에서 지우는 코드가src/adapters/openai-responses.ts에 없습니다.src/adapters/openai-responses.ts:1862 - 지금 살균 체인에는 위 두 단계가 없어 Posit 이어가기가 Luna까지 그대로 전달됩니다.
src/adapters/openai-responses.ts:139 -
stripInvalidItemIds는 알려진 접두사만 보고,item_reference타입은 다루지 않습니다.메인테이너의 판단이 필요한 지점
store=false일 때item_reference를 항상 뺄지, 로컬 재현 캐시에 같은 항목이 있을 때만 내용으로 바꿀지 정해야 합니다.prompt_cache_breakpoint를 모든 모델에서 지울지, 거절하는 모델에서만 지울지 정해야 합니다.너의 추천
이 이슈는 열어 두고 구현을 진행하는 것을 추천합니다. 고침은
src/adapters/openai-responses.ts살균 체인에 좁게 넣으세요. 겹친prompt_cache_breakpoint를 지우고,store=false일 때만item_reference를 빼며,function_call의call_id와reasoning.effort는 그대로 두세요.id만 지우고 참조 항목을 남기는 방식은 이미 이슈가 실패한 길이므로 피하세요. #2645는 닫아 두세요.이 댓글은 grok-bot이 작성했습니다
Ingwannu commentedon Aug 26, 2026
Confirmed against current
dev(779b6090c): the canonical forward sanitizer removes some top-level unsupported fields and item ids, but it does not recognize nestedprompt_cache_breakpointmarkers or removeitem_referenceentries whenstore: false.I will handle this as a separate narrow continuation patch after #2668:
prompt_cache_breakpointproperties from request input content without changing sibling content;store === false, remove unresolveditem_referenceinput items rather than deleting only theiridand leaving an invalid reference shell;function_call/function_call_outputcall_idpairing andreasoning.effortbyte-for-byte;I will link the implementation PR here. #2645 should remain closed as the malformed duplicate.
Ingwannu commentedon Aug 26, 2026
Implemented the scoped fix in draft PR #2674, stacked on #2672.
Exact head:
140d0141d9221d9c654bb8297ed8c4e35e7a74fdThe patch:
prompt_cache_breakpointproperties only on the canonical ChatGPT Codex forward route, with bounded depth/node traversal and atomic fallback;item_referenceinput rows only whenstore: false;call_idpairing andreasoning.effort;Focused adapter/manifest/passthrough coverage is 118/118 green, typecheck and privacy scan pass, and the docs build produced all 393 pages. Parent #2672 is exact-head CI green. I am keeping this issue open until the stacked change reaches
devand its own exact-head CI is complete.Ingwannu commentedon Aug 26, 2026
Update: stacked draft PR #2674 exact-head CI is now fully green, including all Linux shards, macOS, gates, keyring, npm-global jobs, React Doctor, and the aggregate
cicheck. The branch is clean against parent #2672. I requestedlidge-junreview because author self-approval/merge is not allowed; this issue remains open until the parent and child reachdev.Merge pull request lidge-jun#2674 from Ingwannu/ingw/fix-posit-respon…
lidge-jun commentedon Aug 27, 2026
Landed via #2720 at 2feffbd (via #2674 on L1). Fix is on
dev: Posit Responses tool continuation normalization.Merge pull request lidge-jun#2674 from Ingwannu/ingw/fix-posit-respon…
Merge pull request lidge-jun#2674 from Ingwannu/ingw/fix-posit-respon…