Repository navigation
fix(ci): bound agent owner PR selection to same-directory importers and a declared behavior set - #204346
Conversation
…nd a declared behavior set Co-authored-by: obviyus <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Hold: do not merge. This PR scopes transitive importers to the changed file's directory. The follow-up asked for importers within the same package (2,424 tests / 7,519 s for the #204111 replay, versus 967 / 2,881 s here). Waiting for a coverage decision. |
|
Codex review: blocked before merge. What this changesThis PR narrows agent-owner PR test selection to bounded import traversal, same-directory transitive consumers, and declared prompt-cache and compaction tests. Example: Replay the changed paths from #204111 through the aggressive PR planner.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open and honor the author’s explicit merge hold: this PR offers useful CI savings, but directory versus package coverage remains unresolved; no discrete correctness defect was found. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe CI manifest passes changed paths to the Node test selector, which combines import consumers and explicit owners into test targets for shard planning. flowchart LR
A[Changed PR paths] --> B[CI manifest]
B --> C[Node target selector]
C --> D[Bounded import consumers]
C --> E[Declared behavior tests]
D --> F[Selected test files]
E --> F
F --> G[Node test shards]
Technical reviewBest possible solution: Resolve the recorded coverage choice within the existing selector while retaining the four incident tests and unchanged full-mode coverage. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the unbounded owner traversal; the PR supplies historical planner replays, whose numerical results were not independently rerun during this read-only review. Is this the best way to solve the issue? The patch stays within the existing selection owners and preserves the incident tests, but directory scope cannot settle the explicitly pending package-coverage choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 01640493f9be. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +16, Docs +1, Other +21. Total +38 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 23, 2026, 10:14 PM ET / November 24, 2026, 03:14 UTC. |
Co-authored-by: obviyus <[email protected]>
|
Landed as 5754fac. For agent, compaction, prompt and transport owners, PR CI goes from a full-suite plan to same-directory importers plus a declared behavior set: 967 instead of 12,562 tests for the #204111 replay. The four tests from #204252 are still always selected. Cross-directory misses go into the owner's declared set in the fix PR. |
…nd a declared behavior set (openclaw#204346) ## Result PR CI for agent, compaction, prompt and transport owners goes from a full-suite plan back to a bounded one, about 13x smaller. It still selects the four tests that openclaw#204252 was about. | Replay (PR planner, hybrid, 130-row cap) | Before (openclaw#204292) | After | |---|---|---| | openclaw#204111 (31 files) | 12,562 tests / 131 jobs / 36,859 s | **967 tests / 21 jobs / 2,881 s** (max job 271 s) | | openclaw#204180 (9 files) | 12,405 / 131 / 36,673 s | **302 / 14 / 1,393 s** (max job 250 s) | Both replays select `embedded-agent-runner.prompt-cache.test.ts`, `agent-runner-required-maintenance.pending-input.test.ts`, `agent-runner-compaction-fallback.test.ts` and `session-context-accounting.gateway.integration.test.ts`. ## Change For a changed source file under `src/agents/`, `src/auto-reply/reply/agent-runner*`, `packages/agent-core/src/harness/compaction/` or `packages/ai/src/transports/`, the aggressive PR plan now selects: 1. the normal two-import walk, as for every other file; 2. every transitive importer test **in the changed file's own directory**. A file directly in a package root (for example `src/agents/compaction.ts`) skips this step, because that directory is the whole package (1,795 tests for `src/agents/`); 3. a **declared behavior set**: every `*prompt-cache*` and `*compaction*` test under `src/` and `packages/` (118 files), plus `agent-runner-required-maintenance.pending-input.test.ts` and `session-context-accounting.gateway.integration.test.ts`. A test-only edit under these owners runs itself and does not pull in the declared set. Full mode (manual and hourly) is unchanged and still walks every importer. ## Decision recorded The follow-up asked for "importers within the same package". With the package root as the scope, openclaw#204111 selects 2,424 tests / 7,519 s, which misses the target of about 1,200 tests / 3,700 s. I used the changed file's directory instead, which meets the target. Coverage given up: cross-directory transitive importers, outside the declared set, of a file under these owners. The hourly full plan still runs them. This is reversible: widening the scope is a one-line change. | Variant | openclaw#204111 | openclaw#204180 | |---|---|---| | Declared set only | 369 / 1,888 s | 135 / 1,035 s | | **Same directory + declared (this PR)** | **967 / 2,881 s** | **302 / 1,393 s** | | Same package root + declared | 2,424 / 7,519 s | 308 / 1,393 s | | openclaw#204292 (unbounded) | 12,562 / 36,859 s | 12,405 / 36,673 s | ## Evidence - `ci-changed-node-test-plan.integration.test.ts`: for 7 owners from openclaw#204111 and openclaw#204180, the plan selects the four named tests and every same-directory importer test. - `ci-changed-node-test-plan.selection.test.ts`: the fixture case again expects the two-import stop for a distant consumer in another directory (the pre-openclaw#204292 expectation). - Planner, project and workflow tests (11 files): 1,322 passed. `pnpm check:changed`: pass. ## Coverage decision and closing loop - The maintainer accepted the same-directory scope as the coverage contract for these owners. The local review asked for this decision. - **Closing loop:** when a scheduled red traces to a green PR through a cross-directory importer, the fix PR adds that importer test to the owner's declared set. The declared sets grow only from real misses. - **Measurement:** 24 h after merge, compare agent-core PR rows and wall time with the openclaw#204292 numbers above. Co-authored-by: Ayaan Zaidi <[email protected]>
…toring them fails (#204532) ## Problem 1. **Incognito chats never get a background command's completion turn.** On a scratch Gateway with a real model, an incognito chat runs a background command, replies, and then nothing happens when the command finishes. The completion runs in the async context of the turn that started the command. For an incognito chat, that context holds the turn's session-actor binding and work signal, and both end with the turn. - Before #204265 (`463d7748^`): the live wake fails with `SessionDeliveryGenerationUnavailableError`. - On `main`: `owe()` fails first, and the Gateway logs `[exec] completion was not admitted (Chat session storage admission ended)`. So this predates #204265. #204265 only moved the failure point. 2. **A failed `owe()` drops the result.** Since #204265, `notifyOnExit` stores the result (`owe()`) before it wakes the chat, and its catch only logs a failed `owe()`. Any store failure (busy database, store fence) silently drops a produced result. 3. **Five exec-notification test files went red on scheduled `main`** (run 45348156095); #204507 fixed four. #204265's PR CI did not select them. It changed `src/sessions/owed.ts`, and these tests live in `src/agents/`, past the two-import walk. This is the cross-directory miss the #204346 closing loop covers. ## Solution - `notifyOnExit` stores and wakes outside the producing turn's session-actor binding and work scope (`runWithoutSessionActorStorage`, `runOutsideAsyncWorkScope`). Both are existing helpers for independent work. The completion acquires its own session actor, so incognito chats store the owed row and get their completion turn. - If `owe()` still fails, the completion wakes its chat once through the same live wake, without a stored row. That one result loses restart recovery, and the Gateway logs why. It is never only logged. - #204507 already moved four of the five red files to the owed-row contract (owed-id context keys). The fifth, `bash-process-durable.test.ts`, still counted restart notices by the old slug key `exec:<slug>`; its helper now resolves the adopted process instance (`processSessionInstanceId`). - New `bash-tools.exec-notify.store-failure.test.ts`: `owe()` rejects, and the completion still wakes its chat once. - #204346 closing loop: `src/sessions/owed.ts` is now an owner in `scripts/lib/ci-changed-node-test-plan.mts`. A change to it selects a declared set: the 5 test files and the new store-failure test. A planner test checks that selection. ## Impact - Fixes a pre-existing loss: incognito exec results were also lost before #204265 (baseline b8c95a3 repro). On the measured production deployment: 0 events in the retained ~3.8-day window. - Incognito chats get background command completion turns. - A produced exec result is never only logged when its row cannot be stored. - Ordinary chats: no change (Goal ordering and restart exactly-once re-proven below). - Production: 1 file, +27 −7. ## Evidence - **Incognito, real Gateway** (scratch state and ports, real model; the chat runs a background command, replies `STARTED`, then must answer the completion): - before #204265 (`463d7748^`): no completion turn; `[exec] completion delivery failed (SessionDeliveryGenerationUnavailableError …)`. - `main`: no completion turn; `[exec] completion was not admitted (Chat session storage admission ended)`. - this PR: the completion turn runs (`SEEN_…` reply); no exec warnings, so the owed row was stored. - **Ordinary chats, real Gateway, this PR:** `Exec completed` precedes the Goal's Advance turn and is appended once; a result pending across a Gateway restart is appended exactly once after it (4/4 checks). - **Store failure:** `bash-tools.exec-notify.store-failure.test.ts` fails on `main` (the wake is called 0 times) and passes here. - **Tests (rebased on `main`):** the 5 files plus exec background follow-up, requester, queue-full, yield sweep and planner integration: all pass, except that locally on macOS `bash-process-durable.test.ts` stops at the Darwin ACL guard in `@openclaw/fs-safe` before its assertion (CI on Linux runs it). `server.chat-goal.test.ts` 72/72. `pnpm tsgo:core` passes. - **Planner:** `ci-changed-node-test-plan.integration.test.ts` checks that a change to `src/sessions/owed.ts` selects the 6 declared tests. Co-authored-by: Ayaan Zaidi <[email protected]>
…toring them fails (#204532) 1. **Incognito chats never get a background command's completion turn.** On a scratch Gateway with a real model, an incognito chat runs a background command, replies, and then nothing happens when the command finishes. The completion runs in the async context of the turn that started the command. For an incognito chat, that context holds the turn's session-actor binding and work signal, and both end with the turn. - Before #204265 (`463d7748^`): the live wake fails with `SessionDeliveryGenerationUnavailableError`. - On `main`: `owe()` fails first, and the Gateway logs `[exec] completion was not admitted (Chat session storage admission ended)`. So this predates #204265. #204265 only moved the failure point. 2. **A failed `owe()` drops the result.** Since #204265, `notifyOnExit` stores the result (`owe()`) before it wakes the chat, and its catch only logs a failed `owe()`. Any store failure (busy database, store fence) silently drops a produced result. 3. **Five exec-notification test files went red on scheduled `main`** (run 45348156095); #204507 fixed four. #204265's PR CI did not select them. It changed `src/sessions/owed.ts`, and these tests live in `src/agents/`, past the two-import walk. This is the cross-directory miss the #204346 closing loop covers. - `notifyOnExit` stores and wakes outside the producing turn's session-actor binding and work scope (`runWithoutSessionActorStorage`, `runOutsideAsyncWorkScope`). Both are existing helpers for independent work. The completion acquires its own session actor, so incognito chats store the owed row and get their completion turn. - If `owe()` still fails, the completion wakes its chat once through the same live wake, without a stored row. That one result loses restart recovery, and the Gateway logs why. It is never only logged. - #204507 already moved four of the five red files to the owed-row contract (owed-id context keys). The fifth, `bash-process-durable.test.ts`, still counted restart notices by the old slug key `exec:<slug>`; its helper now resolves the adopted process instance (`processSessionInstanceId`). - New `bash-tools.exec-notify.store-failure.test.ts`: `owe()` rejects, and the completion still wakes its chat once. - #204346 closing loop: `src/sessions/owed.ts` is now an owner in `scripts/lib/ci-changed-node-test-plan.mts`. A change to it selects a declared set: the 5 test files and the new store-failure test. A planner test checks that selection. - Fixes a pre-existing loss: incognito exec results were also lost before #204265 (baseline b8c95a3 repro). On the measured production deployment: 0 events in the retained ~3.8-day window. - Incognito chats get background command completion turns. - A produced exec result is never only logged when its row cannot be stored. - Ordinary chats: no change (Goal ordering and restart exactly-once re-proven below). - Production: 1 file, +27 −7. - **Incognito, real Gateway** (scratch state and ports, real model; the chat runs a background command, replies `STARTED`, then must answer the completion): - before #204265 (`463d7748^`): no completion turn; `[exec] completion delivery failed (SessionDeliveryGenerationUnavailableError …)`. - `main`: no completion turn; `[exec] completion was not admitted (Chat session storage admission ended)`. - this PR: the completion turn runs (`SEEN_…` reply); no exec warnings, so the owed row was stored. - **Ordinary chats, real Gateway, this PR:** `Exec completed` precedes the Goal's Advance turn and is appended once; a result pending across a Gateway restart is appended exactly once after it (4/4 checks). - **Store failure:** `bash-tools.exec-notify.store-failure.test.ts` fails on `main` (the wake is called 0 times) and passes here. - **Tests (rebased on `main`):** the 5 files plus exec background follow-up, requester, queue-full, yield sweep and planner integration: all pass, except that locally on macOS `bash-process-durable.test.ts` stops at the Darwin ACL guard in `@openclaw/fs-safe` before its assertion (CI on Linux runs it). `server.chat-goal.test.ts` 72/72. `pnpm tsgo:core` passes. - **Planner:** `ci-changed-node-test-plan.integration.test.ts` checks that a change to `src/sessions/owed.ts` selects the 6 declared tests. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 0164469) Co-authored-by: RomneyDa <[email protected]>
…toring them fails (openclaw#204532) ## Problem 1. **Incognito chats never get a background command's completion turn.** On a scratch Gateway with a real model, an incognito chat runs a background command, replies, and then nothing happens when the command finishes. The completion runs in the async context of the turn that started the command. For an incognito chat, that context holds the turn's session-actor binding and work signal, and both end with the turn. - Before openclaw#204265 (`7a8c93cd^`): the live wake fails with `SessionDeliveryGenerationUnavailableError`. - On `main`: `owe()` fails first, and the Gateway logs `[exec] completion was not admitted (Chat session storage admission ended)`. So this predates openclaw#204265. openclaw#204265 only moved the failure point. 2. **A failed `owe()` drops the result.** Since openclaw#204265, `notifyOnExit` stores the result (`owe()`) before it wakes the chat, and its catch only logs a failed `owe()`. Any store failure (busy database, store fence) silently drops a produced result. 3. **Five exec-notification test files went red on scheduled `main`** (run 45348156095); openclaw#204507 fixed four. openclaw#204265's PR CI did not select them. It changed `src/sessions/owed.ts`, and these tests live in `src/agents/`, past the two-import walk. This is the cross-directory miss the openclaw#204346 closing loop covers. ## Solution - `notifyOnExit` stores and wakes outside the producing turn's session-actor binding and work scope (`runWithoutSessionActorStorage`, `runOutsideAsyncWorkScope`). Both are existing helpers for independent work. The completion acquires its own session actor, so incognito chats store the owed row and get their completion turn. - If `owe()` still fails, the completion wakes its chat once through the same live wake, without a stored row. That one result loses restart recovery, and the Gateway logs why. It is never only logged. - openclaw#204507 already moved four of the five red files to the owed-row contract (owed-id context keys). The fifth, `bash-process-durable.test.ts`, still counted restart notices by the old slug key `exec:<slug>`; its helper now resolves the adopted process instance (`processSessionInstanceId`). - New `bash-tools.exec-notify.store-failure.test.ts`: `owe()` rejects, and the completion still wakes its chat once. - openclaw#204346 closing loop: `src/sessions/owed.ts` is now an owner in `scripts/lib/ci-changed-node-test-plan.mts`. A change to it selects a declared set: the 5 test files and the new store-failure test. A planner test checks that selection. ## Impact - Fixes a pre-existing loss: incognito exec results were also lost before openclaw#204265 (baseline e5607f8 repro). On the measured production deployment: 0 events in the retained ~3.8-day window. - Incognito chats get background command completion turns. - A produced exec result is never only logged when its row cannot be stored. - Ordinary chats: no change (Goal ordering and restart exactly-once re-proven below). - Production: 1 file, +27 −7. ## Evidence - **Incognito, real Gateway** (scratch state and ports, real model; the chat runs a background command, replies `STARTED`, then must answer the completion): - before openclaw#204265 (`7a8c93cd^`): no completion turn; `[exec] completion delivery failed (SessionDeliveryGenerationUnavailableError …)`. - `main`: no completion turn; `[exec] completion was not admitted (Chat session storage admission ended)`. - this PR: the completion turn runs (`SEEN_…` reply); no exec warnings, so the owed row was stored. - **Ordinary chats, real Gateway, this PR:** `Exec completed` precedes the Goal's Advance turn and is appended once; a result pending across a Gateway restart is appended exactly once after it (4/4 checks). - **Store failure:** `bash-tools.exec-notify.store-failure.test.ts` fails on `main` (the wake is called 0 times) and passes here. - **Tests (rebased on `main`):** the 5 files plus exec background follow-up, requester, queue-full, yield sweep and planner integration: all pass, except that locally on macOS `bash-process-durable.test.ts` stops at the Darwin ACL guard in `@openclaw/fs-safe` before its assertion (CI on Linux runs it). `server.chat-goal.test.ts` 72/72. `pnpm tsgo:core` passes. - **Planner:** `ci-changed-node-test-plan.integration.test.ts` checks that a change to `src/sessions/owed.ts` selects the 6 declared tests. Co-authored-by: Ayaan Zaidi <[email protected]>
Result
PR CI for agent, compaction, prompt and transport owners goes from a full-suite plan back to a bounded one, about 13x smaller. It still selects the four tests that #204252 was about.
Both replays select
embedded-agent-runner.prompt-cache.test.ts,agent-runner-required-maintenance.pending-input.test.ts,agent-runner-compaction-fallback.test.tsandsession-context-accounting.gateway.integration.test.ts.Change
For a changed source file under
src/agents/,src/auto-reply/reply/agent-runner*,packages/agent-core/src/harness/compaction/orpackages/ai/src/transports/, the aggressive PR plan now selects:src/agents/compaction.ts) skips this step, because that directory is the whole package (1,795 tests forsrc/agents/);*prompt-cache*and*compaction*test undersrc/andpackages/(118 files), plusagent-runner-required-maintenance.pending-input.test.tsandsession-context-accounting.gateway.integration.test.ts.A test-only edit under these owners runs itself and does not pull in the declared set.
Full mode (manual and hourly) is unchanged and still walks every importer.
Decision recorded
The follow-up asked for "importers within the same package". With the package root as the scope, #204111 selects 2,424 tests / 7,519 s, which misses the target of about 1,200 tests / 3,700 s. I used the changed file's directory instead, which meets the target. Coverage given up: cross-directory transitive importers, outside the declared set, of a file under these owners. The hourly full plan still runs them. This is reversible: widening the scope is a one-line change.
Evidence
ci-changed-node-test-plan.integration.test.ts: for 7 owners from feat(agents): compact from the warm prompt cache on every route #204111 and fix: compact at 80% on every route #204180, the plan selects the four named tests and every same-directory importer test.ci-changed-node-test-plan.selection.test.ts: the fixture case again expects the two-import stop for a distant consumer in another directory (the pre-fix(ci): select every transitive importer test for agent, compaction and transport owners #204292 expectation).pnpm check:changed: pass.