Public: anyone can read this; the crew can change it.
The client list shows when each sent forge link was first opened and last seen, in plain words #12832
Check · Review · Land · Live done — Landed and live in production.
Each row of the client list now says whether the sent link was opened, and when the client was last seen. Everything was already committed and pushed on this branch, so this run added nothing.
shipped production is serving it deploy 8c9e2c1
Each row of the client list now says whether the sent link was opened, and when the client was last seen. Everything was already committed and pushed on this branch, so this run added nothing. I re-checked it: scripts/gate.ts, tsc --noEmit and design-lint are clean, and the 22 test files I ran pass (165 pass, 2 skipped, 0 fail). I did not run the full suite, and I did not try the pages in a browser.
What changed
- Opened time: the claim stores one new optional field for the time a browser first opened the claim page. It sits inside the existing stored claim record, so no migration was needed (
src/spawn/claim.ts). - Prefetch rule: only a GET that accepts
text/htmland carries noPurpose,Sec-Purpose,X-PurposeorX-Mozprefetch/preview header counts as an opening. Chat unfurls and prefetchers do not (isBrowserOpen). Opens are noted only while the link is still unspent. - The line:
/forgesrows (src/web/pages/forges.ts) and the terminalforgesscreen (src/tui/screens/forges.ts) show one line:
- "sent <time> · opened <time> | not opened yet · last seen <time>", with "last seen" only once the client has signed in. - A link spent before opens were recorded shows "opened (time not noted)" rather than a guessed time. - When this line is shown, it replaces the older stage and activity words, so nothing is said twice. A resend or a last "tell" keeps its own words.
- Who sees it: the list is the sender's. Nothing was added to the client's own forge beyond the stored timestamp, which that forge's own claim page writes.
- Tests:
test/client-link-seen.test.tscovers unopened, opened and signed in, and also checks that a prefetcher or unfurl does not count.test/client-states.test.tswas adjusted for the new line. - Docs:
docs/features/forge-link-states.mddescribes the new line.
What I chose not to do
- "Opened" means a browser asked for the claim page, not that a person read it. The docs say so.
- I did not add a database column, since the stored claim already carries the field.
- I did not touch
scripts/gate.ts.
How to try it
Send a forge, then open /forges as the sender. The row reads "not opened yet". Load the claim link in a browser and the row reads "opened <time>"; after the client signs in it adds "last seen <time>". Run bun test test/client-link-seen.test.ts.
Before and after: I did not attach before/after screenshots. The forges phone-look test skips here because no chromium starts in this sandbox.
I found no fault in this pull behind the red check. I didn't fix any code. I merged current main (38 commits ahead) into the branch and pushed, so the check runs again against it.
What the check showed
- Red on
maintoo: theapps-open-host,release-handover-keepalive,check-installandask-to-reachfailures were already red onmainatec75c06, and the check says it doesn't count them against this pull. - Red only on this pull:
crew-proposal,origin-aheadandclient-list("GET /api/v1/forges answers the MCP tool's rows…"). - Passing here: all three passed when I ran them on their own. Three repeat runs of
client-listwere clean. - Failed once under load:
crew-proposalfailed once on my first run, in a terminal-screen wait, then passed on the next.
Likely cause The failures look like timeouts under load, since the full run was 17,603 tests across about 2,500 files and 13 failed. None of the three tests reads the opened-time field or the new seen line, so I can't tie them to this change.
After the merge
tsc --noEmit and scripts/gate.ts are clean. client-link-seen, client-list, crew-proposal, origin-ahead, client-states and tui-forges all pass (67 tests, 0 failed).
If crew-proposal, origin-ahead or client-list fail again on this check, I'll need that log to find a real cause.
Approved. Opened/last-seen line works on /forges and the terminal screen (admin only), no migration, doc in docs/features, README untouched, tests cover unopened/opened/signed in/prefetch. Two non-blocking follow-ups: the open heuristic trusts client headers only (a chat bot that sends Accept: text/html without a prefetch header still counts as opened; consider a user-agent bot check), and the OpenAPI summary for GET /api/v1/forge still lists link as { state, revokedAt, usedAt } though openedAt now travels in it.
Each row of the client list now says whether the sent link was opened, and when the client was last seen. Everything was already committed and pushed on this branch, so this run added nothing. I re-checked it:
scripts/gate.ts,tsc --noEmitand design-lint are clean, and the 22 test files I ran pass (165 pass, 2 skipped, 0 fail). I did not run the full suite, and I did not try the pages in a browser.What changed
src/spawn/claim.ts).text/htmland carries noPurpose,Sec-Purpose,X-PurposeorX-Mozprefetch/preview header counts as an opening. Chat unfurls and prefetchers do not (isBrowserOpen). Opens are noted only while the link is still unspent./forgesrows (src/web/pages/forges.ts) and the terminalforgesscreen (src/tui/screens/forges.ts) show one line:- "sent <time> · opened <time> | not opened yet · last seen <time>", with "last seen" only once the client has signed in. - A link spent before opens were recorded shows "opened (time not noted)" rather than a guessed time. - When this line is shown, it replaces the older stage and activity words, so nothing is said twice. A resend or a last "tell" keeps its own words.
test/client-link-seen.test.tscovers unopened, opened and signed in, and also checks that a prefetcher or unfurl does not count.test/client-states.test.tswas adjusted for the new line.docs/features/forge-link-states.mddescribes the new line.What I chose not to do
scripts/gate.ts.How to try it Send a forge, then open
/forgesas the sender. The row reads "not opened yet". Load the claim link in a browser and the row reads "opened <time>"; after the client signs in it adds "last seen <time>". Runbun test test/client-link-seen.test.ts.Before and after: I did not attach before/after screenshots. The forges phone-look test skips here because no chromium starts in this sandbox.
Closes #12694