Skip to content

fix: support retrieval of stored Responses payloads - #354

Merged
franciscojavierarceo merged 6 commits into
mainfrom
codex/response-retrieval
Sep 26, 2026
Merged

franciscojavierarceo merged 6 commits into
mainfrom
codex/response-retrieval

Conversation

@franciscojavierarceo

@franciscojavierarceo franciscojavierarceo commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A response created with store: true could be continued through previous_response_id, but retrieving it with GET /v1/responses/{response_id} returned 404. Add an authenticated retrieval route backed by a typed terminal response snapshot, persisted atomically with the response history. Retrieval preserves this turn's output, status, usage, and IDs without calling the upstream model.

Keep snapshots out of continuation checkpoints and strip request-scoped MCP credentials before persistence. Unknown IDs return a JSON 404; legacy and history-only records return 409 because they lack the original response payload. Document the behavior and expose the endpoint in OpenAPI.

When OIDC is disabled and OPENAI_API_KEY is nonempty, retrieval validates the supplied bearer token locally before reading storage. Missing or invalid credentials return 401; OIDC authentication takes precedence when enabled. Deployments without either authentication option retain unauthenticated access.

Test Plan

  • Reproduced the missing-route regression: the retrieval test expected 200 and received 404 before enabling the route.
  • Run server integration suites for retrieval, incomplete responses, HTTP responses, WebSockets, OpenAPI, OIDC authentication, and conversations.
  • Verify missing, invalid, and valid API keys, OIDC precedence, and retrieval with the upstream offline.
  • Run core unit tests and storage integration tests, including credential sanitization and continuation budgets.
  • Run cargo clippy --workspace --all-targets -- -D warnings and all pre-commit hooks.
  • Live-tested Qwen3.8-27B-FP8 through a separate local gateway: two stored turns round-tripped exactly through GET, and an unknown ID returned JSON 404. Automated tests additionally verify retrieval after gateway restart and with the upstream unavailable.

Signed-off-by: Francisco Javier Arceo <arceofrancisco@gmail.com>
Comment thread crates/agentic-server/src/app.rs Outdated
Comment thread crates/agentic-server/src/handler/http/responses.rs
Signed-off-by: Francisco Javier Arceo <arceofrancisco@gmail.com>
Signed-off-by: Francisco Javier Arceo <arceofrancisco@gmail.com>
@maralbahari

Copy link
Copy Markdown
Collaborator

@franciscojavierarceo could you please fix the ci and resolve merge conflict?

Resolve conflicts with current Conversations API refactor.

Signed-off-by: Francisco Javier Arceo <arceofrancisco@gmail.com>
Signed-off-by: Francisco Javier Arceo <arceofrancisco@gmail.com>
Signed-off-by: Francisco Javier Arceo <arceofrancisco@gmail.com>
@franciscojavierarceo
franciscojavierarceo merged commit 280f798 into main Sep 26, 2026
21 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.

2 participants