Client or integration
Codex App
Provider or upstream service
Kiro
OpenCodex version
2.44.0 / af344a2
Endpoint or capability
POST /v1/responses, Codex code-mode exec tool results
Current behaviour
A single Codex code-mode exec call can emit several adjacent custom_tool_call_output items with the same call_id when the script calls notify() before its final text() result. The Kiro adapter currently translates every output into a separate toolResult with the same toolUseId. Kiro consumes the tool use with the first result, then rejects the next duplicate result because no unmatched tool use remains.
Expected behaviour
The Kiro adapter should emit one toolResult for adjacent outputs belonging to the same call_id. It should append their content in input order, retain images, and propagate error status if any merged output is an error. If the same call_id reappears after a different call's result, the adapter should continue rejecting that ambiguous ordering.
Minimal redacted request or reproduction
Run one Codex exec tool call whose script emits:
notify("update-1");
notify("update-2");
text("final-result");
On the next model request, the Responses input contains three adjacent outputs associated with the same call_id.
Actual response or error
Kiro tool result has no matching tool use "call_58be3e59-ef13-4c50-8863-c48a9126183b"
Upstream documentation
No public Kiro or CodeWhisperer specification was found for multiple results on one toolUseId. The concrete client requirement is the observed Codex code-mode output sequence together with Kiro's validation that accepts one result for each tool use.
Suggested mapping or implementation notes
While converting Responses messages to Kiro messages, merge only immediately adjacent results whose toolUseId matches the last emitted toolResult. Append text and images without reordering them and change the merged status to error if a later adjacent result is an error. Do not search earlier turns or merge across another tool's result, because that could hide invalid parallel ordering.
A focused regression test should cover three adjacent outputs becoming one ordered result, plus call-a, call-b, call-a remaining invalid.
Additional context and attachments
The same report was previously opened as #3731 and closed only because it did not use a recognized issue template.
A local fix was validated with 83 Kiro adapter tests, typecheck, and git diff --check. The focused cases cover ordered text, retained images, propagated error status, call-a / call-b / call-a rejection, and rejection when user input interrupts two results for the same call. A live Codex smoke test completed a code-mode call with notifications and a final result through Kiro. The broad changed-test suite was not rerun because a previous run exhausted system memory and the Linux kernel terminated Chromium; affected suites were run independently.
Checks
Client or integration
Codex App
Provider or upstream service
Kiro
OpenCodex version
2.44.0 / af344a2
Endpoint or capability
POST /v1/responses, Codex code-mode exec tool results
Current behaviour
A single Codex code-mode exec call can emit several adjacent custom_tool_call_output items with the same call_id when the script calls notify() before its final text() result. The Kiro adapter currently translates every output into a separate toolResult with the same toolUseId. Kiro consumes the tool use with the first result, then rejects the next duplicate result because no unmatched tool use remains.
Expected behaviour
The Kiro adapter should emit one toolResult for adjacent outputs belonging to the same call_id. It should append their content in input order, retain images, and propagate error status if any merged output is an error. If the same call_id reappears after a different call's result, the adapter should continue rejecting that ambiguous ordering.
Minimal redacted request or reproduction
Run one Codex exec tool call whose script emits:
On the next model request, the Responses input contains three adjacent outputs associated with the same call_id.
Actual response or error
Upstream documentation
No public Kiro or CodeWhisperer specification was found for multiple results on one toolUseId. The concrete client requirement is the observed Codex code-mode output sequence together with Kiro's validation that accepts one result for each tool use.
Suggested mapping or implementation notes
While converting Responses messages to Kiro messages, merge only immediately adjacent results whose toolUseId matches the last emitted toolResult. Append text and images without reordering them and change the merged status to error if a later adjacent result is an error. Do not search earlier turns or merge across another tool's result, because that could hide invalid parallel ordering.
A focused regression test should cover three adjacent outputs becoming one ordered result, plus call-a, call-b, call-a remaining invalid.
Additional context and attachments
The same report was previously opened as #3731 and closed only because it did not use a recognized issue template.
A local fix was validated with 83 Kiro adapter tests, typecheck, and git diff --check. The focused cases cover ordered text, retained images, propagated error status, call-a / call-b / call-a rejection, and rejection when user input interrupts two results for the same call. A live Codex smoke test completed a code-mode call with notifications and a final result through Kiro. The broad changed-test suite was not rerun because a previous run exhausted system memory and the Linux kernel terminated Chromium; affected suites were run independently.
Checks