Repository navigation
perf(cli): make GitHub-backed commands fast - #91
Open
FreshlyBrewedCode wants to merge 1 commit into
Open
FreshlyBrewedCode wants to merge 1 commit into
FreshlyBrewedCode wants to merge 1 commit into
Conversation
Reads and writes now share one GraphQL map snapshot instead of re-fetching sub-issues and walking every step's dependencies one request at a time; conditional GETs are cached across processes with ETag revalidation; burst-limited writes back off; and `map status` reports the shared sub-issue budget. - github `listSteps`/`listGoals` derive from the memoized snapshot, so `map show`/`map next`/`step` commands stop paying a read per step. - `saveStep`/`saveGoal` answer from the same snapshot instead of re-reading the issue and its `blocked_by` edges. - A filesystem-backed, ETag-revalidated response cache lets a fresh CLI process reuse an unchanged body and never serves stale data. - Secondary rate limits retry with exponential backoff honoring `retry-after` rather than failing hard. - `map status` reports `used/cap` sub-issues and warns near the cap, while creating past the cap still fails with the named error. - The filesystem backend is unchanged and reports no capacity. closes #83
8 tasks
| (error) => | ||
| attemptNumber + 1 >= SECONDARY_RATE_LIMIT_ATTEMPTS | ||
| ? Effect.fail(secondaryRateLimitError(error.retryAfterSeconds?.toString())) | ||
| : Effect.sleep(secondaryRetryDelay(attemptNumber, error.retryAfterSeconds)).pipe( |
Owner
Author
There was a problem hiding this comment.
effect has first class support for retry, backoff, etc. See https://effect.website/docs/v4/error-management/retrying. We should not use our own implementation here
This branch has not been deployed
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.
Closes #83.
Stacked on #87 (the #80 dependency); retargets to
mainonce #80 lands.Wayful's GitHub-backed commands stop re-fetching what they already have, cache reused reads across processes, back off instead of tripping GitHub's burst limit, and surface the map's sub-issue budget.
What changed
listSteps/listGoalsandsaveStep/saveGoalnow answer from the same memoized GraphQL snapshot instead of re-reading sub-issues and walking every step'sblocked_byedges.step completeandmap showno longer grow with the number of steps.GETs are ETag-revalidated and persisted under the user cache directory, so a fresh CLI invocation reuses an unchanged body — and can never serve stale data, because every hit revalidates.retry-after, rather than failing the command.map statusreportsused/capsub-issues and warns as it approaches the cap; creating past the cap still fails with the existing named error.User-facing change
step completeon an N-step mapmap show304, cached body reusedstep createburst hitting the secondary limitmap statusnear the capSub-issues: 95/100 (approaching the 100 sub-issue cap)Before / after examples
map statuson a GitHub-backed map near its cap:Before:
After:
A burst of
step createcalls that trips GitHub's secondary limit:Before:
After: the command waits out
retry-after(with exponential backoff) and succeeds.Validation
bun check(lint + typecheck + test): CLI 335 pass / 1 skip / 0 fail, UI 49 pass / 0 fail.listSteps+listGoals, the snapshot-backed save paths, a disk cache revalidated across two layer constructions (and never stale), secondary-limit retry/backoff, and sub-issue usage/cap reporting.