Repository navigation
feat(openai,compose): harden Responses WebSocket delivery; steer verbatim text through input - #29
Merged
danielkov merged 4 commits intoSep 30, 2026
Conversation
…uting - Scope turn-state per session: capture it from `codex.response.metadata` (which can precede `response.created`), reset it on a new user message or authentication change, and forward it on WebSocket requests. - Send `x-codex-routing-hint`, `thread-id`, and a `session-id` that follows the request's prompt cache key, so requests sharing a cache key reach the backend that holds their prefix. - Detect stalls by response progress rather than raw traffic (`with_progress_timeouts`); keepalive and metadata events no longer reset the timers. - Resend a lost, stalled, or timed-out WebSocket request in full on a fresh socket when `store: false`: before visible output always, and after it when the consumer opts into response-attempt supersession, as HTTP already does. - Remove the warmup request.
…0.6.1 - Order `input` before `script` in the compose schema and describe it as verbatim: text that would need escaping as a string literal goes there. - Replace the JSON-parse primer example with a code-edit example that writes `input` contents unchanged, and use runlet 0.6.1 single-quoted strings. - Require runlet 0.6.1 and bump to 0.10.12.
danielkov
added this pull request to stack #30
September 30, 2026 13:19
…first progress - Scope x-codex-turn-state by the request's turn ID instead of the last user item's transcript position, which compaction can move or reuse. - Start the first-progress deadline before sending, bound opening the attempt by it, and carry the elapsed time into the stream, so waiting for response headers counts against the same limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the Responses WebSocket transport as resilient as HTTP/SSE and keeps prompt-cache hits across sessions that share a cache key. Also makes the Runlet compose tool steer text that would need escaping into
input, and moves it to runlet 0.6.1.Stacked on #28 and based on its branch; GitHub retargets this PR to
mainwhen #28 merges. Both provider changes ship together asagentkit-provider-openai0.10.12.agentkit-tool-composegoes to 0.10.12.Provider (
agentkit-provider-openai)store: falseand response-attempt supersession enabled, the adapter now emitsResponseAttemptSupersededand resends the full request on a fresh socket. Without supersession, visible output is still never replayed.with_progress_timeouts(first, gap)bounds an attempt by response progress, so keepalive and metadata traffic can no longer hold a stalled attempt open until the attempt timeout.session-idfollows the request's prompt cache key, andthread-idandx-codex-routing-hintare sent. Requests that share a key reach the backend holding their prefix, instead of starting cold.codex.response.metadata, which can arrive beforeresponse.created. It is scoped per session and reset on a new user message or an authentication change.Compose (
agentkit-tool-compose)inputcomes beforescriptin the schema and is described as verbatim. Text that would need escaping in a string literal, such as file contents or code with quotes or backslashes, goes ininputand is referenced from the script.inputunchanged, and it uses runlet 0.6.1 single-quoted strings.Impact
No API removals. New:
OpenAIResponsesConfig::with_progress_timeouts. Consumers that opt into response-attempt supersession now receive superseded attempts on WebSocket as well as HTTP.