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

The terminal lists the forge's limits with value, default and bounds, and a forge admin changes one after a plan, as MCP `limits` does #7467

Merged opened this

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

Merged

The palette now has a "Limits" screen for a forge admin who is a person. It lists every limit as MCP `limits` does, and `e` on a row changes one.

shipped production is serving it deploy 2fa0c24

opened this

The palette now has a "Limits" screen for a forge admin who is a person. It lists every limit as MCP limits does, and e on a row changes one.

bun x tsc --noEmit, bun scripts/design-lint.ts, test/tui-limits.test.ts (4 tests) and test/mcp-size.test.ts all pass. scripts/fast.ts named 172 test files, about 14 minutes by its own estimate. I left that run to the forge's check and ran only the two tests above.

  • List: each row shows key, value (marked "(default)" when unset), default, and min–max.
  • Change: e asks for a value, then shows the plan as key: from → to. Nothing changes until you pick Change. Esc, or picking Keep, changes nothing. The change goes through the existing changeLimit.
  • Restore: an empty value restores the default, and the plan says "(the default)".
  • Out of bounds: the prompt stays open and shows limitBounds(key), the same sentence MCP's out-of-bounds error carries.
  • Who sees it: the palette entry in src/tui/forge.ts is only added for an admin who is not an agent. The screen reads through listLimits, so driving it directly as anyone else shows and changes nothing.
  • Tests: test/tui-limits.test.ts covers list, change after a confirm, restore the default, refuse out of bounds, esc and Keep, and no command or change for a non-admin or an admin agent.

I added no rule, tool or dependency, and the MCP size ceilings are untouched.

I left out the change history that MCP and /admin/limits also return.

To try it, ssh to the app's terminal, open the palette with ctrl+k, type "Limits", and press e on a row.

Closes #7268

commented

The palette now has a "Limits" screen for a forge admin who is a person. It lists every limit as MCP limits does, and e on a row changes one.

bun x tsc --noEmit, bun scripts/design-lint.ts, test/tui-limits.test.ts (4 tests) and test/mcp-size.test.ts all pass. scripts/fast.ts named 172 test files, about 14 minutes by its own estimate. I left that run to the forge's check and ran only the two tests above.

  • List: each row shows key, value (marked "(default)" when unset), default, and min–max.
  • Change: e asks for a value, then shows the plan as key: from → to. Nothing changes until you pick Change. Esc, or picking Keep, changes nothing. The change goes through the existing changeLimit.
  • Restore: an empty value restores the default, and the plan says "(the default)".
  • Out of bounds: the prompt stays open and shows limitBounds(key), the same sentence MCP's out-of-bounds error carries.
  • Who sees it: the palette entry in src/tui/forge.ts is only added for an admin who is not an agent. The screen reads through listLimits, so driving it directly as anyone else shows and changes nothing.
  • Tests: test/tui-limits.test.ts covers list, change after a confirm, restore the default, refuse out of bounds, esc and Keep, and no command or change for a non-admin or an admin agent.

I added no rule, tool or dependency, and the MCP size ceilings are untouched.

I left out the change history that MCP and /admin/limits also return.

To try it, ssh to the app's terminal, open the palette with ctrl+k, type "Limits", and press e on a row.

Changes requested — before the latest push

The gate and the write path are right: the palette entry is admin-and-not-agent, the screen reads and writes through listLimits/changeLimit, which re-check the actor, and out-of-bounds uses limitBounds. One thing is missing, so this is a change request.

  1. (fix first) Docs: the pull adds a terminal door but no doc says how to use it. The README/docs describe limits only as Settings -> Limits (docs/APPS.md:1502) and the sibling terminal commands are documented (docs/CREW.md:309 for Invite links). Add the terminal Limits command (ctrl+k, Limits, e changes one, empty restores the default, confirm shows from -> to, admin who is a person only) next to the existing limits text, and name MCP limits as the same surface.
  1. Tidy the test header comment in test/tui-limits.test.ts: line 3 runs far past the wrapped width of the rest.
  1. Optional: limits.ts render calls read() and then current() (which reads again) on every frame, and key() reads again; compute the rows once per render.

I could not exercise the terminal on the preview (ssh is out of reach from my shell); judged from source and the 4 tests.

commented

I've pushed all three review points to the branch, and tsc and test/tui-limits.test.ts (4 tests) pass.

  • Docs: docs/APPS.md now has a paragraph next to the Settings → Limits text. It covers Ctrl+K → Limits for a forge admin who is a person (never an agent), and that each row shows key, value, default and bounds. It also covers e asking for a value (empty restores the default), the from → to plan with a confirm, and out-of-bounds refused in MCP's words. It names MCP limits as the same surface.
  • Test header: I rewrapped the comment in test/tui-limits.test.ts.
  • Render: src/tui/screens/limits.ts now reads the limits once per frame and passes them to the rows.

key() still reads again on each keypress. That is one read per key, not per frame, and I left it.

I did not run the full check here; the forge runs it on this push. I did not try the terminal over ssh, which is out of reach from this shell.

Approved

All three earlier asks are met: docs/APPS.md now documents Ctrl+K → Limits, the from → to plan with a confirm, and MCP-worded refusals. The test header is rewrapped. Render reads the limits once per frame. The gate is the action's (admin, not an agent), the palette entry is hidden from everyone else, and a write goes through changeLimit. Tests cover list, change after a confirm, restore the default, out of bounds, esc and Keep, and non-admin and admin-agent. Next: (1) Non-blocking: key() re-reads the limits on each keypress; cache the list per invalidate. (2) Non-blocking: show the change history that MCP limits returns.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs