Repository navigation
perf: lazy-load token burden command - #35
Closed
infectiousstupidity wants to merge 125 commits into
Closed
infectiousstupidity wants to merge 125 commits into
infectiousstupidity wants to merge 125 commits into
Conversation
Added a link to the token-burden tool in the README.
* style: fix import formatting * chore: remove gpt-tokenizer from knip ignoreDependencies * docs: update AGENTS.md for BPE tokenization * fix(ci): install gitleaks binary in GitHub Actions * chore: remove gitleaks from project * docs: update README token estimation section for BPE
Removed the token burden screenshot and related table from the README.
…ackage discovery Addresses code review findings: - P1: Resolve relative disable paths from settings base dir (not CWD) - P1: Normalize disabled paths consistently in discovery and persistence - P2: Scan configured skill paths and package paths from settings - P2: Fail fast with rollback on frontmatter write failures - P3: Remove unused @fast-check/vitest dependency
- TmuxHarness class wraps tmux lifecycle (start, sendKeys, capture, waitFor, stop) - Separate vitest.config.e2e.ts with 30s test timeout - Main vitest config excludes src/e2e/ so pnpm run test stays fast - knip entry updated to include e2e test files - Smoke test: starts pi, opens /token-burden overlay, asserts title visible
- Verifies title, context bar, stacked bar, section table render - Cursor indicator present on first row - Down arrow navigation wraps at boundaries - Drill-down into AGENTS.md children and esc back - Esc from sections closes overlay
- Settings isolation via PI_CODING_AGENT_DIR pointing to temp directory - Robust section navigation (searches for Skills row, not positional) - Tests: skill list rendering, navigation past 8 rows (P1 regression), state cycling, pending changes counter, Ctrl+S save, discard confirmation (y/n), fuzzy search filtering
Ultracite's jest plugin overrides (no-hooks, max-expects, etc.) run in an override block that takes precedence over local config — oxlint does not merge overrides from extended configs with local overrides for the same glob. Ignoring only src/e2e/ keeps lint coverage for unit tests while exempting e2e tests that legitimately need hooks, multi-assert, and conditional screen parsing.
Adds end-to-end tests that launch pi in tmux, interact with the /token-burden overlay via keystrokes, and assert on captured screen output. - TmuxHarness class (start, sendKeys, capture, waitFor, stop) - Overlay tests: rendering, navigation, drill-down, close - Skill-toggle tests: state cycling, save, discard, fuzzy search - Separate vitest config (30s timeout), pnpm run test:e2e - Settings isolation via PI_CODING_AGENT_DIR - 67 unit tests + 15 e2e tests, all passing
sandcastle: issue #28 — Sandcastle synthetic smoke: staged documentation marker
fix: harden Sandcastle AFK publication contracts
docs: preserve combined taxonomy decisions
github-actions
Bot
force-pushed
the
perf/lazy-runtime-loading
branch
from
October 22, 2026 09:25
7306605 to
26f0a5e
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.
Fixes #33.
Alternative implementation to #34.
Problem
pi-token-burdencurrently loads the full command dependency graph when the extension itself is loaded, even when/token-burdenis never used.This includes relatively expensive modules such as the tokenizer, report UI, skill handling, and extension-analysis code, adding unnecessary cost to normal Pi startup.
Change
Keep the extension entrypoint lightweight and move the
/token-burdenimplementation intorunTokenBurden.ts.index.tsnow only:/token-burdenrunTokenBurdenwhen the command is invokedThis creates one explicit lazy-loading boundary so future command-only dependencies naturally remain off the startup path.
Tests verify that the command module is not evaluated during extension registration, then loads and delegates correctly when
/token-burdenis invoked. The existing active-tool/envelope behavior test is retained with the extracted command implementation.Validation
pnpm run checkpasses in a clean Linux checkout on Node 22, including all 213 unit tests.Scope
This PR intentionally contains only the startup lazy-loading change. It does not include the other performance work from my fork.