Skip to content

perf(gateway): reuse ancestor child contributions - #186389

Merged
steipete merged 4 commits into
mainfrom
steipete/perf-micro-ancestor-broadcast-stalls-20260919
Oct 28, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/perf-micro-ancestor-broadcast-stalls-20260919

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Progress events from one subagent repeatedly checked every sibling for every viewer. A parent with 500 children and 20 viewers performed 10,040 membership reads per event, making busy ancestor broadcasts expensive on the Gateway main thread.

User Impact

Large subagent trees require less main-thread CPU and allocation to publish session events. Recipient-visible rows, wire fields, authorization and timestamp refresh behavior are preserved.

Why This Change Was Made

The resident projection now updates child activity and disclosure contributions from the owning row, registry and membership changes. Descendant counts retain individual contributions across clock views. The event presenter consumes those prepared facts instead of scanning all siblings again.

Current runtime ownership, scheduler reservations, clock expiry and rewinds still invalidate the relevant facts. Private rows keep frame-scoped preparation, and deletion, archive demotion and disposal release retained parent state. The changed-parent refresh from #185954 remains intact.

This replaces the repeated sibling loops rather than adding a parallel presentation path. Production LOC grows because exact incremental disclosure and activity require reverse dependencies, bounded audience state, clock deadlines and explicit lifecycle invalidation; a parent-only cache would violate those contracts. Final LOC accounting is below with the measurements.

Evidence

Acceptance was declared before measurement: membership reads per event independent of 50/150/500 children with 20 distinct viewers, lower main-thread CPU and sampled allocation, and identical normalized payload hashes. The owner harness uses the real lifecycle publisher, resident/prepared rows and recipient delivery planner with synthetic sinks. Timing and allocation are separate, serial AB/BA pairs. Generated ancestor revision IDs are normalized; payload fields are otherwise compared byte-for-byte.

Steady-event measurements compare base 61722900dfe21a411f08325f32943a87571760c9 with reviewed candidate 8844bbf6ff5f. Subsequent repairs moved the unchanged child calculation and its types to acyclic modules and corrected test/benchmark fixtures. Final head is 20f66c7546a78534392f34e7d25009356ba1b4dd, rebased onto b0961419e46b72a7b5e0b5f3fd509b58d1bbfbfc. The supplemental state pass below verifies byte-identical runtime/support/harness files against this final head. Two serial AB/BA pairs, 1,000 events per arm, 20 distinct viewers; separate untraced timing and sampled-allocation passes. All 24 steady-arm payload digests match across revisions. Clock fixed for reproducibility; advancing-clock behavior has a separate regression. CPU uses process.threadCpuUsage() on the main thread.

Children Membership reads/event B → C CPU ms/event B → C Sampled MB/event B → C Consume mean ms B → C >100 ms consumes B → C
50 1040 → 40 1.328 → 0.524 2.141 → 0.901 1.301 → 0.503 0 → 0
150 3040 → 40 3.074 → 0.476 4.776 → 0.887 3.026 → 0.454 0 → 0
500 10040 → 40 9.505 → 0.444 14.325 → 0.876 9.436 → 0.422 0 → 0
Per-arm timing, host load and memory context

Each timing row has 1,000 consume samples. Memory is process RSS / heap used in MiB, before → after; these are snapshots, not retained-heap claims. Load is host 1-minute load before → after. Allocation-pass timings are excluded from latency claims.

Mode Children Pair Arm Consume p99 / max ms Host load RSS MiB Heap MiB
timing 50 1 base 3.211 / 4.455 30.8 → 30.8 1118.3 → 1177.4 169.1 → 172.3
timing 50 2 base 1.732 / 2.157 26.1 → 26.1 1186.6 → 1218.7 169.1 → 173.4
timing 50 1 candidate 1.424 / 2.528 37.0 → 37.0 1116.5 → 1119.3 177.0 → 211.5
timing 50 2 candidate 1.118 / 2.775 31.7 → 31.7 1116.1 → 1083.6 177.0 → 211.3
allocation 50 1 base — 10.9 → 10.7 1233.6 → 1361.0 169.3 → 174.5
allocation 50 2 base — 17.8 → 17.0 1106.7 → 1306.7 169.2 → 174.0
allocation 50 1 candidate — 11.2 → 11.2 1115.6 → 1164.1 177.0 → 211.5
allocation 50 2 candidate — 13.9 → 13.5 1116.0 → 1181.7 176.9 → 211.6
timing 150 1 base 3.806 / 4.837 20.6 → 19.6 1219.6 → 1299.9 171.5 → 175.8
timing 150 2 base 3.685 / 4.099 14.1 → 13.7 1252.9 → 1317.5 171.7 → 175.0
timing 150 1 candidate 0.977 / 1.506 17.3 → 17.3 1128.2 → 1090.3 179.6 → 199.1
timing 150 2 candidate 0.893 / 1.198 15.0 → 15.0 1163.7 → 1109.1 179.5 → 198.6
allocation 150 1 base — 14.5 → 13.6 1224.5 → 1408.5 171.7 → 177.3
allocation 150 2 base — 17.7 → 19.1 1294.2 → 1447.4 171.7 → 175.5
allocation 150 1 candidate — 12.0 → 12.0 1147.6 → 1179.0 179.5 → 199.2
allocation 150 2 candidate — 17.7 → 17.7 1201.1 → 1198.8 179.6 → 199.2
timing 500 1 base 11.386 / 12.513 15.5 → 14.8 1367.5 → 1355.5 179.7 → 212.9
timing 500 2 base 10.772 / 11.781 10.8 → 10.7 1360.4 → 1348.5 179.6 → 182.9
timing 500 1 candidate 0.854 / 1.074 12.7 → 12.7 1157.6 → 1165.8 186.6 → 194.9
timing 500 2 candidate 0.800 / 1.138 11.6 → 11.6 1187.5 → 1194.2 186.7 → 195.0
allocation 500 1 base — 16.8 → 29.9 1394.1 → 1740.4 179.7 → 200.2
allocation 500 2 base — 21.7 → 18.4 1326.1 → 1656.6 184.3 → 216.6
allocation 500 1 candidate — 24.8 → 23.4 1193.0 → 1266.7 186.6 → 195.2
allocation 500 2 candidate — 19.8 → 19.8 1134.6 → 1214.8 186.7 → 194.8

Production source delta: +911 lines (benchmark +86 separately; tests net zero). This is deliberately larger than a memo: the new state replaces repeated sibling derivation while preserving live disclosure, subtree runtime ownership, clock-dependent expiry, archive eviction and frame-private rows. No per-tick coalescing is added, because it would change event ordering; unchanged prepared ancestor contributions and recipient rows are reused instead.

Reproduce each owner arm with the header-documented scripts/perf/session-event-ancestors-measure.ts options (--arm candidate --shape wide --sessions 51 --clients 20 --pairs 1 --events 1000, then 151/501 sessions; separate --allocations passes). The comparison used frozen source overlays from the two revisions.

The final counter regression fails on current main 053da3a9bad240aa67482ae11b07dc5fce1e2200 at 1,020 / 3,020 / 10,020 reads for prepared parent rows (limit 40). The candidate passes at all three sizes using valid public viewer policy. Canonical prepared invited-filter proof separately covers membership revoke/regrant, exact visible child rows, and stable exclusion keys after equivalent cycles. A separate clock-advance regression caught and now prevents stale snapshotAt when one child finishes while another remains active. Reservation-only queued-grandchild changes and repeated equivalent exclusion states are also covered.

Final focused proof: six files / 91 tests passed (registry queries, run liveness, scheduler, event parity, presentation, sharing policy); eager-import and PR-wrapper closure proof passed 32 tests. Earlier focused prepared-read, lineage, projection, archive and retention tests also passed. Scoped format/lint and export-collision checks passed. Core typechecking passed during implementation. Final-head CI passed on 20f66c7546a78534392f34e7d25009356ba1b4dd, including production/test types, architecture, baseline ratchets, selected test shards and built-artifact checks. No baseline or ceiling was raised.

Initial CI found import cycles, invalid stored-status and role fixtures, and the added-test-line ratchet. Those are repaired: fixtures use canonical status/policy owners, shared contracts are acyclic, and repeated fixtures/assertions were consolidated without dropping authority cases. The final ratchet passes with zero net test lines despite main exceeding the raw ceiling. A later test-type check caught an over-specific assertion helper input; it now requires only the runId field shared by full and prepared records, without a cast or runtime change.

Independent subagent review (autoreview route unavailable) is clean after addressing its findings. The requested autoreview provider failed the helper's configured-route preflight; no configuration was changed.

The isolated Gateway fixture failed its premeasurement census. Under the explicitly approved fast path, this PR uses owner proof and focused tests plus CI; it does not claim whole-Gateway GC, event-loop or RPC latency results. No production load was started.

Supplemental persisted-state churn

Alternates a child’s canonical done/failed stored state before each publication. Base 50bb32ef09475b3f91e30ad0d9ec78a2c213a8e8; candidate runtime/support/harness hashes match final head. Two AB/BA timing pairs, 1,000 events per arm and 20 viewers: 12,000 events / 240,000 measured viewer frames, with matching wire hashes in every pair. Membership work is constant; the full write/refresh pipeline still has other costs that grow with tree size.

Children Reads/event B → C Main CPU ms/event B → C Consume mean ms B → C Consume p99 mean ms B → C >100 ms consumes B → C
50 1040 → 60 2.955 → 2.012 1.569 → 0.769 2.125 → 1.077 0 → 0
150 3040 → 60 6.080 → 2.764 3.784 → 0.994 5.479 → 1.407 0 → 0
500 10040 → 60 16.905 → 5.752 12.780 → 1.984 18.797 → 4.947 0 → 0
State-pass per-arm context

Each row has 1,000 latency samples. Memory is RSS / heap used in MiB, before → after; host load is the 1-minute value.

Children Pair Arm Consume p99 / max ms Host load RSS MiB Heap MiB
50 1 base 2.212 / 4.860 8.9 → 9.3 1262.2 → 1338.0 175.8 → 205.6
50 2 base 2.038 / 2.574 10.7 → 10.7 1266.8 → 1340.3 176.2 → 224.3
50 1 candidate 1.071 / 1.515 9.0 → 9.0 1274.0 → 1336.0 175.9 → 217.9
50 2 candidate 1.082 / 1.559 12.5 → 12.0 1263.8 → 1293.9 175.9 → 222.9
150 1 base 5.529 / 7.914 9.2 → 8.9 1336.6 → 1358.5 176.5 → 195.1
150 2 base 5.429 / 11.574 11.5 → 10.5 1344.2 → 1365.5 176.5 → 220.0
150 1 candidate 1.352 / 1.601 8.9 → 8.9 1210.8 → 1333.6 175.4 → 204.7
150 2 candidate 1.461 / 2.288 10.7 → 10.6 1242.4 → 1359.8 180.0 → 212.0
500 1 base 19.241 / 29.881 12.5 → 14.5 1807.9 → 1425.8 199.9 → 235.3
500 2 base 18.353 / 35.931 10.7 → 9.8 1807.4 → 1394.9 199.9 → 222.2
500 1 candidate 3.048 / 16.467 15.7 → 14.4 1428.0 → 1382.6 183.9 → 223.5
500 2 candidate 6.847 / 16.996 14.7 → 13.4 1441.9 → 1386.1 183.8 → 223.6

Optional state allocation was omitted under a predeclared compute/CI decision before any allocation pair completed. One already-started baseline arm is diagnostic only. The complete steady allocation comparison above remains the allocation evidence.

Final-delivery authority proof

Supplemental proof on 660345898e8a (runtime bytes unchanged on final head) used the existing real Gateway connection/broadcaster, canonical committed session writes, registry, and three synthetic socket recipients with valid public viewer policy. A temporary extension of the event-parity fixture captured 24 fresh JSON frames and was restored byte-for-byte afterward (one selected test passed). Both nested and top-level childSessions, plus swarm children, were checked at final recipient delivery; per-recipient sequence numbers strictly increased.

Phase sessions.changed seq session.message seq Owner child / swarm Both unrelated viewers child / swarm
Warm shared caches 17 21 child / child child / child
Commit draft during owner's send 18 22 child / child omitted / empty
Regrant shared 19 23 child / child child / child
Commit draft before broadcast 20 24 child / child omitted / empty

Thus warmed disclosure is invalidated before later recipients in the same fan-out. This is public sharing-visibility proof; invited-membership revocation remains separately covered through its canonical prepared-policy owner because public invitation-policy configuration is not activated. No production Gateway or user data was involved.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T00:23:08.115770Z 20f66c7 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper

clawsweeper Bot commented Oct 27, 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 gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 27, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR retains child activity and visibility contributions so ancestor event presentation avoids repeatedly scanning every sibling for every viewer.

Example: A parent has 500 children and 20 viewers receiving subagent progress events.

  • Before: The reported benchmark performs 10,040 membership reads per event.
  • After: The reported candidate performs 40 membership reads per event with matching normalized payloads.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The performance direction is useful, but concrete architecture, typing, and test-budget blockers remain alongside incomplete authority-chain proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Large subagent trees spend avoidable Gateway main-thread CPU and allocation publishing progress events.
Reason: The maintainer-authored direction has substantial reported work-count and CPU gains, and preserves the existing event and presentation owners.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep open: this maintainer-authored PR addresses measurable Gateway overhead, but introduces an import cycle, an invalid typed test configuration, and test growth that fails the repository ratchet.

Priority: P2
Reviewed head: d8d9aa7a4afa427a0208d0f4f3c39bcb8f2d8299

Before merge

  • Add real behavior proof - Authority-chain proof required: the owner benchmark exercises lifecycle publication with unrestricted synthetic recipients, and the new membership regression checks presentation; neither demonstrates warmed child and swarm disclosure rejecting an unrelated or revoked viewer at final delivery. Supply captured frames or redacted logs for that boundary, removing credentials and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Break the new runtime value import cycle (P2) - Importing projectGatewaySessionRunState here closes session-utils-projection → session-utils-display → session-utils-store → session-utils-model → session-utils-projection. This makes both import-cycle architecture guards fail on this head. Place the shared child-contribution calculation below these mutually dependent presentation modules, or pass the existing run-state result into it, so both callers reuse the calculation without the back edge.
  • Use the internal invitation-policy boundary in this fixture (P2) - rolePolicyConfig returns OpenClawConfig, whose role definition is derived from GatewayOperatorRoleDefinitionSchema; that schema accepts only none, view, suggest, and write. Assigning others='invited' therefore creates a TypeScript assignment error in the new test. Existing invitation tests pass the policy through prepareSessionSharing's typed internal sessionCap boundary because public configuration activation belongs to separate work. Preserve that separation instead of widening public configuration or casting away the error in this performance PR.
  • Consolidate the added tests within the active line ratchet (P2) - This change adds 323 net test and test-support lines while the tree is already over its ceiling. The ratchet only permits non-growing changes in that state, so the added coverage makes test-lines and baseline-ratchets fail; the PR body acknowledges this is still being repaired. Consolidate the new work-count, revocation, clock, and reservation cases into existing fixtures without removing their distinct behavioral assertions or raising the ceiling.
  • Resolve security concern: Retained child disclosure now depends on invalidation - A clean audience cache returns without invoking canRead; safety therefore depends on membership and sharing publications dirtying every affected child and swarm dependency before delivery. The existing final-delivery membership test covers top-level event admission, while this patch's new revocation test stops at presented child lists.
  • Resolve merge risk - The author must establish that retained child and swarm disclosure cannot survive membership revocation at final recipient delivery.

Findings

  • [P2] Break the new runtime value import cycle — src/gateway/session-utils-projection.ts:35
  • [P2] Use the internal invitation-policy boundary in this fixture — src/gateway/session-row-event-parity.test.ts:444-445
  • [P2] Consolidate the added tests within the active line ratchet — src/gateway/session-row-event-parity.test.ts:433-436
  • [medium] Retained child disclosure now depends on invalidation — src/gateway/session-row-child-visibility.ts:227

Tests

  • Low-value test src/agents/subagents/swarm/swarm-scheduler.test.ts: Remove the added exact revision-increment assertions: they pin internal bookkeeping already exercised through the queued-grandchild presentation regression.
  • Missing end-to-end proof: Show allowed, unrelated, and revoked viewers at final ancestor-event delivery with warmed child and swarm visibility caches, using redacted logs or captured frames.
Agent review details

How this fits together

The Gateway resident session projection combines stored lineage, registry activity, clocks, and viewer membership into session rows delivered in lists and lifecycle events.

flowchart TD
  A[Session and membership publications] --> B[Resident session projection]
  C[Run registry and scheduler] --> B
  B --> D[Child contributions and visibility]
  D --> E[Recipient row presentation]
  E --> F[Lifecycle event delivery]
Loading

Technical review

Best possible solution:

Retain incremental contributions under the existing projection owner, break the display import cycle, and consolidate valid regression coverage within the test budget.

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

Current main contains the repeated per-child presentation and membership loops, and the supplied owner measurements quantify their scaling; no target code was executed during this review.

Is this the best way to solve the issue?

Projection-owned incremental contributions fit the existing ownership model, but the shared child helper must avoid importing a higher-level display dependency that closes a runtime cycle.

Full review comments:

  • [P2] Break the new runtime value import cycle — src/gateway/session-utils-projection.ts:35
    Importing projectGatewaySessionRunState here closes session-utils-projection → session-utils-display → session-utils-store → session-utils-model → session-utils-projection. This makes both import-cycle architecture guards fail on this head. Place the shared child-contribution calculation below these mutually dependent presentation modules, or pass the existing run-state result into it, so both callers reuse the calculation without the back edge.
    Confidence: 0.99
  • [P2] Use the internal invitation-policy boundary in this fixture — src/gateway/session-row-event-parity.test.ts:444-445
    rolePolicyConfig returns OpenClawConfig, whose role definition is derived from GatewayOperatorRoleDefinitionSchema; that schema accepts only none, view, suggest, and write. Assigning others='invited' therefore creates a TypeScript assignment error in the new test. Existing invitation tests pass the policy through prepareSessionSharing's typed internal sessionCap boundary because public configuration activation belongs to separate work. Preserve that separation instead of widening public configuration or casting away the error in this performance PR.
    Confidence: 0.99
  • [P2] Consolidate the added tests within the active line ratchet — src/gateway/session-row-event-parity.test.ts:433-436
    This change adds 323 net test and test-support lines while the tree is already over its ceiling. The ratchet only permits non-growing changes in that state, so the added coverage makes test-lines and baseline-ratchets fail; the PR body acknowledges this is still being repaired. Consolidate the new work-count, revocation, clock, and reservation cases into existing fixtures without removing their distinct behavioral assertions or raising the ceiling.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cc7380924bdb.

Merge-risk options

Maintainer options:

  1. Verify cached disclosure at delivery (recommended)
    The author should exercise a warmed ancestor cache through recipient delivery for an allowed viewer, an unrelated viewer, and a viewer whose child membership is revoked before delivery.

Provenance checked

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete disclosure exploit was established, but retained audience decisions need final-delivery revocation evidence.

Evidence

Security concerns:

  • [medium] Retained child disclosure now depends on invalidation — src/gateway/session-row-child-visibility.ts:227
    A clean audience cache returns without invoking canRead; safety therefore depends on membership and sharing publications dirtying every affected child and swarm dependency before delivery. The existing final-delivery membership test covers top-level event admission, while this patch's new revocation test stops at presented child lists.
    Confidence: 0.94

What I checked:

  • Reviewed revision and merge state: The live PR remains open and non-draft at the reviewed SHA; GitHub reports mergeable=true and mergeable_state=blocked. (d8d9aa7a4afa)
  • Performance evidence: The full PR body reports separate counterbalanced timing and allocation measurements through the lifecycle publisher and resident projection with synthetic sinks; all 24 arm payload digests reportedly match. (scripts/perf/session-event-ancestors-measure.ts:244, d8d9aa7a4afa)
  • Introduced runtime cycle: The new value import closes session-utils-projection → session-utils-display → session-utils-store → session-utils-model → session-utils-projection; the architecture check annotations identify both import-cycle guards as failing. (src/gateway/session-utils-projection.ts:35, d8d9aa7a4afa)
  • Unsupported configuration in added test: The added test assigns others='invited', while GatewayOperatorRoleDefinition derives from the config schema whose enum accepts only none, view, suggest, and write. (src/gateway/session-row-event-parity.test.ts:445, d8d9aa7a4afa)
  • Test-budget failure: The introduced diff adds 323 net test and test-support lines; the test-lines check fails, and the PR body explicitly acknowledges that this growth needs consolidation. (scripts/check-test-lines-ratchet.mts:143, d8d9aa7a4afa)
  • Authorization proof boundary: The new cache reuses an audience's disclosure result without calling canRead when no dependency is dirty; the added revocation regression checks presented child lists, while the benchmark delivers only to unrestricted viewers. (src/gateway/session-row-child-visibility.ts:227, d8d9aa7a4afa)

PR surface

Source +908, Tests +323, Other +86. Total +1317 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 14 1066 158 +908
Tests 6 513 190 +323
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 103 17 +86
Total 21 1682 365 +1317

Review metrics

Metric Value Why it matters
Production versus proof code Runtime production +908 lines; tests and test support +323; benchmark +86. The retained contribution machinery explains production growth, while the test growth independently exceeds the active ratchet.

Labels

Label changes:

  • add P2: This is a measurable performance improvement for large subagent trees with limited general-user urgency.
  • add merge-risk: 🚨 security-boundary: The patch retains audience-specific child disclosure decisions across calls, making correct membership invalidation part of the authorization boundary.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: This is a measurable performance improvement for large subagent trees with limited general-user urgency.
  • merge-risk: 🚨 security-boundary: The patch retains audience-specific child disclosure decisions across calls, making correct membership invalidation part of the authorization boundary.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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 October 27, 2026, 7:57 PM ET / 23:57 UTC.

@steipete
steipete force-pushed the steipete/perf-micro-ancestor-broadcast-stalls-20260919 branch from d8d9aa7 to 6603458 Compare October 28, 2026 00:09
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the findings against the earlier head in 660345898e8a31ca3fa8867a9e0c03151561dfbe: import boundaries are repaired, the invitation fixture uses the typed prepared-policy owner, and the test-line ratchet passes with net zero test growth. Independent follow-up review is clean; 91 focused tests and 32 closure tests passed.

The PR body now also includes final-delivery proof from 24 captured synthetic frames. For both event kinds, committing a child’s shared→draft change during the owner’s socket send immediately removes nested/top-level child disclosure and swarm children for both later viewers in that same fan-out. The owner retains access; regrant restores disclosure; a later pre-broadcast revocation hides it again. This uses the real broadcaster, committed accessor writes and resident projection, with valid public viewer policy. Membership revoke/regrant is separately covered at the canonical prepared-policy owner. The temporary proof fixture was restored byte-for-byte; final-head CI continues on unchanged source.

@steipete
steipete force-pushed the steipete/perf-micro-ancestor-broadcast-stalls-20260919 branch from 6603458 to 20f66c7 Compare October 28, 2026 00:19
@steipete
steipete merged commit e5206cb into main Oct 28, 2026
145 of 146 checks passed
@steipete
steipete deleted the steipete/perf-micro-ancestor-broadcast-stalls-20260919 branch October 28, 2026 00:37
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
* perf(gateway): reuse ancestor child contributions

* test(perf): use terminal states in ancestor churn fixture

* fix(gateway): keep ancestor projection imports acyclic

* test(subagents): accept prepared run identities in assertions
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 28, 2026
… line caps

U9 brought subagent-registry-queries.ts to 698 counted lines (openclaw#186389)
and subagent-registry-lifecycle-wake.ts to 700 (openclaw#186443). The fork's
additions pushed them to 738 and 703, past the 700 cap.

- The continuation-only reads (child-run liveness for orphan reap,
  requester ancestry) move to subagent-registry-queries.continuation.ts;
  subagent-registry-read and work-dispatch-execution import them there.
- The requester-turn binding folds into upstream's existing window
  predicate as one ternary: a child bound to the requester turn
  matches by id, otherwise upstream's window applies. Bounds exist only
  for a requester run, so the result equals the fork's former filter.
- The spawn-custody guard joins upstream's owner early-return; `entry`
  is computed first and has no side effects, so behaviour is unchanged.

RED at 3178f4f: check:line-cap-ratchet, lifecycle-wake 700 -> 703,
queries 700 -> 738. GREEN: ratchet bare and --base 8ea3ef8 0 (both
files at 700); tsgo:core 0; oxlint clean; queries (incl.
requester-window, raw-owner), registry-read, run-liveness,
lifecycle-wake retry and work-dispatch suites green.

Refs karmaterminal/openclaw-bootstrap#1727
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant