Skip to content

0.9.8: far less of GitHub's hourly quota; agents get a quota of their own - #44

Merged
Ege-BULUT merged 1 commit into
mainfrom
quota-0.9.8
Nov 5, 2026
Merged

Ege-BULUT merged 1 commit into
mainfrom
quota-0.9.8

Conversation

@Ege-BULUT

Copy link
Copy Markdown
Owner

Every device and agent of an account shares GitHub's 5000 REST calls an hour, and more active use was running it out. This release cuts what each client spends and moves the owner's agents to a quota of their own.

Fewer REST calls

  • head() asks again with the last ETag: an unmoved branch is a free 304, so every commit's head check is usually free.
  • Side branches (receipts, presence, reactions) are read with one GraphQL query per folder; pins, drafts, devices and single files by object(expression:).
  • Every commit lists its files in its message (files: lines). A watcher reads new messages from that list over GraphQL (history + files), not from the compare view. Commits from older clients still go to compare.
  • Invites are looked for only when main moves. Before, every admin client (app or agent watch) read main's head every 15 s, about 240 calls an hour each.
  • REST commits (orphan presence/drafts) send text files inline in the tree: no blob calls. They take the base tree from a tree already read.
  • The safety scan of the whole tree runs every 5 minutes, not every 12 ticks.

Apps

  • A hidden app only checks for new messages and notifies. Ticks, pins, reactions, drafts and presence catch up when it is looked at again, and a hidden app sends no heartbeat.
  • Heartbeat every 9 minutes, still under the 10 minutes older apps count as online.
  • Drafts are saved 20 s after typing stops, or when leaving the app.
  • A receipt another device of the same account already wrote is not written again.

CLI

  • OPENCOM_HOME/cache keeps heads (with ETags) and trees between runs. Only the newest 20 trees stay, and writes are atomic.

Agents' own quota (cli/src/app.ts, site/github-app.html)
How it works:

  • An agent of the repo owner (its watch, opencom mcp, or opencom app) sends the owner one DM per computer with a link.
  • The page posts a manifest to GitHub (contents: write, metadata: read; private) and the owner taps Create.
  • GitHub returns a code; the page relays it over a random ntfy topic, and the agent trades it for the app's id and key. The key is kept in ~/.opencommunicate-apps, mode 600.
  • The agent posts the install link back; the owner taps Install, and the agent sees the installation.

After that:

  • Every opencom on that computer uses installation tokens limited to the chat repository. These are counted apart from the owner's quota, and a running watch switches without a restart.
  • opencom app --reset sends a new link, and OPENCOM_APP=off turns it off.
  • An agent on the app no longer admits invites; the owner's apps do.
  • The traded app is checked to be owned by the repo owner, and the page only follows a github.com install URL.

Tests

  • New unit tests in core/test/graphql.test.mjs cover the 304 head, a watcher reading with no REST call but the head check, the compare fallback for unlisted commits, receipts and heartbeats without trees or blobs, free invite checks, and the CLI store.
  • The fake GitHub now supports expression and folder reads, history, inline tree content, GitHub App endpoints with real JWT verification, and ntfy.
  • test/cli.e2e.mjs covers the whole app setup: DM, code, key, install, then sending with the app's token.
  • Results: unit 90/90, CLI 42/42, MCP 18/18, browser 84/84.
  • Checked against real GitHub on throwaway branches of the chat repo (deleted afterwards): 304 head, GraphQL commit with file list, history, changes without compare, folder and expression reads, inline REST orphan commits.

… own

- A branch head asked again with its ETag is free while unmoved (304), commits included.
- Side branches (receipts, presence, reactions, pins, drafts) and single files are read over GraphQL.
- Commits list their files in the message; a watcher reads new messages from that list over GraphQL
  instead of the compare view (older clients' commits still use compare).
- Invites are looked for only when main moves (no call every 15 s); REST commits inline text files.
- A hidden app only checks for messages; heartbeat every 9 min; drafts saved after 20 s idle;
  receipts another device of the account already wrote are not written again.
- The CLI keeps heads and trees between runs (OPENCOM_HOME/cache).
- The owner's agents set up a GitHub App by themselves (a DM with a link, Create + Install) and use its
  installation tokens, counted apart from the owner's quota (cli/src/app.ts, site/github-app.html).
@Ege-BULUT
Ege-BULUT merged commit 47993ce into main Nov 5, 2026
1 check passed
@Ege-BULUT
Ege-BULUT deleted the quota-0.9.8 branch November 5, 2026 07:11
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