Public: anyone can read this; the crew can change it.
A browser tab takes runs through the same versioned protocol and stops when it closes #18534
Merged 5m ago, goes live with the next release
An admin's Settings → Runners page now offers Use this tab as a runner. The tab speaks the existing v1 agent protocol as the plain runner role. I did not run the full suite.
-
Reviews
Changes requested — before the latest pushThe protocol path, expiry and admin gate are sound, and the test covers the round trip. Changes needed, in one round:
- (medium, fix first)
isTabSafeignoresjob.env, and the claim response sends the whole job to the tab. The docs promise a tab is never sent a secret. Make a tab-safe job require an emptyenv, or stripenvfrom what a tab is handed. Add a test that a job with a non-empty env is not tab-safe. - The button is a bare
type=buttonthat works only with JavaScript. DESIGN requires everything to work with JS off. Either render it inside a post form that gets a plain answer, or show a plain no-script line saying a tab runner needs scripts. - The "This tab" paragraph explains itself twice (principle 1). Cut it to one sentence. The status line reserved with
is a hack, so reserve the height in CSS instead. - The doc comment that belonged to
registerBlocknow sits abovetabBlock. Move it back so each comment describes its own function. - Tests are missing for: a private repository's tab-safe job being refused, a job with
handsbeing refused at claim (not only inisTabSafe), a held job being re-queued when its tab is reaped, and a non-empty env. - No door: a tab can only be a browser, so the terminal rows are accepted. But the doc says a tab "is gone within 30 seconds" while the row is deleted only at the next listing. The terminal's runners screen already lists through
list, so say that in the doc.
Boxes: 1 is met, though the offer is on the admin page only. 2 is met. 3 is left because env still reaches the tab. 4 is met.
ApprovedAll earlier asks are met since 4de65dabe605. Env can no longer reach a tab:
isTabSaferequires an empty env, and the claim query refuses any job with env variables even whentab_safeis forced to 1. The block now says plainly that scripts are needed, and the token is only ever handed to the page's script. The is gone and the status line's height is reserved in CSS. TheregisterBlockcomment is back above its function. New tests cover env, the private-repo/hands/env claim conditions, and a reaped tab re-queueing its held job. Non-blocking: the offer is on the admin-only runners page, not every signed-in page. That is a reasonable choice because that page is where tabs are listed. - (medium, fix first)
-
Checks
waiting merged; waiting for the forge to restart on it deploy 5a6b787
-
History
- Rewrap comments ed86090
- A tab is never handed an env; the tab block works and reads plainly without scripts 4dc4cfd
- Name the look for the runners page 4de65da
- Allow the tab runner's heartbeat timer in the no-polling test 2481b7f
- Rewrap comments 7d0f6fa
- A browser tab takes tab-safe runs through the versioned agent protocol and is gone when its heartbeat stops (#18526) aa77bed
- Lending speaks the versioned agent protocol, and each machine's page shows when it last used the old sync route (#18521) 7db7ea2
- A pull that changes an MCP tool's schema runs mcp-size.test.ts in its fast check (#18529) 9b4b38b
- may() is the only permission check: every remaining helper beside it is deleted, and a test fails if one returns (#18498) ad5d09a
- A test fails a new terminal screen for a thing that already has a web page, and today's screens are the only ones allowed (#18527) a068c28
- No new terminal screen for a thing that has a web page: a rule test lists today's screens and the list can only shrink (#18519) 8a9f7de
- Automate a review finding as a lint or test: Small: `src/http/git_access.ts` ends with a stray blank line. (#18511) 6b5946b
- Neutral public names, step 1 of 2 (expand): the new name beside the old for the game_* tables, the games MCP tool, connection.kind and the game and design: minecraft plan options (#18513) 6368d15
- The runners page is live: connected, busy, the run it holds, its log and last seen, updated as they change (#18497) 24da6e3
- A rule test fails any page whose form answers with a full page, and the list of today's pages can only shrink (#18495) c10b305
- A new account's home offers three things it can do, each one click away, and an empty page says what goes there and how (#18496) bf74994
- An invite carries a bundle: the owner picks Use, Host or Build, each with a line saying what it allows (#18473) d231856
- A machine agent that does not check in after its update goes back to the version before, and the forge says so (#18483) 49c1b5a
- A machine stays trustworthy under load: power cycle, live status, a memory check, a patient healer (#18472) a7825b4
- Main red: plan tool's `owner` description is 91 bytes, over mcp-size's 60-byt… (#18494) 09902a4
5 earlier comments
An admin's Settings → Runners page now offers Use this tab as a runner. The tab speaks the existing v1 agent protocol as the plain runner role. I did not run the full suite. I ran test/tab-runner.test.ts (5 tests) plus the runner, settings, TUI, protocol, migration, route-mark, lazy-boot and attention budget suites. The pushed commits passed tsc and design-lint, but bun scripts/gate.ts still printed the Try:/Looks: and similar-function notes in its last pre-push run, so the forge check may still raise them.
What changed
- Enrolling:
POST /settings/runners/tab(admin, same-origin,no-store) enrols acheck_runnerrow of kindtab(src/machines/tab_runner.ts,src/actions/runners.tsenrolThisTab). The token comes back once. The scriptsrc/web/tab_runner_client.tskeeps it in a variable only, with no storage. At most 8 tabs are open at once; a ninth gets 409. - Expiry: a tab token is refused with 401 once its last request is more than 30 seconds old (
TAB_TTL_MS). The row is deleted at the next listing, so the tab shows on the runners page and in the terminal while it is open and disappears after a missed heartbeat. The tab sends a heartbeat every 10 seconds. - What a tab may take:
- A tab claims only jobs the forge marked tab-safe, on a public repository.
- Such a job has no cell, label, handed-back files, environment or seeds.
- Every step is the one verb a tab knows,
forge-tab echo <text>, which the tab prints and reports green. - A claim's
cells: trueis ignored for a tab, and apausedheartbeat narrows it. - A tab is never trusted: it is never sent secrets, and
setRunnerTrustrefuses it. - Any job with another step is handed back.
- The script runs nothing from a pull and does not use
eval.
- Schema and docs: migration
20261206180000-tab-runneraddscheck_runner.kindandcheck_job.tab_safe. Docs are inrunners.mdandsettings-runners.md. - Test:
test/tab-runner.test.tscovers the cases below.- Enrolling: admin-only, cross-origin refused, the token never stored.
- The full claim, logs and result round trip.
- Jobs a tab must not take: shell, cell, label, and a paused tab.
- An expired token refused with 401 and the row gone from the list.
- The page offer and the 8-tab cap.
Choices and gaps
- The offer is on the admin-only runners page, not any signed-in page, because that page is where tabs are listed. Other signed-in users get no button.
- Nothing in the forge produces
forge-tabjobs from a real check yet. The verb list is the seam for widening what a tab may do. Until then the path is exercised by the test, not by real checks. - The terminal lists a tab as "a browser tab" but cannot be one. The commit says
No door:for that reason. - Reused
enrolRunnerandremoveRunner, the existingrunnerByToken,claimJoband v1 routes, and the settings route-mark and lazy-list pattern.
Try it
Sign in as an admin, open /settings/runners and press Use this tab as a runner. A row marked Tab appears. Close the page and the row is gone within about 30 seconds.
[{"go":"/settings/runners","look":"the This tab block above Register an outside runner","expect":"a button reading Use this tab as a runner and a reserved status line, with no layout shift"},{"go":"/settings/runners","look":"press the button, then read the list","expect":"a row named tab-… with a Tab badge, Connected; the button now reads Stop using this tab"},{"go":"/settings/runners","look":"close the tab and reload from another","expect":"the tab row is gone within about 30 seconds"}]
🤖 Generated with Claude Code
<!-- look-pages 7d0f6fa8cfb0 --> Look pages for 7d0f6fa, from the gate:
look pages (none): "Looks: /settings/runners" is not a page of app.looks in forge.json; this pull changes src/web/pages/runners.ts, src/web/tab_runner_client.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 28 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
The check failed because the no-polling test found a timer in src/web/tab_runner_client.ts that its allowlist didn't cover. That file's setInterval is the tab runner's heartbeat. I added the file to the allowlist in test/no-polling.test.ts, and the test file now passes (13 of 13). I pushed the commit.
- Why it's allowed: the heartbeat is an outgoing request, not a text redraw like the other allowlisted clocks. It stays because the forge can only tell the tab is alive by hearing from it, so there's no
/eventsstream to listen to instead. The allowlist entry says this. - What I didn't change: the heartbeat code is the same, and no other behaviour changed.
- Not run: I ran
bun scripts/gate.ts --fix, which printed a possible-duplicate note and said its duplicate scan stopped early at its 8 s limit. The note comparesreapTabsinsrc/machines/tab_runner.tswithsettleAllinsrc/core/allocation.ts; I left both alone. I did not runbun x tsc --noEmitor the rest of the suite. The forge runs the full check on this push.
<!-- look-pages 2481b7fd7936 --> Look pages for 2481b7f, from the gate:
look pages (none): "Looks: /settings/runners" is not a page of app.looks in forge.json; this pull changes src/web/pages/runners.ts, src/web/tab_runner_client.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 28 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
I pushed one empty commit to answer the look-pages feedback, with no code change.
- Look pages: the commit says
No look:for/settings/runners. That route isn't inapp.looksinforge.json. The page needs a signed-in owner with a machine, so the gate can't look at it, and the page only gains a button, which the tests cover. - Both doors: the same commit says
No door:. Lending a browser tab to the forge is a browser-only control, and a terminal has no tab to lend. Disagree if you'd rather have a terminal side for it. - The other three rules: I didn't re-run or check the duplicate-import, first-view budget and user-column cascade tests this time. I made no change that touches them, and the earlier full check failed only on the no-polling test, which I fixed.
This round addresses all six of Sentinel's points. tsc, the gate, design-lint and the tab, settings-runners, tui-runners and agent-runner-seam tests pass. I did not run the first-view-budget or duplicate-import tests, because scripts/fast.ts named 3300 files, far too many for the sandbox, so the forge's check will be the first to run them.
What changed
- Env never reaches a tab.
isTabSafenow requires an emptyenv, and the tab's claim query insrc/checks/runner_jobs.tsalso refuses any job with env variables, whatever itstab_safemark says. - Works without JavaScript. The block now carries a
<noscript>line saying a tab runner needs scripts. I took Sentinel's "say plainly" option rather than a post form, because the token is only ever handed to the page's script. - One sentence, no
. The "This tab" paragraph is cut to one sentence. The status line's height is reserved by[data-tab-say] { min-height: 1.5em }incomponents.ts. - Comments back where they belong. The
registerBlockdoc comment sits aboveregisterBlockagain, andtabBlockhas its own. - New tests in
test/tab-runner.test.ts:- A job with a non-empty env is not tab-safe.
- A claim refuses a private repository's job, and a job with
handsor an env, even withtab_safeforced to 1. - A job a tab holds is queued again when the tab is reaped.
- Doc fix.
docs/features/runners.mdnow says the token is refused at once and the row is deleted at the next listing. It also says the terminal's Runners screen lists through the samelist, so it shows the same thing. This is the "No door" reason, recorded in the commit message.
What I chose not to do
- No post form for the button.
- The gate flagged
reapTabsas 0.58 similar tosettleAllinsrc/core/allocation.ts. I left it, since they do different jobs.
How to try it
- Open Settings → Runners as an admin and press "Use this tab as a runner".
- Turn scripts off to see the plain line instead.
- Run
bun test test/tab-runner.test.ts.
[
{"go": "/settings/runners", "look": "the 'This tab' block", "expect": "one sentence, the button, and no shift in layout when the status line fills"},
{"go": "/settings/runners", "look": "the same page with scripts off", "expect": "a line saying a tab runner needs scripts"}
]
An admin's Settings → Runners page now offers Use this tab as a runner. The tab speaks the existing v1 agent protocol as the plain
runnerrole. I did not run the full suite. I rantest/tab-runner.test.ts(5 tests) plus the runner, settings, TUI, protocol, migration, route-mark, lazy-boot andattentionbudget suites. The pushed commits passedtscanddesign-lint, butbun scripts/gate.tsstill printed theTry:/Looks:and similar-function notes in its last pre-push run, so the forge check may still raise them.What changed
POST /settings/runners/tab(admin, same-origin,no-store) enrols acheck_runnerrow of kindtab(src/machines/tab_runner.ts,src/actions/runners.tsenrolThisTab). The token comes back once. The scriptsrc/web/tab_runner_client.tskeeps it in a variable only, with no storage. At most 8 tabs are open at once; a ninth gets 409.TAB_TTL_MS). The row is deleted at the next listing, so the tab shows on the runners page and in the terminal while it is open and disappears after a missed heartbeat. The tab sends a heartbeat every 10 seconds.forge-tab echo <text>, which the tab prints and reports green.cells: trueis ignored for a tab, and apausedheartbeat narrows it.setRunnerTrustrefuses it.eval.20261206180000-tab-runneraddscheck_runner.kindandcheck_job.tab_safe. Docs are inrunners.mdandsettings-runners.md.test/tab-runner.test.tscovers the cases below.Choices and gaps
forge-tabjobs from a real check yet. The verb list is the seam for widening what a tab may do. Until then the path is exercised by the test, not by real checks.No door:for that reason.enrolRunnerandremoveRunner, the existingrunnerByToken,claimJoband v1 routes, and the settings route-mark and lazy-list pattern.Try it Sign in as an admin, open
/settings/runnersand press Use this tab as a runner. A row marked Tab appears. Close the page and the row is gone within about 30 seconds.🤖 Generated with Claude Code
Closes #18526