Repository navigation
improve(tests): focus overflow compaction owner coverage - #118351
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 9:28 PM ET / August 3, 2026, 01:28 UTC. ClawSweeper reviewWhat this changesThe PR reduces a slow overflow-compaction integration test leaf, retains composition-boundary coverage, and relocates auth, lifecycle, retry, runtime-resolution, and recovery assertions to focused owner suites. Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain Keep this PR open for maintainer review. The test-owner split matches the repository’s performance guidance and the supplied diff is test/baseline-only, but this environment could not inspect the complete PR tree, linked CI proof, or the required sibling Codex checkout needed to verify the Codex-specific contract coverage; no concrete patch defect was established. Priority: P3 Review scores
Verification
How this fits togetherOverflow compaction is the embedded agent runner’s recovery path when a model request exceeds its context budget. The runner delegates recovery, auth, retry, and runtime decisions to focused owner modules, then either retries with compacted context or returns a visible terminal outcome. flowchart LR
Request[Agent request] --> Runner[Embedded agent runner]
Runner --> Attempt[Model attempt]
Attempt --> Overflow{Context overflow?}
Overflow -->|yes| Recovery[Overflow recovery owner]
Recovery --> Compaction[Context compaction]
Compaction --> Outcome[Retry or visible terminal outcome]
Overflow -->|no| Outcome
Before merge
Agent review detailsSecurityNone. PR surfaceSource -63, Tests -3028, Other -1. Total -3092 across 11 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain a small set of genuine embedded-runner composition tests, place each extracted policy assertion with its production owner, and verify the linked benchmark plus focused suite on the exact head in an environment that can inspect both GitHub artifacts and sibling Codex source. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes internal test ownership and execution cost rather than fixing a user-visible production failure. The relevant reproduction is the exact-head focused suite and benchmark, which could not be independently run or inspectably read in this environment. Is this the best way to solve the issue? Unclear: moving local policy assertions to their production owners is the repository-preferred shape, but the complete coverage equivalence and Codex-specific assertions cannot be confirmed without the unavailable PR tree, CI artifact, and sibling Codex source. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f2af4e97b356. 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 (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer proof decision: the requested evidence is present and sufficient for this test-only owner-boundary refactor.
ClawSweeper found no concrete patch defect. Its remaining proof concern is that its read-only environment could not open the linked run or sibling checkout; that environment limitation does not invalidate the exact-head evidence above, so I am not requesting another identical re-review cycle. |
|
Focused exact-head proof for The linked full CI run independently exercised the complete compact matrix. Direct sibling Codex source inspection is recorded in the preceding maintainer-proof comment. |
|
Merged via squash.
|
* origin/main: refactor(agents): centralize terminal lifecycle outcomes (#118254) fix(scripts): warm gateway concurrency probes (#118364) test(discord): consolidate activity HTTP fixtures (#118314) fix(qa): restore prerelease validation (#118255) improve(tests): focus overflow compaction owner coverage (#118351) test(telegram): deduplicate dispatch fixtures (#118319) test(xai): consolidate realtime voice fixtures (#118318) fix(telegram): prevent durable ingress lane spins (#118357)
…8351) * test(agents): focus overflow compaction owner coverage * test(agents): import run registry owners directly * test(agents): remove retired overflow fixtures --------- Co-authored-by: Peter Steinberger <[email protected]>
Block 5 of the openclaw#129388 presentation cut: auth-profile tests and fixes that travel under a continuation- prefix but carry no continuation behavior. Home: its own PR. Upstream deliberately retired 23 of these 25 tests from run.overflow-compaction.test.ts in openclaw#118351 (3f85a78), so that PR should argue for them again rather than restore them silently. Removed: - run.continuation-auth-overlay and run.continuation-codex-auth-{bootstrap, forwarding,rotation,selection} test-supports. None of them calls continue_work, continue_delegate or request_compaction. - auth-store.ts stale-key gate, its test and the run-attempt-dispatch wiring (2fe39db, e6fb763). These are restored to upstream bytes, and the auth-profile store resolves after admission again, as upstream does. - external-cli-auth-selection.ts isBuiltInClaudeCliProfile bypass (2fe39db), restored to upstream bytes. - status-codex-auth-profile.ts, a byte-equivalent extraction of upstream's resolveCodexSyntheticUsageAuthProfileId. The function is inlined back at upstream's position, and status-text.ts stays under the line cap. - Harness exports used only by the removed suites (back to upstream bytes), plus the fixture's queueOpenAIResolvedModel and waitForRunEvent. What stayed: every continuation hunk in status-text.ts, run-attempt-dispatch.ts and the harness. Forced fix: the deferred-maintenance scenario waited for session A with a bounded setImmediate poll. It passed only because the removed auth suites ran first and warmed the module graph. It fails on the unmodified tree when run alone (-t 'deferred maintenance'). It now waits on a signal from the mocked maintenance wait and fails fast if session A ends first. Refs #1418 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Block 5 follow-up for the openclaw#129388 presentation cut. The remaining run.continuation-* test-supports bundled 27 runEmbeddedAgent cases. 24 of them are upstream tests from run.overflow-compaction.test.ts that upstream deliberately retired in openclaw#118351 (3f85a78). Each one was confirmed by grepping its name in `git show 3f85a78^:src/agents/embedded-agent-runner/ run.overflow-compaction.test.ts`. That makes them drift residue. Home: restored to upstream (retired). Removed, all present in 3f85a78^ and none exercising continuation: - deferred-maintenance (2): same-session wait; global lane not held. - lifecycle-admission (2): captured lifecycle generation; reserved harness ownership revalidated after the queue wait. - model-routing (9): hook-selected models; Ultra revalidation; auth profile into attempts; optional attempt params; non-empty and empty request stream params; Ultra logical/max; session-pinned native model; undersized models. - overflow-recovery (8): implicit Codex overflow; prompt-cache runtime context; preflight empty transcript; Codex promptError blocked payload; truncation budget; rotated compacted transcript; thrown engine-owned compaction; composed abort signal. - retry-fallback (2 upstream): retry_limit; abort-wrapped prompt errors. - retry-fallback (1 fork-added, 2273ef6): "terminates without replay after side effects invalidate the attempt". This is the fork's rewrite of upstream's retired "preserves replay invalidation when retries exhaust after side effects" (3f85a78^, same fixture), with no continuation content. Kept (overflow-recovery, 3 cases): they pin the continuation-owned recovery context-pressure path (recovery-context-pressure.ts -> auto-reply/continuation/context-pressure): - "passes trigger=overflow ..." (upstream name, extended by the fork with continuation config and [system:context-pressure] assertions) - "does not enqueue overflow pressure guidance when continuation is disabled" - "uses the canonical session identity when sessionKey is empty on overflow path" Plumbing: run.overflow-compaction.harness.ts is restored to upstream bytes, except that mockedLog and resetRunOverflowCompactionHarnessMocks are exported for the kept cases and run.continuation-opts-forward.test.ts. Removed: the logicalRef wrapper, the other mock exports, and the line-cap extraction run.overflow-compaction.context-engine.test-support.ts. The continuation fixture is reduced to the three record/log assertions the kept cases use. Refs #1418 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
The compact-large-3 overflow-compaction leaf loaded the full embedded runner for 67 cases and exceeded five minutes in the baseline profile. Most assertions owned local auth, lifecycle, retry-limit, runtime-resolution, or context-recovery policy rather than the complete runner composition.
Why This Change Was Made
Keep four direct compaction-runtime integration tests at the real composition boundary and move 37 policy assertions to their production owners. The rewrite removes more than 3,000 lines of broad harness setup without changing shard assignment, concurrency, production behavior, or the tested contracts.
User Impact
No runtime or user-visible behavior changes. Maintainers get substantially faster feedback with clearer ownership and no meaningful coverage loss.
Evidence
unit-fast,agents-embedded-agent,agents-embedded-agent-overflow-compaction,agents-embedded-agent-run, andagents-support.openai/codexorigin/mainbb5054fe47ab:turn/startedalways terminates with matchingturn/completed, connection closure is a transport-terminal error, and internal server failures are exposed asInternalServerError. Checkedcodex-rs/app-server/README.md:1495,app-server/src/bespoke_event_handling.rs:1271,app-server/tests/common/test_app_server.rs:1005,app-server/src/lib.rs:1003,app-server-client/src/remote.rs:414, andapp-server-protocol/src/protocol/v2/shared.rs:77.git diff --check, max-lines ratchet, local-fix autoreview, and final branch autoreview are clean.