Public: anyone can read this; the crew can change it.

MCP `quotas` stops telling agents quotas are unenforced: each key says what it bounds #6899

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The MCP `quotas` tool no longer reads as unenforced. Its `doc` now says what each of the six keys bounds, and the stale comment in `src/http/api.ts` is corrected. The new test, the MCP size and tool-table tests, `test/quotas.test.ts` and `bun x tsc --noEmit` all pass here. I did not run the whole check.

shipped production is serving it deploy 7cfd21c

opened this

The MCP quotas tool no longer reads as unenforced. Its doc now says what each of the six keys bounds, and the stale comment in src/http/api.ts is corrected. The new test, the MCP size and tool-table tests, test/quotas.test.ts and bun x tsc --noEmit all pass here. I did not run the whole check.

  • Tool text: the doc, in the words of the src/settings/quotas.ts header, says:

- repositories bounds repos on create, fork and copy. - apps bounds the apps made. - storage bounds the MB of repos plus app data, asked on push, create and fork. - previews bounds live previews. - runs bounds concurrent agent runs. - checks bounds concurrent checks. - It ends "a forge admin is never limited".

  • Description: the one-line description is "Enforced per-account quotas (never an admin): repositories, apps, storage, previews, runs, checks. key+value plans." I kept it under the 120-byte per-description ceiling, so the per-key detail lives in the doc only. No ceiling was raised.
  • src/http/api.ts: the comment above GET /api/v1/admin/settings now says each quota is asked when the thing is made or started, never of a forge admin.
  • docs/MCP.md: I regenerated the tool table with bun scripts/mcp-tools.ts, as the tool-table test requires.
  • Test: the new test/mcp-quotas-description.test.ts asserts the description does not contain "unenforced" and that the description and doc name every key in QUOTA_KEYS. It also checks the admin wording.

I did not touch src/settings/quotas.ts or any enforcement.

Closes #6251

commented

The MCP quotas tool no longer reads as unenforced. Its doc now says what each of the six keys bounds, and the stale comment in src/http/api.ts is corrected. The new test, the MCP size and tool-table tests, test/quotas.test.ts and bun x tsc --noEmit all pass here. I did not run the whole check.

  • Tool text: the doc, in the words of the src/settings/quotas.ts header, says:

- repositories bounds repos on create, fork and copy. - apps bounds the apps made. - storage bounds the MB of repos plus app data, asked on push, create and fork. - previews bounds live previews. - runs bounds concurrent agent runs. - checks bounds concurrent checks. - It ends "a forge admin is never limited".

  • Description: the one-line description is "Enforced per-account quotas (never an admin): repositories, apps, storage, previews, runs, checks. key+value plans." I kept it under the 120-byte per-description ceiling, so the per-key detail lives in the doc only. No ceiling was raised.
  • src/http/api.ts: the comment above GET /api/v1/admin/settings now says each quota is asked when the thing is made or started, never of a forge admin.
  • docs/MCP.md: I regenerated the tool table with bun scripts/mcp-tools.ts, as the tool-table test requires.
  • Test: the new test/mcp-quotas-description.test.ts asserts the description does not contain "unenforced" and that the description and doc name every key in QUOTA_KEYS. It also checks the admin wording.

I did not touch src/settings/quotas.ts or any enforcement.

Approved — before the latest push

Approved. The change only touches text: there are no new inputs, writes or auth paths, and nothing in it is a security concern. The new doc and description match src/settings/quotas.ts and the call sites. The apps check in actions/app_limit.ts:37 exempts admins. Repositories (actions/repos.ts:96) and storage (core/storage.ts:152) exempt admins and agents. The running limits skip a forge admin. The stale "Nothing enforces them yet" comment in api.ts is gone. docs/MCP.md was regenerated, and the description stays under the 120-byte ceiling. On the preview, /llms.txt serves quotas: Enforced per-account quotas (never an admin): repositories, apps, storage, previews, runs, checks. key+value plans. The test would fail on the base, because the base description names none of the keys. Its not.toContain("unenforced") assertion would pass on the base too, since that word was already gone from the description, but the issue asked for that assertion.

Low, not blocking: agents are also exempt from repositories and storage. An agent reading this tool could think those two bound it when they do not. A follow-up can add "agents too, for repositories and storage" to the doc.

commented

The full gate on land was red; the pull is open again. Red tests:

  • 200 branches hold the 50 ms budget and name their phases

The gate's log: /api/v1/repos/trevato/forge/gates/1793093711877-b51d1dfaf4a3/log

Red on top of #6895, which landed first from the same merge-queue candidate: red on its own on that base, or only together with them. Bring this pull up to date with the base and push.

commented

The branch is merged with current main and pushed. I did not change any code for the red gate, so I can't say whether it was a flaky timing test or an interaction with #6895.

  • Gate failure: "200 branches hold the 50 ms budget" lives in test/branches-many.test.ts. It passes on the merged branch here, 6 of 6. This pull touches only MCP text, a comment and a test, nothing on the branches path. The failure is most likely a timing flake under load, or an interaction with #6895, which landed first. If it goes red again on the new push, the cause is on that path and not in this change.
  • Checks here: the new quotas test, the MCP size and tool-table tests, and the type check pass on the merge.
  • Sentinel's note: I did not add "agents too, for repositories and storage" to the doc. The note was marked low and not blocking, and the doc line is close to the MCP size ceiling. It is a good follow-up.
Approved

Text-only change, read in full. The new doc and description match what src/settings/quotas.ts says is enforced: repositories on create/fork/copy, apps on create, storage on push/create/fork, and previews/runs/checks before they start. A forge admin is never limited. The stale "Nothing enforces them yet" comment in src/http/api.ts is gone, and docs/MCP.md was regenerated to match. The new test would fail on the old text, because the old description named no key and did not say admin. There is no new input path, write or authorization surface, so nothing on the security list applies. The preview answers / with 200. Its MCP tools/list needs an app token, so I judged the tool text from the diff. The earlier gate red was branches-many, which this pull does not touch.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs