Repository navigation
Stop showing a work as waiting once its reply has arrived - #17
Conversation
The status line other Bots read named a hand-off as still open whenever the work kept an open id, even after that reply had come back. Nothing cleared the id when the answer arrived by another route, so an idle Bot looked loaded on work that had ended days before, and every job watch chased it. A work now stops counting as waiting when the reply for an open id is already on it, and when it has sat past a day with no result at all. A fresh work with no reply still shows as waiting.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab627b546e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .map(([id, work]) => ({ | ||
| id, | ||
| work, | ||
| out: (forgotten(work) ? [] : work.open.filter(childId => !arrived(work, childId))) |
There was a problem hiding this comment.
Preserve the give-up action for expired waits
When a work exceeds 24 hours without a result, clearing out also removes its entries from waitingView(), which supplies the “Give up waiting” actions in src/client/context-menu.js:77. However, the child remains in work.open, so waitsWork() still returns true and src/host/turns.js:1206 continues holding the parent's answer. If the reply is actually lost, the parent remains blocked while the user loses the recovery action designed for precisely that situation. Preserve the actionable wait even if its status label is suppressed; the handoff design in docs/plans/2026-10-16-bot-handoffs.md explicitly requires user-controlled abandonment and excludes automatic TTLs.
AGENTS.md reference: AGENTS.md:L53-L53
Useful? React with 👍 / 👎.
The ceiling first applied to every open id, so a work holding a subagent run for more than a day dropped that wait and took the whole entry out of the wait view, which is the view a restart relies on. A subagent run has no Bot to hand back, so the arrived and ceiling rules now apply only to Bot hand-offs.
A work kept the open id until the Bot that asked got round to reading the answer, so a row read open with its result already attached and every watch saw a phantom handoff. Writing the reply now clears the open id in the same save that attaches the result. A reply that never reaches the asker opens the wait again until the notice carrying it is read, which is the case the follow-through tests already pinned. An ask sent outside any work now marks its sender waiting only while it is recent, so an old unanswered ask cannot label an idle Bot for days.
Issue
No repo issue. This is defect
phantom-handoff-ledger-20261110from the internal register, shipped on Igor's order of 2026-11-10.Base is
stack/installed-0.3.2, notdev. The code that produces this label exists only on the local installed stack:origin/devandorigin/maindo not carryonItTest,sentOnOwnor the live-only wait filter. A PR againstdevwould patch code that is not there.What changed
ds-bot/src/host/handoffs.jscloseWork()now clears the parent's open id in the same save that attaches the result, instead of leaving the row open until the asking Bot read the answer. The row therefore never reads open with its result already attached.answerMissed()marks the result and puts the open id back, so the wait holds until the notice carrying the answer is read. This is whatfollow-through.test.jsalready pinned.held()drops an open id whose reply is already on the work and drops a Bot hand-off past a 24 hour ceiling with no result. Subagent runs are exempt, having no Bot to hand back. An ask sent outside any work marks its sender waiting only while it is recent, so an old unanswered ask cannot label an idle Bot for days.subWorkRun()now finds a settled run by its result as well as its open id, since a settled run is no longer open.ds-bot/test/handoff-results.test.js: five tests, two of which reproduce today's behaviour.Changelog
A handoff now reads closed as soon as its reply arrives, and a Bot no longer shows other Bots "waiting for X to hand back work" or "waiting for X to answer" on work whose answer already came back.
How I checked it
npm test: 2 failures, both pre-existing and reproduced on this branch with the change reverted (connectors-gateway.test.js,local-agents.test.jsenv sanitization)node scripts/build-client.mjs --check(rc 0)npm run lint(0 errors, 76 pre-existing warnings)coding_job_verify.py --base stack/installed-0.3.2: 7 passed, 0 failedReproducer:
a handoff reads closed as soon as its reply arrives. Run against the unfixed file it fails onthe work reads closed when the reply arrives, becauseopenstill held the answered child. The other reproducer,a work whose reply already arrived does not show as waiting, fails withactual: 'waiting for Tester to hand back work, for Chief'.Read back from the module after the fix:
Checklist
src/client/not changed, soclient.jsis untouchedCo-authored-by