OpenClaw merged a substantial OpenAI provider performance improvement overnight with PR #121687. The change targets first-token latency and repeated-turn overhead for OpenAI-backed agent sessions.
The PR says OpenAI-backed turns were repeatedly rebuilding model and plugin state, retransmitting full Responses history, and paying fresh transport setup costs. That made the first visible response slower than necessary and kept warm turns well above the provider's own processing time.
The New Fast Path
The merged implementation introduces a session-owned fast path with prepared model and runtime reuse, official OpenAI Responses WebSocket transport, conservative previous_response_id continuation, slimmer prompts, and guarded pinned-dispatcher reuse.
In plain language: OpenClaw keeps more of the right session state warm, uses a persistent transport when it is safe to do so, and avoids sending unnecessary context back through the provider on every turn.
The implementation does not simply trade safety for speed. WebSocket fallback is allowed only before dispatch. Post-dispatch ambiguity and output-bearing failures remain terminal. Caller aborts stay distinct. Every dispatcher reuse performs fresh DNS and SSRF validation, and auth-bearing resources remain owned by session reset and Gateway shutdown lifecycle.
Measured Impact
The PR reports concrete latency measurements against the same openai/gpt-5.6-luna agent workload:
- Clean first-response TTFA improved from 3068 ms to 2243 ms.
- Warm p50 TTFA improved from 2020 ms to 1247 ms.
- Warm mean TTFA improved from 2194 ms to 1259 ms.
- Warm p50 total time improved from 2455 ms to 1525 ms.
- Prompt tokens dropped from 18827 to 12191.
Those are large changes for everyday agent use. A 30 to 40 percent warm-turn improvement is the kind of latency reduction users feel immediately in chat, especially when an agent is doing iterative work across several turns.
Cleanup Found Real Bugs
The performance work also found and fixed four lifecycle and replay bugs during review. Temporary compaction sessions could dispose durable provider resources for the same session id. Replay-unsafe post-dispatch failures could rotate profiles or models based on error text. Same-session-id replacements could be cleaned up after a reset waiter returned. Dispatcher shutdown could publish a replacement generation while the old pool was still closing.
That is the right kind of performance patch: it reduces duplicated state while clarifying ownership.
Tested Scope
The author reports live OpenAI proof showing a clean session selecting a new WebSocket, repeated turns logging reuse and continuation, and expected responses returning successfully. The final repeated turn had a 235 ms provider acknowledgement and 1326 ms transport completion.
The PR also passed changed-test bundles, transport and cache cleanup tests, conflict-surface cron tests, build checks, Plugin SDK API and surface checks, dead-export scans, and an exact-head Codex review.
For OpenAI-backed OpenClaw agents, this should make repeated work feel more responsive without requiring configuration changes.