[PR #9174] feat(openai): use Responses conversation state and remote compact #13014

Closed
opened 2026-02-16 18:17:53 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9174

State: closed
Merged: No


What does this PR do?

  • Switches GPT-on-OpenAI to use the Responses API “conversation state” flow (store: true + previous_response_id) so the server owns state across turns.
  • Changes “compact” for GPT to call the remote Responses compact endpoint (instead of local summarization) and persists the resulting response_id into the session so future turns can continue from it.
  • Adds safety/compat behaviors: retry once without previous_response_id if the server rejects it, and strips stored response_id when forking a session to avoid cross-session leakage.
  • Fixes the Codex plugin’s /v1/responses URL rewrite to preserve subpaths so /compact requests route correctly.

How did you verify your code works?

  • Ran bun test in packages/opencode (all tests passed).
  • Ran bun run typecheck in packages/opencode (passed).

Fixes https://github.com/anomalyco/opencode/issues/5200

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9174 **State:** closed **Merged:** No --- ### What does this PR do? - Switches GPT-on-OpenAI to use the Responses API “conversation state” flow (store: true + previous_response_id) so the server owns state across turns. - Changes “compact” for GPT to call the remote Responses compact endpoint (instead of local summarization) and persists the resulting response_id into the session so future turns can continue from it. - Adds safety/compat behaviors: retry once without previous_response_id if the server rejects it, and strips stored response_id when forking a session to avoid cross-session leakage. - Fixes the Codex plugin’s /v1/responses URL rewrite to preserve subpaths so /compact requests route correctly. ### How did you verify your code works? - Ran bun test in packages/opencode (all tests passed). - Ran bun run typecheck in packages/opencode (passed). Fixes https://github.com/anomalyco/opencode/issues/5200
yindo added the pull-request label 2026-02-16 18:17:53 -05:00
yindo closed this issue 2026-02-16 18:17:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13014