perf: reduce runtime metadata hotpath churn#86659
Merged
Merged
Conversation
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: perf: reduce runtime metadata hotpath churn This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
5cb9791 to
e30ee7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
node scripts/run-vitest.mjs src/talk/turn-context-tracker.test.ts src/plugins/plugin-metadata-snapshot.memo.test.ts src/plugins/manifest-registry-installed.test.ts src/plugins/sdk-alias.test.ts src/plugins/installed-plugin-index-records.test.tsnode scripts/run-vitest.mjs src/plugins/plugin-metadata-snapshot.memo.test.tspnpm test extensions/discord/src/voice/manager.e2e.test.ts --testNamePattern "keeps realtime playback alive|interrupts realtime playback|does not interrupt realtime provider state"pnpm lint --threads=8pnpm exec oxfmt --check src/plugins/plugin-metadata-snapshot.ts src/plugins/plugin-metadata-snapshot.memo.test.ts src/plugins/manifest-registry-installed.ts src/plugins/installed-plugin-index-record-builder.ts src/plugins/sdk-alias.ts extensions/discord/src/voice/realtime.tspnpm tsgo:corepnpm tsgo:extensionspnpm build/Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode commit --commit HEADReal behavior proof
Behavior addressed: CPU profile hotspots from repeated metadata snapshot cloning, repeated plugin path/signature work, Jiti alias normalization, and empty Discord realtime speaker turn churn.
Real environment tested: local OpenClaw checkout on macOS, Node/pnpm repo toolchain.
Exact steps or command run after this patch: focused Vitest plugin/talk tests, focused Discord realtime e2e tests, lint, oxfmt check, core and extension tsgo, full
pnpm build, and autoreview.Evidence after fix: focused plugin/talk tests passed 117 tests across 5 files plus metadata snapshot retest passed 27 tests; focused Discord realtime e2e passed 3 selected tests; lint, build, and type gates passed; autoreview reported no accepted/actionable findings.
Observed result after fix: metadata memo returns the same immutable snapshot without clone-on-hit, provided index inputs remain mutable for callers, symlink package metadata escape remains blocked, deferred turn tracking preserves audio-backed turns, and Discord realtime no-audio turns no longer enter the pending queue/log path.
What was not tested: live Discord voice traffic and a fresh CPU profile comparison after this exact patch.