fix(agents): preserve active compaction retries#94421
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c61a6ed09a
ℹ️ 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: needs maintainer review before merge. Reviewed June 18, 2026, 9:25 AM ET / 13:25 UTC. Summary PR surface: Source +22, Tests +21. Total +43 across 4 files. Reproducibility: yes. at source level: current main races the aggregate wait against only Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one maintainer-approved canonical fix that preserves the idle deadlock fallback while not discarding valid long-running compaction retry results, then close the overlapping timeout-only candidates. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main races the aggregate wait against only Is this the best way to solve the issue? Likely yes, with a maintainer tradeoff: using active session streaming closes the specific post-compaction retry gap without adding config or only raising a constant. Maintainers still need to accept the stale-streaming recovery shift versus the overlapping timeout-budget approaches. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against aad0559de0e2. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +22, Tests +21. Total +43 across 4 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Land-ready verification and landing for
Proof gap: no paid-model 200K-context compaction run; the exact retry lifecycle and timeout path were exercised directly. |
|
Merged via squash.
|
Summary
This fixes long-session compaction retries without adding a config surface or coupling retry duration to the separate compaction-call timeout.
Linked context
Closes #94391
Related #40324
Real behavior proof
pnpm test src/agents/embedded-agent-runner/run/compaction-retry-aggregate-timeout.test.ts src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.waits-multiple-compaction-retries-before-resolving.test.ts src/agents/embedded-agent-runner/run/compaction-timeout.test.ts; then a source-level runtime probe with a 60 ms aggregate window and a 170 ms active retry.PASS active retry completed without timeout after 171ms.Tests and validation
pnpm test src/agents/embedded-agent-runner/run/compaction-retry-aggregate-timeout.test.ts -- --reporter=verbosepnpm test src/agents/embedded-agent-runner/run/compaction-retry-aggregate-timeout.test.ts src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.waits-multiple-compaction-retries-before-resolving.test.ts src/agents/embedded-agent-runner/run/compaction-timeout.test.tsautoreview --mode local --engine codex --model gpt-5.5 --thinking high: clean, no actionable findings.Risk checklist
Did user-visible behavior change? (
Yes)Long-running valid compaction retries are allowed to finish instead of silently falling back at 60 seconds.
Did config, environment, or migration behavior change? (
No)Did security, auth, secrets, network, or tool execution behavior change? (
No)Highest risk: extending a genuinely stuck retry. Mitigation: the retry is extended only while the session runtime reports active streaming; once idle, the original 60-second lost-resolution fallback still applies, and the enclosing run abort deadline remains authoritative.
Current review state
Ready for CI and maintainer review. No unresolved autoreview findings.