Repository navigation
Conversation
session.start awaited a repo-wide `git grep --untracked` before it called next(). In a large repo that grep takes about 3 s, and session.start holds the SDK's initialize reply until it settles. ACP clients such as JetBrains Air drop a launch that has not answered within 5 s, so new sessions failed or came close to it. Only the Edit/Write reuse metric reads those definitions. `known` is now a promise: session.start (and /clear, /resume, /branch) starts the grep and does not wait for it, and the edit handler awaits it before it counts reused calls. Measured in a large Android repo (~540 KB of git grep output): - initialize reply: 4.8 s -> 2.0 s - ponytail session.start: 3027 ms -> 23 ms - the grep still completes in the background (exit 0, about 2.9 s later) A band test holds the grep past session.start and checks that the start settles and that an edit made meanwhile still counts the reused call once the grep lands. Against the previous register.tsx the start stays held and the test fails.
4 of 5 tasks
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.
Problem
The band's
session.starthandler awaited a repo-widegit grep --untracked -nE <defs>before it callednext().session.startholds the SDK'sinitializereply until it settles, so in a large repo every session start waited for the grep. ACP clients such as JetBrains Air drop a launch that has not answered within 5 s, so new sessions failed or came close.Measured in a large Android repo (~540 KB of
git grepoutput):initializereplysession.startmainThe grep still completes in the background (exit 0, about 2.9 s after start).
Change
Only the Edit/Write reuse metric reads those definitions.
start()no longer runs the grep. A newdefs()does, andknownholds its promise:session.start(and/clear,/resume,/branch) starts it without waiting, and the edit handler awaits it before it counts reused calls.Test
tests/band.test.tsxgets one test: the grep mock is held until aftersession.startreturns and an Edit is under way. The start must settle, and the edit must still count the reused call once the grep lands. Against the previousregister.tsxthe start stays held and the test fails.Checks
claude plugin test .: 31 pass, 2 fail. The 2 failures (bodyColumns only in the terminal,details view ... off the terminal) also fail onmainhere.npm test: 142 pass, 2 fail, both also failing onmainhere:csv: correct pandas one-liner passes(no pandas installed) andSessionStart preserves instructions when the optional map is blocked(timed out).node scripts/check-rule-copies.jsandnode scripts/check-versions.jspass.