Repository navigation
feat(perf): separate session and first tool resource costs - #157744
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 3:47 AM ET / 07:47 UTC (Revision 10). ClawSweeper reviewWhat this changesThe Kitchen Sink resource profiler now measures session creation and separates the first tool call from the remaining 19 in its report, with documentation, tests, and a fixture cleanup. Merge readiness✅ Ready for maintainer review Current main still reports session creation outside the measured phases and combines all tool calls into one receipt. This PR supplies distinct measurements, and the reviewed source, real Gateway observations, and merged consumer contract support keeping it as the active change. Priority: P2 Review scores
Verification
How this fits togetherThe opt-in Kitchen Sink profiler runs a fixed workload against an isolated OpenClaw Gateway and samples that process at workload boundaries. It writes a resource report for performance investigations and downstream readers. flowchart LR
A[Resource profile request] --> B[Isolated Gateway]
B --> C[Session creation]
C --> D[First tool call]
D --> E[19 warm tool calls]
B --> F[Boundary snapshots]
C --> F
D --> F
E --> F
F --> G[Resource report]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +325, Other +72. Total +397 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the split in the existing profiling harness and retain the 20-call aggregate and legacy-report compatibility as the report reaches consumers. Do we have a high-confidence way to reproduce the issue? Not applicable: this requests finer profiling output. Current-main source confirms that session creation is unmeasured and tool calls have only an aggregate receipt. Is this the best way to solve the issue? Yes: extending the existing resource-profile harness keeps measurement and report ownership together while preserving the established aggregate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 932abb0a841b. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
* commit '05edd36e124dc376f63475256f45e82ec437412c': (30 commits) refactor(matrix): reuse bounded direct-room cache insertion (#157775) fix: preserve channel-owner revocation across recovery (#157709) fix(ci): stop blocking CI during release validation (#157757) refactor(tlon): remove unreachable DM summary branches (#157789) chore: speed up worktree recovery tests with Bun (#157674) fix(sessions): release PR caches when pending viewers leave (#157776) refactor(twitch): reuse setup account selection (#157787) test: skip empty task ledger resets in cron fixtures (#157767) perf: reduce gateway and state test startup (#157711) fix: preserve maintenance leases during slow heartbeat renewal (#157696) fix(channels): match non-TTY setup advice to registered flags (#157551) fix: keep failed update report uploads in the CLI (#156633) fix: preserve rejected settings reason when opening config (#157731) test(update): load real filesystem dependencies in swap fixture fix(ci): prevent Security Review checkout retry collisions (#157652) fix(ci): recover interrupted Security Review response bodies (#157651) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131) refactor(msteams): share stored service URL validation (#157706) ...
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review current head |
|
🦞👀 Re-review progress:
|
…4-prep * commit '8fe893da516ebdc817692fb2d272e27bc3c88376': (31 commits) fix(test): wait for reload admission before restart polling (#157964) refactor(mattermost): reuse DM retry option selection (#157800) chore(i18n): refresh native locales (#157850) perf(sessions): reuse current participants across transcript appends (#157622) refactor(signal): share pending transport migration results (#157777) fix(tui): open model pickers without waiting for the Gateway (#157839) fix(gateway): apply config despite delayed file notifications (#157906) fix(auth): clear deleted account selections and support account recovery (#157745) fix: plugin reloads lose tool results and strand subagent settlement (#157339) fix(gateway): avoid preview errors during worker metadata updates (#157943) refactor(diffs): reuse native promisify for compression (#157835) fix(models): keep current choices on the first picker page (#157869) fix(plugins): retain existing quarantine across unrelated reloads (#157907) fix(openai): prioritize ChatGPT sign-in and clarify auth choices (#157792) chore(ui): refresh control ui locales (#157955) fix(ui): refresh connected accounts after auth changes (#157950) fix(scripts): avoid redundant npm version process in package checks (#157809) refactor(usage): capture hosted pricing once per operation (#157838) refactor(ui): share slash-command failure results (#157649) fix(cron): announce runs miss the channel's formatting rules (#157877) ...
|
@clawsweeper re-review Exact head: 9cc07c4. This incorporates the landed Gmail fixture repair in #157964. All five profiler contribution files and the complete contribution patch remain byte-identical to the previously reviewed source; the PR body preserves the historical runtime scope and required new-head CI gap. |
|
🦞👀 Re-review progress:
|
…4-prep * commit 'cb64558f80bcf053ee3f0bf87a60016aa789a287': fix(macos): stop repeated Keychain prompts after access is denied (#157951) test(macos): await cron fixture readiness before polling feat(release): add the resumable release:stable orchestrator (#157941) fix(plugins): report retained-work settlement once (#157836) fix(doctor): preserve current sessions after restored-index replay (#157615) chore(ui): refresh control ui locales (#157978)
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review bf3aecc — fixed-main integration preserves all five profiler files and the released-host harness closure; the sixth file only removes our duplicate baseline assignment, restoring the canonical concurrent fixture fix. Updated evidence and scope are in the PR body. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Related: #155730
What Problem This Solves
The resource profile hides session creation and mixes the first tool call with later calls, so maintainers cannot distinguish those costs.
User Impact
The existing profiling mode reports one asserted session creation plus first-call and warm-call costs. Normal Gateway behavior and the workload's one session and 20 tool calls are unchanged.
Why This Change Was Made
The canonical measurement helper splits the original tool workload into first (1) and warm (19) receipts sharing one midpoint snapshot. The existing 20-call aggregate still uses its outer raw snapshots; it must not be added to its children. Failed observations preserve completed-call counts and stop further work, while later failure retains a successful first receipt.
These are whole-Gateway measurements in an already started host, including midpoint sampling overhead. They do not isolate schema construction, cold loading, plugin allocation or child CPU. Session and tool work have no empty-host subtraction.
This integration also removes one duplicate baseline assignment introduced when the concurrent canonical survivor fixture fix and PR #157996 landed together. The final fixture is byte-identical to the canonical fix; its strict shell checks and all assertions remain intact.
Evidence
f0a24a62, genuine published OpenClaw 2026.9.6 hosteb377ac5, Kitchen Sink fixture051db418, and Crabpot consumer43782aa7. One immutable image ran network-isolated with 2 CPUs/4 GiB. Fixture packing verified committed contents; the host archive matched its pinned SHA-256 and release integrity. This does not claim a full candidate core build or a pnpm-frozen image dependency closure.bf3aeccb0b85cafb6ead6579163c78c4c4bb7c7dintegrates frozen fixed main6f51289a. All original five contribution blobs and their complete patch remain identical to reviewedf0a24a62; all eighteen local runtime dependency modules and the optional pnpm runner are unchanged. The historical focused/runtime evidence therefore retains its original harness/released-host scope. No Gateway rerun or whole integrated-core runtime claim is made.Release-note context: distinguish session creation and first tool invocation from warm tool costs in resource profiling.