Skip to content

perf: window review timeline context hydration#67

Open
stainlu wants to merge 2 commits into
openclaw:mainfrom
stainlu:stainlu/perf-window-review-timeline-context
Open

perf: window review timeline context hydration#67
stainlu wants to merge 2 commits into
openclaw:mainfrom
stainlu:stainlu/perf-window-review-timeline-context

Conversation

@stainlu
Copy link
Copy Markdown
Contributor

@stainlu stainlu commented May 12, 2026

Summary

  • Bound issue/PR timeline hydration with GitHub Link header pagination instead of fetching every timeline page before prompt compaction.
  • Preserve ClawSweeper's existing head/tail context shape: earliest events plus latest timeline activity, with an omitted marker in the rendered prompt context.
  • Surface timeline hydration telemetry in review artifacts, matching the existing comments/files/commits count style.
  • Include dashboard/ in the CI sparse checkout so test/dashboard-worker.test.ts can import the dashboard worker during pnpm check.

Why

collectItemContext currently full-paginates issues/{number}/timeline, then keeps only 80 compacted entries. On large OpenClaw threads that means N GitHub REST calls even though the model receives a small prompt window.

With this change, large timeline hydration uses the first page's Link header to jump to the final page range. A 3,000-event timeline goes from 30 timeline API calls to 2 calls for the usual 80-entry prompt window, while keeping the first 40 and latest 40 entries.

Verification

  • pnpm run build
  • pnpm run test:unit
  • pnpm run format:check
  • pnpm exec oxfmt --check --threads=1 .github/workflows/ci.yml src/clawsweeper.ts test/clawsweeper.test.ts
  • git diff --check
  • pnpm run check progressed through active-surface, limits, build:all, lint, and unit tests locally, then failed under local Node 22 in existing repair notifier tests that require the repo's Node >=24 runtime.

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.

1 participant