Repository navigation
🧩 feat: Compose the Background Responses Host - #17606
Conversation
5931a56 to
f385494
Compare
f385494 to
294539c
Compare
294539c to
5f50436
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Idempotent replays can return output created by a revoked key without rechecking its authority, while non-loopback listener bindings accept queued work that cannot execute.
4 open issues
What changed in this PR
Adds a shared background Responses host that composes existing services for HTTP handlers and workers, including durable dispatch, access checks, review, and cancellation.
Changes:
- Composes execution, recovery, review, and worker authentication behind one host interface.
- Adds typed HTTP handlers for background creation, retrieval, and cancellation while preserving ordinary Responses handling.
- Adds integration tests covering authorization, idempotency, review decisions, cancellation, and durable execution.
| File | Description |
|---|---|
packages/api/src/agents/responses/index.ts |
Exports the new host factory. |
packages/api/src/agents/responses/http.ts |
Adds background Responses HTTP handlers. |
packages/api/src/agents/responses/host.ts |
Composes services and exposes HTTP and trusted-transport operations. |
packages/api/src/agents/responses/host.spec.ts |
Tests host behavior through HTTP, authentication, storage, and queue integration. |
Review effort: Balanced
5f50436 to
a71eb54
Compare
|
Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures. |
a71eb54 to
0219cff
Compare
35bd419 to
652e00c
Compare
652e00c to
e2157d9
Compare
e2157d9 to
4f6425c
Compare
4f6425c to
5c0655e
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c0655efa7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
f80de08 to
faa8afe
Compare
87b13a0 to
6abbdc7
Compare
6abbdc7 to
d6ab888
Compare
d6ab888 to
f510eee
Compare
f510eee to
a581db9
Compare
a581db9 to
795414c
Compare
795414c to
7602780
Compare
7602780 to
d28a8e9
Compare
d28a8e9 to
bfc14b8
Compare
bfc14b8 to
53d51e6
Compare
53d51e6 to
03a984f
Compare


Summary
Adds one typed host for background Agent Responses: durable dispatch, signed local worker ingress, canonical completion/recovery, owner review and cancellation. Ordinary synchronous Responses remain available, and background execution stays disabled unless configured.
The host preserves the original source credential's authority on replay, keeps native recovery state visible, and distinguishes deterministic invalid requests from retryable service failures.
How it works
The host composes durable dispatch, signed local worker ingress, completion/recovery and owner review around the existing synchronous Responses handlers. Background reads require an authorized journal and cannot fall through to ordinary history. Continuation preserves retention deadlines; review submission is available only when checkpoint validation and resume execution are installed together.
Type of change
Testing
Tested environments/configuration: Node 24, disposable MongoDB replica sets, real HTTP listeners, actual API-key authentication and durable queue execution.
Automated tests: 568 Responses/remote cases across 26 suites and 99 compiled JSON/SSE controller cases pass. Real HTTP/Mongo cases cover one journal load per poll, source denial and storage failure without fallback, fresh-turn and inherited retention, canonical input/output ancestry, replay without duplicate messages, owner/native boundaries and trusted listeners. Actual Stop/provider-error history is read through the compiled host and real foreground fallback; closing or physically erasing its journal cannot disclose retained background Messages. Ordinary response-ID and legacy conversation-ID reads reject background-marked history even when its full receipt is damaged.
Owning API types, ordered provider/data-schemas/API builds, explicit ten-file import sorting/checks and scoped static checks pass. Three optional full-mode checks are skipped, with types checked separately. Compiled CJS/ESM smoke passes; the isolated Lighthouse harness passes (median LCP 3.58 s, CLS 0.018, TBT 79 ms).
Screenshots / recordings
No user-facing visual change: typed host and HTTP composition.
Risk / compatibility
The host requires explicit durable dependencies and an initialized local listener. Background history requires a readable, authorized journal; legacy conversation-ID retrieval remains foreground-only. Missing authority, unavailable completion proof and incomplete checkpoint cleanup fail closed. Public response state comes from canonical receipts; transient progress does not fabricate completion. Owner browser review and scoped execution credentials retain separate authority.
Checklist