Skip to content

perf: cache review prompt assets#45

Closed
stainlu wants to merge 1 commit intoopenclaw:mainfrom
stainlu:stainlu/perf-cache-review-assets
Closed

perf: cache review prompt assets#45
stainlu wants to merge 1 commit intoopenclaw:mainfrom
stainlu:stainlu/perf-cache-review-assets

Conversation

@stainlu
Copy link
Copy Markdown
Contributor

@stainlu stainlu commented May 5, 2026

Summary

  • cache the static review prompt and decision schema lazily within each ClawSweeper process
  • reuse cached bytes for review policy hashing, item prompt rendering, and the check command
  • keep the schema path passed to Codex stable

Validation

  • pnpm run build
  • node --test test/clawsweeper.test.ts
  • pnpm run lint:src
  • pnpm run lint:scripts
  • pnpm run format:check
  • git diff --check

@steipete
Copy link
Copy Markdown
Contributor

steipete commented May 5, 2026

This caching change is useful, but it needs a rebase against current main. The prompt/schema helper area has moved with the review telemetry work, so please adapt this to the current helper names instead of reintroducing duplicate file reads or parallel cache helpers.

After rebase, please rerun pnpm run check. The behavior to preserve is simple per-process caching of the static review prompt and decision schema while keeping the Codex --output-schema path unchanged.

@stainlu stainlu force-pushed the stainlu/perf-cache-review-assets branch from 0f1691c to 13638d1 Compare May 5, 2026 08:04
@stainlu
Copy link
Copy Markdown
Contributor Author

stainlu commented May 5, 2026

Rebased on current main and reran pnpm run check under Node 24. This now caches the current reviewPromptTemplate() / reviewDecisionSchemaText() helpers and keeps the Codex --output-schema path unchanged.

@steipete
Copy link
Copy Markdown
Contributor

steipete commented May 5, 2026

Landed manually on main as fb9c2f32fd (perf: cache review prompt assets) after resolving the current CHANGELOG.md, src/clawsweeper.ts, and test import conflicts. Kept REVIEW_POLICY_VERSION at v14, preserved the stable Codex --output-schema path, and kept the tracked-file regression. Full local pnpm run check passed before push. Thanks @stainlu.

@steipete steipete closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants