Skip to content

fix(agents): preserve sibling reroutes and repair Gateway release E2E - #136807

Merged
steipete merged 5 commits into
mainfrom
fix/release-gateway-e2e-shard-4
Sep 3, 2026
Merged

fix(agents): preserve sibling reroutes and repair Gateway release E2E#136807
steipete merged 5 commits into
mainfrom
fix/release-gateway-e2e-shard-4

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where the 2026.9.1 stable release's Gateway E2E validation failed, including a requester wake that dropped a sibling's model-route change notice.

Failure evidence: Full Release Validation, Gateway 4/4 job, release SHA c92d0ae9c07e757719e676517aa9f9460a40761c.

Why This Change Was Made

Requester settle wakes now collect route notices from the same current, deduplicated children as completion findings. Notices are sorted, deduplicated, and bounded to 1,024 characters including an explicit truncation marker. The existing local/shared-channel visibility policy remains authoritative.

The other failures came from fixtures that no longer described current owner contracts:

  • The App SDK worker-service fixture hid missing required methods behind a context cast. It now satisfies WorkerEnvironmentServiceContract and proves execution-mode projection. The call was introduced by fix: prevent incompatible cloud runtime dispatches #126585; fix: keep cloud sessions stopped and surface cleanup failures #135583 removed the method-level optional guard. The real service already implements it.
  • Requester and sibling lifecycle fixtures returned assistant text without a confirmed outbound delivery receipt. They now return terminal send receipts and wait for committed delivery state; failed assertions also release gated delivery work.
  • Doctor's reasonless skipped update is a failed update, not a continuation. The fixture now explicitly supplies the supported already-current no-op and retains the schema-refusal assertion.
  • Four sibling lifecycle cases dated their fresh events in 1970 while the fake clock was in 2026, immediately hitting the delivery deadline. Event timestamps now come from the fixture clock; grace timing and assertions are preserved.

Each independent cause has its own commit. The change restores the existing subagent handoff and delivery contracts without adding configuration, persistence, schema, or protocol changes. Production delta is +27/-10; the net 17 lines implement current-batch aggregation, deterministic ordering, and a bounded prompt block.

User Impact

Parents receive route-change notices from rerouted siblings even when another child triggers the consolidated wake. External-channel parents continue to keep those notices internal. Release validation now exercises realistic environment, update, and delivery contracts.

Related: #136390 addresses overlapping-wave deferral, a separate invariant; this PR does not include that change.

Evidence

All four original failures reproduced in 3/3 runs before edits and passed 3/3 after repairs, using test/vitest/vitest.e2e.config.ts, two workers, and the prepared E2E runtime. Fixture-only proof fixed App SDK, doctor, and rejected-wake tests while the visible-wake test still failed on the missing sibling notice before the production fix.

The final combined E2E run passed 22/22 tests across four files, including the sibling lifecycle suite. The eight initial sibling failures reduced to four after receipt fixes, then zero after correcting event timestamps.

OPENCLAW_E2E_WORKERS=2 OPENCLAW_E2E_USE_PREBUILT_DIST=1 \
node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts \
  packages/sdk/src/app-sdk-composed-resources.e2e.test.ts \
  src/agents/subagents/registry/subagent-registry.requester-wake.e2e.test.ts \
  src/commands/doctor.refuses-newer-database-schemas.e2e.test.ts \
  src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts

The initial invocation omitted OPENCLAW_E2E_USE_PREBUILT_DIST and successfully built the runtime, local plugin artifacts, and subprocess prerequisites. Local proof used macOS and Node 26.8.1; the release job uses Linux and Node 24.19.0.

A recent scheduled main E2E run already had the exact App SDK failure in shard 1 and doctor failure in shard 2. Weighted assignment differed; the requester-wake file was absent from that earlier run. Normal ci.yml does not run this full Gateway E2E matrix.

Owner unit suites passed 107/107 (39 requester-wake, 33 environment, 35 doctor-update). The final requester-wake suite passed again after test consolidation; the two deferred delivery cases also passed after adopting the existing promise helper.

node scripts/run-vitest.mjs \
  src/agents/subagents/announce/subagent-announce.requester-settle-wake.test.ts \
  src/gateway/server-methods/environments.test.ts \
  src/commands/doctor-update.test.ts
pnpm check:changed

pnpm check:changed completed successfully with every selected gate enabled. Earlier attempts identified test-file line limits and an unsupported TypeScript library reference in the test consolidation; duplicate setup was consolidated and the canonical deferred-promise helper reused. No assertions, gates, or type targets were weakened. Final independent Codex review found no actionable P0–P2 issues. Production is +27/-10; tests are +206/-192. The complete Gateway shard and full release matrix have not been rerun; this PR is the focused repair and local proof for the release owner to integrate.

🤖 Generated with Claude Code

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 3, 2026
@steipete
steipete marked this pull request as ready for review September 3, 2026 01:35
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 2, 2026, 11:49 PM ET / September 3, 2026, 03:49 UTC.

ClawSweeper review

What this changes

The branch collects and bounds route-change notices from all current sibling subagent completions in a consolidated requester wake, while updating Gateway E2E fixtures to current contracts.

Merge readiness

Blocked before merge - 2 items remain

Keep this actively maintained, maintainer-labeled PR open. Source review found no introduced blocking defect: it repairs the current-main scheduling-row-only route-notice loss and aligns E2E fixtures with current delivery, environment, and doctor contracts.

Priority: P2
Reviewed head: e56f922ae132f19ac2be9662095eb0df1e392aaf
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with aligned fixture updates and no blocking source finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; the supplied body nevertheless records exact-head focused Gateway E2E before/after runs, which were not re-executed in this read-only review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; the supplied body nevertheless records exact-head focused Gateway E2E before/after runs, which were not re-executed in this read-only review.
Evidence reviewed 7 items Current-main defect: Current main builds completion findings from filtered, deduplicated rows but reads the route-change notice only from the scheduling child, so a different rerouted sibling can be omitted.
Introduced repair: The PR reuses the same current-child selection for findings and route notices, then deduplicates, sorts, and caps notices at 1,024 UTF-16 code units.
Lifecycle caller: The lifecycle scheduler supplies the settled entry and requester origin to the wake owner, establishing why the scheduling child can differ from the sibling that owns the route notice.
Findings None None.
Security None None.

How this fits together

Subagent completion records flow from the registry into a consolidated wake for the parent agent. That wake builds model-visible completion context and returns it through delivery policy, which decides whether route notices remain internal on shared channels.

flowchart LR
  A[Child subagent completions] --> B[Subagent registry]
  B --> C[Current child selection]
  C --> D[Consolidated requester wake]
  D --> E[Channel visibility policy]
  E --> F[Parent agent context]
Loading

Decision needed

Question Recommendation
Should this maintainer-owned repair be landed after the exact-head required checks complete successfully? Land after green exact-head checks: Accept the focused repair because current main still has the scheduling-row-only behavior and the branch covers the sibling route-notice path.

Why: The PR is explicitly maintainer-labeled and the repository policy reserves protected maintainer work for explicit maintainer handling, even though source review found no blocking patch defect.

Before merge

  • Complete next step (P2) - A maintainer should decide whether to land the exact reviewed head after its required exact-head checks finish green.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +17, Tests +14. Total +31 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 27 10 +17
Tests 5 206 192 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 233 202 +31

Review metrics

Metric Value Why it matters
Production versus test delta production +17 net; tests +14 net The production addition is confined to deterministic, bounded aggregation from an existing selected batch; the remaining change refreshes focused E2E and unit fixtures.

Technical review

Best possible solution:

Land a single canonical wake formatter that derives completion findings and route notices from the same current-child batch, retaining the bounded deterministic aggregation and boundary-level coverage.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: construct a settled batch where the scheduling child has no route notice and a current sibling does; fetched main reads only the scheduling child at the wake formatter.

Is this the best way to solve the issue?

Yes: deriving both findings and notices from the existing filtered, deduplicated child selection keeps one authoritative batch boundary and avoids a sibling-specific parallel path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4af3fc294575.

Labels

Label justifications:

  • P2: This is a bounded repair to parent-agent completion context and the associated Gateway E2E coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; the supplied body nevertheless records exact-head focused Gateway E2E before/after runs, which were not re-executed in this read-only review.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Mert Başar: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-03T01:43:51.966Z sha cab7419 :: blocked before merge. :: none
  • reviewed 2026-09-03T03:08:00.258Z sha 7a3f5a6 :: blocked before merge. :: none

steipete and others added 5 commits September 2, 2026 20:42
Root cause: the composed Gateway fixture bypassed required service methods
through a context cast after execution-mode projection became mandatory.
Owner: the App SDK E2E worker-service fixture now satisfies the complete
request-facing contract and asserts supported execution modes.
Proof: the original E2E failed 3/3 before and passed 3/3 after; environment
owner tests pass (33 tests).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Root cause: a reasonless skipped update is a failed update, so the old
fixture exited before reaching its intended database compatibility gate.
Owner: the schema-preflight fixture now declares the supported
already-current outcome and preserves the schema-refusal assertion.
Proof: the original E2E failed 3/3 before and passed 3/3 after; doctor-update
owner tests pass (35 tests). No schema or production behavior changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Root cause: requester and lifecycle fixtures returned text without the
terminal send receipt required for external completion delivery, and
observed RPC calls before their delivery state had committed.
Owner: Gateway-result fixtures now provide confirmed receipts; scenarios
wait on committed cleanup and release gated work even on assertion failure.
Proof: the rejected requester wake failed 3/3 before and passed 3/3 after.
Receipt repairs also resolved four sibling lifecycle failures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Root cause: four retry-grace scenarios emitted 1970 timestamps under the
current fake clock, so the 30-minute delivery deadline had already expired.
Owner: each event producer now records Date.now(); grace advances and
observable delivery assertions remain unchanged.
Proof: all four failed 3/3 with stale timestamps; the corrected sibling
suite passes all 14 tests in the final 22-test Gateway E2E run.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Root cause: the wake read route metadata only from its scheduling child,
so a rerouted sibling disappeared from the parent's consolidated context.
Owner: the requester settle-wake formatter now reuses the current-child
selection, deduplicates and sorts route notices, and caps the aggregate at
1024 characters while preserving local and shared-channel visibility.
Proof: the original visible-wake assertion still failed after fixture-only
repairs and passes after this change. All four reported E2E failures pass
3/3; 39 wake owner tests cover sibling notices, stale owners and the bound.
Production growth is 17 lines for bounded, deterministic batch aggregation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@steipete
steipete force-pushed the fix/release-gateway-e2e-shard-4 branch from 7a3f5a6 to e56f922 Compare September 3, 2026 03:42
@steipete
steipete merged commit 5ecfe38 into main Sep 3, 2026
206 checks passed
@steipete
steipete deleted the fix/release-gateway-e2e-shard-4 branch September 3, 2026 04:21
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…openclaw#136807)

* test(sdk): enforce the worker environment fixture contract

Root cause: the composed Gateway fixture bypassed required service methods
through a context cast after execution-mode projection became mandatory.
Owner: the App SDK E2E worker-service fixture now satisfies the complete
request-facing contract and asserts supported execution modes.
Proof: the original E2E failed 3/3 before and passed 3/3 after; environment
owner tests pass (33 tests).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(doctor): model an explicit no-op before schema refusal

Root cause: a reasonless skipped update is a failed update, so the old
fixture exited before reaching its intended database compatibility gate.
Owner: the schema-preflight fixture now declares the supported
already-current outcome and preserves the schema-refusal assertion.
Proof: the original E2E failed 3/3 before and passed 3/3 after; doctor-update
owner tests pass (35 tests). No schema or production behavior changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(subagents): confirm delivery before asserting requester settlement

Root cause: requester and lifecycle fixtures returned text without the
terminal send receipt required for external completion delivery, and
observed RPC calls before their delivery state had committed.
Owner: Gateway-result fixtures now provide confirmed receipts; scenarios
wait on committed cleanup and release gated work even on assertion failure.
Proof: the rejected requester wake failed 3/3 before and passed 3/3 after.
Receipt repairs also resolved four sibling lifecycle failures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(subagents): timestamp fresh lifecycle events from the fixture clock

Root cause: four retry-grace scenarios emitted 1970 timestamps under the
current fake clock, so the 30-minute delivery deadline had already expired.
Owner: each event producer now records Date.now(); grace advances and
observable delivery assertions remain unchanged.
Proof: all four failed 3/3 with stale timestamps; the corrected sibling
suite passes all 14 tests in the final 22-test Gateway E2E run.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(agents): preserve sibling model reroutes in requester wake batches

Root cause: the wake read route metadata only from its scheduling child,
so a rerouted sibling disappeared from the parent's consolidated context.
Owner: the requester settle-wake formatter now reuses the current-child
selection, deduplicates and sorts route notices, and caps the aggregate at
1024 characters while preserving local and shared-channel visibility.
Proof: the original visible-wake assertion still failed after fixture-only
repairs and passes after this change. All four reported E2E failures pass
3/3; 39 wake owner tests cover sibling notices, stale owners and the bound.
Production growth is 17 lines for bounded, deterministic batch aggregation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant