Repository navigation
improve(gateway): compose live session stress probes - #122519
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 9:04 AM ET / 13:04 UTC. ClawSweeper reviewWhat this changesThe PR preserves OpenAI Responses compaction checkpoints through session sanitization and continuation, and composes the live Codex session stress probes. Merge readinessKeep this maintainer-owned PR open for manual merge review. The prior global-compaction-policy concern is resolved, and the replay repair is owner-boundary aligned; direct Codex app-server source inspection remains unavailable in this review environment. Priority: P2 Review scores
Verification
How this fits togetherThe embedded agent runner persists provider replay checkpoints in session history and uses them to continue incomplete OpenAI Responses turns. The gateway’s live Codex harness drives multi-session and restart probes against that runtime. flowchart LR
Provider[OpenAI Responses stream] --> Checkpoint[Compaction checkpoint]
Checkpoint --> Session[Sanitized session history]
Session --> Runner[Embedded agent runner]
Runner --> Replay[Replay continuation]
Harness[Live Codex stress harness] --> Runner
Replay --> Outcome[Visible completed response]
Decision needed
Why: Repository policy requires the reviewing agent to inspect sibling Codex source for Codex-backed runtime claims; that checkout is absent here, so a maintainer must choose whether to supply that proof or accept the existing live-run evidence. Before merge
Agent review detailsSecurityNone. PR surfaceSource -13, Tests +126, Docs 0, Other +9. Total +122 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the owner-boundary replay repair and land only after direct inspection of the pinned Codex app-server contract and green exact-head CI confirm the composed harness proof. Do we have a high-confidence way to reproduce the issue? Yes: current main drops an empty checkpoint-owning assistant message and does not continue it without local compaction; the PR’s ephemeral gateway E2E encodes that deterministic provider sequence. Is this the best way to solve the issue? Yes for the replay defect: preserving the checkpoint at the session-history owner and using the existing bounded continuation is narrower than adding a fallback path; Codex harness proof still needs its direct contract check. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fb9a62e99568. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
a344bc9 to
4d3a1b8
Compare
4d3a1b8 to
0007b2a
Compare
0007b2a to
0ae0868
Compare
0ae0868 to
dda689e
Compare
dda689e to
3274252
Compare
3274252 to
6d05d79
Compare
|
@clawsweeper re-review The prior compaction-policy finding is resolved: the global local-compaction guard was removed, and only the direct live probe disables proactive compaction. The current head preserves/continues valid Responses replay checkpoints without changing production compaction defaults. The PR body now includes the bounded live OpenAI and composed Codex multi-session/subagent/restart evidence, exact timings, cleanup proof, focused post-rebase validation, and production LOC (-6 net). |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* test(gateway): compose live session stress probes Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7 * fix(ai): resume after Responses compaction checkpoints Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7 * test(gateway): compose multi-session subagent probes Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7 * fix(test): invalidate inlined schema transforms Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7 * test(ai): cover empty compaction owners Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7 --------- Co-authored-by: Amp <[email protected]>
What Problem This Solves
OpenAI Responses may return a compaction checkpoint on a
response.incompleteturn with no visible assistant text or usage. Session sanitization discarded that otherwise-empty assistant message, and terminal resolution only continued when local compaction had incremented its counter, so the opaque provider replay owner could be lost or the run could stop silently instead of replaying the checkpoint.The authenticated Codex stress harness also treated multi-session runs as subagent-only and stopped after the first multi-session phase, preventing session switching, nested-agent communication, baseline turns, approval persistence, and restart/resume from composing in one campaign.
Why This Change Was Made
providerReplaycheckpoint.1000, three dense turns). Local proactive compaction is disabled only in this live probe so it cannot consume the history the probe is measuring.Production defaults are unchanged except for the replay correctness fix: there is no global change to local compaction policy.
User Impact
Direct OpenAI Responses sessions can now persist and resume compaction-only incomplete turns instead of losing the checkpoint or ending with no visible outcome. Maintainers also get one bounded cloud-session campaign that covers session switching, nested sessions, cross-agent communication, approval persistence, and restart/replay together.
Evidence
[email protected]streaming returned one first-classcompactionadd/done item with non-empty opaque replay state for bothstore=true(1.295s) andstore=false(0.941s), terminating asresponse.incomplete: run.node --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --check— passed.oxfmt --check,git diff --check, and the generated plugin SDK baseline — passed.origin/main— clean, no accepted/actionable findings;patch is correct(0.98 confidence).thread/start,thread/resume,turn/start,spawn_agent, and inter-agent message/follow-up handlers match the composed harness semantics.Production/tooling LOC: +15/-21 (net -6) | Tests/test support: +169/-41 | Docs: +3/-3
AI-assisted; maintainer-requested, source-reviewed, live-provider tested, and exact-head CI required before landing.