Skip to content

fix(ci): bound agent owner PR selection to same-directory importers and a declared behavior set - #204346

Merged
obviyus merged 2 commits into
mainfrom
fix/ci-plan-owner-declared-sets
Nov 24, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/ci-plan-owner-declared-sets

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

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.

Replay (PR planner, hybrid, 130-row cap) Before (#204292) After
#204111 (31 files) 12,562 tests / 131 jobs / 36,859 s 967 tests / 21 jobs / 2,881 s (max job 271 s)
#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, #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 #204111 #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
#204292 (unbounded) 12,562 / 36,859 s 12,405 / 36,673 s

Evidence

@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S labels Nov 24, 2026
@obviyus

obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 24, 2026
@clawsweeper

clawsweeper Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This 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.

  • Before: The PR body reports 12,562 selected test files across 131 jobs.
  • After: The PR body reports 967 selected test files across 21 jobs, retaining the four incident tests.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused CI optimization with relevant planner evidence and no discrete code finding; the explicit coverage hold prevents landing.
Proof confidence 🐚 platinum hermit (4/6) This CI-only change supplies planner replay results and production-selector regression coverage; no shipped product entry-point proof is required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Contributors changing agent, compaction, or transport owners receive nearly full-suite PR test plans.
Reason: The maintainer-authored proposal documents substantial modeled savings and the coverage surrendered; its later explicit hold remains binding.

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
Reviewed head: 5d91defe8d65052e696539d556eca0b489719df3
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should agent-owner PRs retain transitive consumers throughout the package, or accept the narrower directory boundary proposed here?
  • Recommendation: Use package coverage: Match the scope named in the author’s hold, accepting the larger reported plan while still reducing the current full closure.
  • Why: The author explicitly paused merging because directory coverage meets the modeled target while package coverage retains more consumers; the discussion records no resolution.

Before merge

  • Await maintainer action - Resolve the directory-versus-package coverage choice and the author’s explicit merge hold.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Agent-owner transitive importer selection and associated tests changes intended behavior with a stated reason (ba2046d: Select distant prompt-cache and compaction consumers missed by aggressive PR traversal after real regressions escaped to scheduled main.)
  • Ordinary aggressive traversal and full-mode behavior keeps the original intent (bbb074a: Bound PR coverage around import hubs while retaining broader full-mode selection.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit ba2046d adds scripts/lib/ci-changed-node-test-plan.mts:444 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ba2046d48e17; files: scripts/lib/ci-changed-node-test-plan.mts)
  • Peter Steinberger: Raw commit bbb074a adds scripts/test-projects.test-support.mts:4405 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bbb074a4a8f4; files: scripts/test-projects.test-support.mts)

PR surface

Tests +16, Docs +1, Other +21. Total +38 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 29 13 +16
Docs 1 5 4 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 22 1 +21
Total 5 56 18 +38

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: This is a useful CI efficiency improvement with a bounded coverage tradeoff and no demonstrated urgent product failure.
  • add merge-risk: 🚨 automation: The diff intentionally removes distant cross-directory tests from aggressive PR selection, changing which regressions CI can catch before merge.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

Label justifications:

  • P2: This is a useful CI efficiency improvement with a bounded coverage tradeoff and no demonstrated urgent product failure.
  • merge-risk: 🚨 automation: The diff intentionally removes distant cross-directory tests from aggressive PR selection, changing which regressions CI can catch before merge.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 23, 2026, 10:14 PM ET / November 24, 2026, 03:14 UTC.

@obviyus
obviyus merged commit 5754fac into main Nov 24, 2026
113 checks passed
@obviyus
obviyus deleted the fix/ci-plan-owner-declared-sets branch November 24, 2026 03:50
@obviyus

obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
…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]>
obviyus added a commit that referenced this pull request Nov 24, 2026
…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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 25, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant