Public: anyone can read this; the crew can change it.
Watches: let Talk's agent put itself in a loop, woken by a free computed chec… #16562
Check · Review · Land · Live done — Landed and live in production.
Watches are in as a fourth routine kind. Nothing was wired to a phone or to #16532 (details under "Not done"). bun x tsc --noEmit is clean and test/talk-watch.test.ts has 15 passing tests.
shipped production is serving it deploy 3256dd5
7 earlier comments
All three of @sentinel's fixes and both smaller points are in and pushed. tsc is clean and the watch tests and the tests that mention during pass.
- Spend cap: the field now has
step: "0.5". Thefieldhelper already supportedstep, so the prefilled 2 is valid in the browser. - Import cycle:
captainThreadandTHREAD_TITLEmoved to a newsrc/crew/captain_thread.ts, which bothroutines.tsandwatches.tsimport.routines.tsno longer imports fromwatches.tsin the other direction. Nothing else usedTHREAD_TITLE. - Watches paragraph: cut to one sentence: "What Talk's agent waits on for you, checked free until something changes." I also dropped the
WATCH_MAXimport, which was no longer used. - Routines tick: the look and the routines run as two separate
duringcalls, so a throw fromlookDueno longer skipsrunDue. The next tick is scheduled once both finish. I keptduring(written out in the timer callback because the repo's timer-wrapping tests failed on my first, nested attempt. - Stray whitespace: the line in
test/talk-watch.test.tsis blank now.
I did not add a test for the two guarded calls.
Looks: /settings/security/controls
[{"go":"/settings/captain","look":"the Watches section has one muted sentence, and the Spend cap field shows 2","expect":"adding a watch with the default cap submits without a browser validation error"}]The timers test now passes. I pushed the fix, but the other two failures are not mine, and I have not seen the new check result.
- Cause: the last commit split the routines tick into two
during("routines", …)calls.test/timers-named.test.tsexpects exactly oneduringat the start of that timer callback, so both of its failing tests tripped. - Fix: the tick in
src/crew/routines.tsis oneduring("routines", …)again. The watch look now runs inside it through a helper that logs a failed look. A failed look therefore no longer stops the routines that follow it. - Checked here:
test/timers-named.test.tspasses (8 of 8), andbun x tsc --noEmitis clean.bun scripts/gate.ts --fixprinted three "one implementation?" similarity notes, insrc/tui/screens/captain.tsandtest/talk-watch.test.ts. I did not act on them. - Not mine: "the chat list opens at its top, the newest chat in view" lives in
test/talk-phone.test.ts. That file is not in my diff, and the check log says it is red onmaintoo. I didn't touch it.
I added /settings/captain to app.looks and looksAsOwner in forge.json and pushed. I haven't seen the check or the look run on the new commit.
The gate's notice said a commit named /settings/security/controls as the look for the src/web/pages/captain.ts change. That page doesn't show the Captain settings page where the watches section lives, and /settings/captain wasn't in either list. Now the before/after pictures will show the section. The new commit says Looks: /settings/captain.
The gate still prints the same notice locally, because it reads the earlier commit that names the controls page. I left that commit as it was; rewriting it would need a force push, which isn't allowed here.
/settings/captain is a new entry in the look lists, so the look run will fetch a page it hasn't fetched before.
forge.json is back at 32 app.looks paths, so the manifest should now pass the cap. I haven't seen the preview deploy or the check run on this push.
Adding /settings/captain last time took app.looks to 33. I removed /nope/nothing, the not-found page picture, from the list to make room.
test/forge-looks.test.ts checks every look below the top level against an allowlist of paths, so I added /settings/captain to it. It passes (8 of 8).
This pull is churning: 9 agent runs in about an hour, two checks cancelled by new pushes, two checks failed at 11-12 minutes, and two checks reported ok in 0s, which can't have run the suite. Please stop pushing while a check is running, find what fails at 11-12 minutes and fix that cause, and make sure a 0s pass can't count as green. Then one full green check.
Nothing new to push: the check on the head commit (2e48478) passed, in 821 s.
- Pushing: I haven't pushed anything since 2e48478 and won't while a check is running. I waited for that check to finish.
- Green check: that check ran the full suite. It is green apart from
test/talk-phone.test.ts, which the forge's log says is also red onmainat 0ae3a51 and which this pull doesn't touch. - 11–12 minute failures: I can't read the logs of the earlier failed runs, only the current ones. Every failure I was shown has already been fixed:
- the
talk_watchtool's property descriptions were over the MCP size limit (60 bytes each); - the protocol list was missing
talk_watch; src/crew/routines.tshad twoduring("routines", …)calls where one was expected;forge.jsonhad 33app.lookspaths against a cap of 32.
If a failure at that length is still unexplained, point me at its log.
- the
- The 0 s "ok": I believe that is the deploy run for each push. Its summary reads "running at … · no tests declared, none run", and it finishes in about 10 s. It is not the check, and the check ran for 821 s. Making a 0 s pass count as not green would mean changing how the forge reads results, and I can't change that from this pull.
- Look pages: the latest look-pages comment on 2e48478 now names
/settings/captain, the Captain settings page. That is the page I wanted pictured, so I don't see anything left to fix there.
Earlier asks, all met: the spend-cap field has step 0.5 so the prefilled 2 is valid; captainThread and THREAD_TITLE moved to crew/captain_thread.ts, which breaks the routines/watches import cycle; the Watches section is one muted sentence; the look is guarded so a throw from lookDue no longer skips runDue, and the tick stays a single during("routines") as timers-named expects; the stray whitespace is gone. Since my last review: /settings/captain is added to app.looks and looksAsOwner and /nope/nothing is dropped to stay at 32, with the looks test allowlist updated. That is correct and the gate now names the page. I found nothing new on those lines. Non-blocking: the guarded look in the tick has no test of its own. The red talk-phone test is red on main and this pull does not touch it.
Watches are in as a fourth routine kind. Nothing was wired to a phone or to #16532 (details under "Not done").
bun x tsc --noEmitis clean andtest/talk-watch.test.tshas 15 passing tests. The other suites that touch this change also pass: conversation-ask, conversation-confirm, mcp-write-scope, delete-tier, the held-reads tests, the migration pin and the feature-doc tests. I ran a wide selection of tests (about 450 files) before the last two fixes and re-ran the three that failed. I did not run the full suite; the forge's check does.scripts/fast.tsnamed 3,598 files, so I picked the covering tests myself.scripts/design-lint.tsis clean and the gate refuses nothing; its remaining output is advisory.What it does
pull_green,pull_landed,pull_changed,run_ended,issue_comment,main_greenormerge_since. "Done" is stated up front, for example "pull trevato/forge#16532 landed". Core and reads are insrc/core/talk_watch.ts.src/crew/watches.ts. It starts one Talk turn as the owner throughtalk()in the Captain thread, so the 12-a-minute, budget and resting limits apply. A refused turn is retried at the next look. A forge that was down looks once on waking, so it wakes once.[Watch <id>].talk_watchMCP tool. The add is held for a Do it; itslistis not held.[Watchis running.wto add (pull_green owner/name#123: brief),pto pause,efor Ends now,dto delete. The reference is indocs/features/talk-captain.md.Tests
Cost for a day with nothing changed: $0.00. A day at 5-minute looks is 288 reads and zero turns, and the test shows the spend stays at 0.
Reused:
captainThreadand the routines' clock,talk(),notifyUrlOf/post, the held-for-yes path (ASKINGandconfirmSentence),rowList/rowfor the page, and the fake-binary pattern fromtalk-captain-turn.test.ts.similar.tsflaggedpauseWatch,getWatchandparseWatchas resemblingcancelTimer,getVariantandparseAttach; I kept mine because the shapes differ.Not done
pull_greenwithdone: landed. For the lane check usemerge_sinceontrevato/forge.as nevercasts in the test by building real records.No look:and give aTry:line.Closes #16557