Guides: the wait for a commit's outcome reads payload.trigger.commitOid #1
merged run-guide-wait-example was squashed into main as b65083a by jonas, 2026-11-28 21:25 UTC. jonas opened it 2026-11-28 21:25 UTC.
look.md and website.md waited with `payload: { commitOid }`. `worker-updated` and `worker-update-failed` name their commit in `payload.trigger`, and `waitForEvent` compares top-level payload fields alone, so that wait timed out on a commit that did publish. The guides now read where the root's log ends before the commit, and take each outcome after that offset until one names the commit.
Proof: the same loop found the outcome of config commit e04760eb6224609c2c5d16b0539bd7f79f9ac538 on iterate.com (root offset 1903840); the old filter timed out on it.
Card: tasks/fix-the-run-tool-guide-s-waitforevent-example-for-worker-updated.md
Via: /agents/claude/run-guide-wait-example-mx0wxfcb-5a973d
Session: claude 7ba4426c-d452-4c93-804a-9c3c1791d4c7 on beelink
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Wq8CaYLKDR5JeKxYYoJYJpConversation
Nobody has said anything yet.
Sign in to comment or to merge.
Files
2 files changed
M onboarding/look.md
@@ -52,17 +52,27 @@ const next = css .replace(/^(\s*)--primary:.*$/m, `$1--primary: ${colour};`) .replace(/^(\s*)--sidebar-primary:.*$/m, `$1--sidebar-primary: ${colour};`); +const root = itx.cd("/"); +// where the root's log ends now, before the commit +const head = (await root.readEvents(Number.MAX_SAFE_INTEGER, 1)).scannedThroughOffset; const { commitOid } = await repo.commitFiles({ message: "Look: a green primary colour", parent: tip, changes: [{ path: "apps/theme.css", content: next }], }); -return await itx.cd("/").waitForEvent({ - type: ["events.iterate.com/mind/worker-updated", "events.iterate.com/mind/worker-update-failed"], - payload: { commitOid }, - afterOffset: 0, - timeoutMs: 60000, -}); +// The outcome names its commit in `payload.trigger.commitOid`. A `payload` filter compares +// top-level fields alone, so take each outcome after `head` until one names this commit. +let outcome; +let after = head; +do { + outcome = await root.waitForEvent({ + type: ["events.iterate.com/mind/worker-updated", "events.iterate.com/mind/worker-update-failed"], + afterOffset: after, + timeoutMs: 60000, + }); + after = outcome.offset; +} while (outcome.payload.trigger?.commitOid !== commitOid); +return outcome; ``` The icon, by the subagent, the same way: commit one square SVG as `profile/icon.svg` with the
M onboarding/website.md
@@ -43,10 +43,16 @@ search, only what matches them. What the owner said in the sign-up is private: it tells you what the page is for, and none of their words, plans or work details go on the page. Never an email address, a phone number, a home address, or a guess. No tool, no form, no list that keeps data."; -- "Commit with `itx.repos.get('/repos/config').commitFiles`, the tip as `parent`. Wait for the - outcome: `await itx.cd('/').waitForEvent({ type: ['events.iterate.com/mind/worker-updated', -'events.iterate.com/mind/worker-update-failed'], payload: { commitOid }, afterOffset: 0, -timeoutMs: 60000 })`. On a failure, fix it and commit again. Then fetch the address with +- "Before the commit, read where the root's log ends: + `const head = (await itx.cd('/').readEvents(Number.MAX_SAFE_INTEGER, 1)).scannedThroughOffset`. + Commit with `itx.repos.get('/repos/config').commitFiles`, the tip as `parent`. Wait for the + outcome. It names its commit in `payload.trigger.commitOid`, and a `payload` filter compares + top-level fields alone, so take each outcome after `head` until one names your commit: + `let outcome, after = head; do { outcome = await itx.cd('/').waitForEvent({ type: +['events.iterate.com/mind/worker-updated', 'events.iterate.com/mind/worker-update-failed'], +afterOffset: after, timeoutMs: 60000 }); after = outcome.offset; } while +(outcome.payload.trigger?.commitOid !== commitOid)`. On a failure (`outcome.payload.error`), fix + it and commit again. Then fetch the address with `itx.fetch`, with no sign-in: 200, with your page's own words. A 401 or a sign-in page means it is not public: fix it."; - the report rule of `onboarding/subagents.md`.