Repository navigation
Re-carry: close a handoff when its reply arrives - #27
Conversation
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: ca71fe2665
ℹ️ 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".
| const results = work.results ?? [] | ||
| // A settled run is no longer open, so the results name it too. | ||
| const ids = new Set([...(work.open ?? []), ...results.map(result => result.id)]) |
There was a problem hiding this comment.
Exclude consumed results when matching subagent notices
When a subagent is continued while its earlier parent work still exists, this search keeps selecting the first run even after its settlement notice was read. takenWork() only removes IDs from work.open; it does not remove entries from work.results, which are now searched unconditionally. Consequently, turns.js routes subsequent settlement notices to the earlier parent instead of the work owning the new run. This is reproducible by settling and taking r1 under p1, then settling r2 for the same child under p2: subWorkRun() still returns r1/p1. Track which results have been consumed separately so each notice advances to the correct run.
Useful? React with 👍 / 👎.
| const pastCeiling = work => Date.now() - (work.at ?? 0) > WAIT_CEILING_MS | ||
| const forgotten = work => (work.results ?? []).length === 0 && pastCeiling(work) | ||
| const stillOwed = (work, childId, child) => child.to === undefined || (!arrived(work, childId) && !forgotten(work)) |
There was a problem hiding this comment.
Preserve recovery controls for aged outstanding handoffs
When a parent work is over 24 hours old and has no results, this filter hides all its Bot handoffs even if the recipient is still running or waiting for approval. It also uses the parent's age, so a newly dispatched child can disappear immediately. The underlying IDs remain in work.open, and waitsWork() still prevents the parent from answering, but waitingView() no longer exposes those waits. Since src/client/context-menu.js builds the give-up actions from waitingView().waits, the user loses the recovery action for precisely these outstanding handoffs. Keep actionable outstanding waits visible, or explicitly settle them rather than only filtering their presentation.
Useful? React with 👍 / 👎.
| // An ask sent on its own marks its sender waiting only while it is recent: one | ||
| // whose answer never closed it must not label an idle Bot for days. | ||
| for (const work of sentOnOwn()) if (onIt(work.to) && !pastCeiling(work)) add((view[work.from] ??= { bots: [], rooms: [], for: [] }).bots, work.to) |
There was a problem hiding this comment.
Apply the standalone-ask filter to the status text too
For an unanswered standalone ask older than 24 hours whose recipient is active, this change clears the sender from waitingView() but leaves statusOf() reporting waiting for … to answer. The latter still builds its sent list using only work.from === botId && onIt(work.to), without the new age check. Thus the stale waiting label remains in the status returned to other Bots through list_bots, despite the new test passing for the sidebar projection. Apply the same eligibility predicate to both projections so the reported status actually clears.
Useful? React with 👍 / 👎.
Job LE-20261111-042 (list_bots 'waiting for' label that does not clear).
The fix was built and merged as #17 into stack/installed-0.3.2 on 2026-11-10 (merge 8b8e198). When the stack moved to 0.3.5 it was not carried: ds-bot/src/host/handoffs.js on stack/installed-0.3.5 is still the pre-fix blob 4054b0d3, which is exactly the base #17 was written against. So the fix is not in the running app.
This PR applies the #17 content unchanged (git cherry-pick -m 1 8b8e198, clean apply). Scope: ds-bot/src/host/handoffs.js, ds-bot/test/handoff-results.test.js. Intended to ride the same rebuilt patch as #26 so Steve restarts once.