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.

Comment thread crates/agentic-server/src/app.rs Resolved
@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 <[email protected]>
@franciscojavierarceo
franciscojavierarceo merged commit 280f798 into main Sep 26, 2026
21 checks passed
haoshan98 added a commit that referenced this pull request Sep 30, 2026
## Summary

Several user-facing docs had fallen behind `main` or contradicted each
other and the code. This PR brings them in line with what has shipped.
It changes documentation only.


**Corrected claims**
- README listed the Messages API as "🚧 Planned" while another README
section documents `/v1/messages`. It is now listed as shipped; only
stateful Messages stays planned.
- README and `docs/index.md` advertised "Background execution" and
gateway-executed file search. Neither exists yet: background mode is
#357, and `file_search` declarations parse but are dropped before
inference (`tool/normalize.rs`). Both claims are removed.
- `docs/api/index.md` quoted fixed WebSocket and executor limits (256
KiB SSE lines, 1 MiB events and response budget). These now come from
the configurable `[responses]` settings, which default to 16 MiB and 8
MiB.
- `docs/api/index.md` listed only some of the conditions that route a
Responses request through the executor. The list now also includes
non-function tools, `multi_agent.enabled`, and tool-search state,
matching `handler/http/responses.rs`.
- CHANGELOG listed Tavily under 0.8.0, but it merged on Sep 28, after
the Sep 19 release. The two Tavily entries move to `[Unreleased]`.

**Newly documented features**
- README: a multi-agent Responses section with an example and the
gateway's limits (`store: true`, HTTP/SSE only, default of 3 concurrent
subagents, no `max_tool_calls` or reasoning summaries). Also new rows in
the API table for `/v1/responses/compact`, the full Conversations
routes, `/v1/messages` with `/v1/messages/count_tokens`, and
Swagger/OpenAPI (`ENABLE_OPENAPI_DOCS`). The features list, diagram, and
tool ownership table now include MCP, the code interpreter, Claude Code,
compaction, and OpenTelemetry.
- `docs/api/index.md`: new sections for `GET
/v1/responses/{response_id}`, multi-agent, Conversations, and Messages.
- CHANGELOG `[Unreleased]` was empty. It now has entries for #345, #347,
#349, #351/#370, #354, #368, #369, #372/#373, #380, and #387.

**Roadmap**
- ROADMAP.md marks multi-agent HTTP execution as shipped, with WebSocket
injection (#300) and stateless requests (#393) still open. It adds a
status note for Messages, a code interpreter entry, and a file search
item linking #34 and #356.
- README "Roadmap at a Glance" checks off Messages and Conversations and
adds unchecked items for multi-agent, file search, and stateful
Messages.

**Smaller fixes**
- The repository layout in README and AGENTS.md now lists
`agentic-llm-d`, `agentic-cli-docs`, and `python/agentic_api/`.
- ARCHITECTURE.md's list of multi-agent rejections now includes
`max_tool_calls`, matching `executor/rehydrate.rs`.
- `mkdocs.yaml` adds the existing but unlinked `design/shell-tool.md` to
the nav.

**Not changed:** the README's "Rust 1.85+" badge is wrong (1.85 cannot
build the lockfile, see #377), but #379 already updates it to 1.88 along
with `rust-version` and a CI check, so this PR leaves it alone to avoid
a conflict.

Signed-off-by: haoshan98 <[email protected]>
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