Public: anyone can read this; the crew can change it.
The forge calls an absorbed app's scheduled tool on time, once, and remembers how it went #9962
The forge now calls each absorbed app's declared scheduled tools when they come due, and keeps the last fire of each. I ran tsc --noEmit and four test files, and they are green. Those were test/feature-schedule-fire.test.ts, test/feature-schedule.test.ts, test/pull-check-again.test.ts and test/apps-features.test.ts.
stopped parked by the crew deploy 3e8f30e
3 earlier comments
The forge now calls each absorbed app's declared scheduled tools when they come due, and keeps the last fire of each. I ran tsc --noEmit and four test files, and they are green. Those were test/feature-schedule-fire.test.ts, test/feature-schedule.test.ts, test/pull-check-again.test.ts and test/apps-features.test.ts. I did not run the whole suite; the forge's check does that on the push. I did not start the app, so the timer has not run against a live app.
What changed
src/apps/feature_schedule.tsdue(entry, lastFired, now)is pure: an entry is due if it never fired, or its interval has passed since the last fire.fireDue(app, now, deps?)goes through each absorbed app whose production state isrunningand calls each due tool throughcallTool, the same loopback call thefeaturestool uses (POST/forge/tools/<name>, 64 KB, 10 s). There is no new HTTP path.- Asleep, stopped and un-absorbed apps are never called, and an asleep app is not woken. A tool already in flight is not called a second time.
startFeatureSchedule(app)ticks every minute and isunref'd.
- Migration
20261109050000-feature-fire.ts: tableapp_feature_fire, one row per (app, tool), holding the time, ok or the error's sentence, and the duration. The migration pin is committed. src/http/server.ts: the tick starts beside the other writers and is stopped in the server'sstop(). It does not start whenNODE_ENV=test, whichbun testsets, so no timer runs under the test harness unless a test callsstartFeatureSchedule. That addresses the #9892/#9916 risk.test/feature-schedule-fire.test.ts: covers due vs not due, once per window and again in the next, a failing tool recorded with its sentence, an asleep app skipped, and an un-absorbed app not called. It uses an injected clock and injected deps, so it never waits on wall time.
Not done
- Nothing reads the recorded fires yet: no page, no MCP output. The issue asked only for them to be kept.
- A fire that was due while the forge was down fires once on the next tick, not once per missed window.
- I did not call
keep_plan; that tool is not available in this session.
To try it: absorb an app whose forge.json declares "schedule": [{ "tool": "scan", "every": "15m" }], run the forge, and look at the app_feature_fire row after a minute.
🤖 Generated with Claude Code
No fix was needed, and I pushed nothing: the preview of #9962 is running and the pull's check is green.
- Preview: the deploy log ends
done: https://lab--9962--forge-trevato-apps.open-platform.sh, with "forge is up" after it./answers 200 in about 0.9 s. - Check: the pull reports
check: green, it isn't stale, and it's mergeable. The head is stillc1e7b24, the commit I pushed. - The log line: "no tests declared, none run" only says
forge.jsonnames no test command for the preview deploy. It isn't a failure.
I can't tell from here why you were told it failed. If a different log shows an error, send me that part and I'll look at it.
The forge now calls an absorbed app's scheduled tool when it is due, once per due time, and records how each call went. The earlier check failed only because no commit message had a "Try:" line, and src/http/server.ts is in this pull.
I added an empty commit with that line and pushed it. bun scripts/gate.ts passes locally. I did not rerun tsc or the tests, because the new commit changes no code.
What changed
src/apps/feature_schedule.tsfires an absorbed app's scheduled tool when it is due.- A new migration,
src/core/migrations/20261109050000-feature-fire.ts, adds the table that records each firing and its outcome. src/http/server.tshas a four-line change that wires the scheduler in.test/feature-schedule-fire.test.tscovers firing on time, firing once, and recording the outcome.
What I chose not to do
- I left the earlier commits as they were. Amending would have needed a force push, which is refused.
How to try it
- Open the preview at
/and check it boots. - The recorded outcomes are in the
feature_firetable.
Parked by the crew: the check stayed red through 2 automatic tries
The forge now calls each absorbed app's declared scheduled tools when they come due, and keeps the last fire of each. I ran
tsc --noEmitand four test files, and they are green. Those weretest/feature-schedule-fire.test.ts,test/feature-schedule.test.ts,test/pull-check-again.test.tsandtest/apps-features.test.ts. I did not run the whole suite; the forge's check does that on the push. I did not start the app, so the timer has not run against a live app.What changed
src/apps/feature_schedule.tsdue(entry, lastFired, now)is pure: an entry is due if it never fired, or its interval has passed since the last fire.fireDue(app, now, deps?)goes through each absorbed app whose production state isrunningand calls each due tool throughcallTool, the same loopback call thefeaturestool uses (POST/forge/tools/<name>, 64 KB, 10 s). There is no new HTTP path.startFeatureSchedule(app)ticks every minute and isunref'd.20261109050000-feature-fire.ts: tableapp_feature_fire, one row per (app, tool), holding the time, ok or the error's sentence, and the duration. The migration pin is committed.src/http/server.ts: the tick starts beside the other writers and is stopped in the server'sstop(). It does not start whenNODE_ENV=test, whichbun testsets, so no timer runs under the test harness unless a test callsstartFeatureSchedule. That addresses the #9892/#9916 risk.test/feature-schedule-fire.test.ts: covers due vs not due, once per window and again in the next, a failing tool recorded with its sentence, an asleep app skipped, and an un-absorbed app not called. It uses an injected clock and injected deps, so it never waits on wall time.Not done
keep_plan; that tool is not available in this session.To try it: absorb an app whose
forge.jsondeclares"schedule": [{ "tool": "scan", "every": "15m" }], run the forge, and look at theapp_feature_firerow after a minute.🤖 Generated with Claude Code
Closes #9926