Skip to content

0.9.6: spend less of GitHub's quota, warn when it runs low - #41

Merged
Ege-BULUT merged 1 commit into
mainfrom
quota
Oct 27, 2026
Merged

Ege-BULUT merged 1 commit into
mainfrom
quota

Conversation

@Ege-BULUT

Copy link
Copy Markdown
Owner

Every device and agent of an account shares GitHub's hourly REST quota (5,000 requests), and a busy chat used it up: a message cost about six REST calls to write, two per device to read, and about five more per device for its read receipt.

  • Reads: blobs asked for together (a Promise.all over a tree) go to GitHub in one GraphQL query of up to 100 objects; anything GraphQL won't give as text comes over REST. Trees of a commit are kept (they never change).
  • Writes: a commit on an existing branch is one createCommitOnBranch call after reading the head; a moved branch (STALE_DATA) is retried. Force pushes (presence, drafts), new branches, uploads over 2 MB and any other refusal go the REST way.
  • Quota: the Bus keeps the x-ratelimit-* headers per resource. At 50% and 75% the app shows what that means, with switches: pause read receipts or the heartbeat until the reset, turn either off, or keep drafts on the device; each explains itself with an example on hover or a tap on ⓘ. Apply keeps them, Cancel changes nothing; Settings has the same switches and the usage.
  • Links: www. addresses are links, and trailing punctuation is left out.

Checked against real GitHub on a temporary branch of the chat repository (deleted after): one-call commits, two at once, a stale head, deleting a missing path, a batched read. The fake GitHub now speaks this GraphQL and sends quota headers.

Tests: core/test/graphql.test.mjs, app.e2e.mjs quota, link checks. Unit 84/84, CLI 30/30, MCP 17/17, browser 79/79.

Every device and agent of an account shares GitHub's hourly REST quota,
and a busy chat used it up. Blobs asked for together now go to GitHub in
one GraphQL query (REST for any GraphQL won't give as text), a commit on
an existing branch is one createCommitOnBranch call after reading the
head (REST still for force pushes, new branches, big uploads and any
refusal other than a moved branch), and trees of a commit are kept.

The Bus keeps the quotas GitHub reports. At 50% and 75% the app shows
what that means and switches, each with an example on hover or a tap on
its info button: pause read receipts or the heartbeat until the reset,
turn either off, or keep drafts on the device. Apply keeps them, Cancel
changes nothing, and Settings has the same switches.

Plain-text links take www. addresses and leave trailing punctuation out.
@Ege-BULUT
Ege-BULUT merged commit 79bfc26 into main Oct 27, 2026
1 check passed
@Ege-BULUT
Ege-BULUT deleted the quota branch October 27, 2026 12:46
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