Skip to content

fix(ai): recover stale Codex previous_response_id#926

Merged
can1357 merged 1 commit intocan1357:mainfrom
enieuwy:fix/codex-stale-previous-response
May 3, 2026
Merged

fix(ai): recover stale Codex previous_response_id#926
can1357 merged 1 commit intocan1357:mainfrom
enieuwy:fix/codex-stale-previous-response

Conversation

@enieuwy
Copy link
Copy Markdown
Contributor

@enieuwy enieuwy commented May 3, 2026

Summary

  • recover Codex websocket continuations when the cached previous_response_id expires server-side
  • clear append/session metadata and retry the current turn with full context before any output has been emitted
  • add regression coverage for the websocket delta -> previous_response_not_found -> full-context retry path

Fixes #925

Verification

bun test packages/ai/test/openai-codex-stream.test.ts -t "websocket continuation"
2 pass
28 filtered out
0 fail

Also ran:

bun run check

Biome passed. Type check is currently blocked in this checkout by missing workspace/dependency modules after pulling latest:

  • @aws-sdk/credential-provider-node
  • proxy-agent
  • @oh-my-pi/pi-natives

@can1357
Copy link
Copy Markdown
Owner

can1357 commented May 3, 2026

ty!

@can1357 can1357 merged commit c955dd1 into can1357:main May 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(ai): Codex websocket append fails when previous_response_id expires

2 participants