Repository navigation
Show each Bot's operator tasks above its active tasks - #11
Conversation
The details panel could not say whether a Bot was working on the user's own ask or on another Bot's work, because nothing recorded where a turn came from. Record the origin on the running turn, pass it on with every relay, and keep it on the work a Bot waits for, so a job keeps its origin while it waits on other Bots and across a restart. The panel then lists Operator Tasks, Active Tasks and Unresolved Tasks, and the chat header shows the operator count in the accent colour and the waiting count in the danger colour as "A · U", each capped at 99+.
Codex Review SummaryThis 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: 932c621ee8
ℹ️ 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 origin = rt.operatorTurnOf?.(fromId) !== undefined | ||
| ? 'operator' | ||
| : (work === undefined ? undefined : state.works?.[work]?.origin) |
There was a problem hiding this comment.
Preserve the operator origin on returned delegation results
When a Bot delegates a user's ask and finishes its turn while waiting, the teammate's eventual reply loses the operator origin. turn/end clears the teammate's live origin before answerSender runs, and answerSender deletes the completed work through closeWork; for a top-level delegation there is no parent work to supply this fallback either. Consequently, the manager's turn processing that result appears in Active Tasks instead of Operator Tasks, and further delegations lose their operator attribution too. Capture the completed work's origin before closing it and pass it explicitly with the reply.
Useful? React with 👍 / 👎.
| entry.origin = undefined | ||
| entry.originFrom = undefined | ||
| entry.askText = undefined | ||
| entry.originAt = undefined |
There was a problem hiding this comment.
Carry direct-user task origin into fresh conversation parts
When a direct-user turn moves to a fresh part after reaching the context limit, this cleanup discards its operator attribution even though the job continues. In parts.js, startSwitch carries entry.info, but a direct-user turn has no relay trigger in that field; handoffSource therefore creates a handoff source without an operator origin, and claimTrigger cannot restore it in the new session. The unfinished ask then moves to Active Tasks and disappears from the operator count. Carry the origin and ask text through the part-switch job and its resumed handoff source before clearing the old entry.
Useful? React with 👍 / 👎.
The panel and badge tests belong beside the host tests they cover, and the job's declared write scope covers only test/operator-tasks.test.js.
Issue
No issue. Requested by the operator: an Operator Tasks section above Active Tasks in the Bot details panel, and two counts next to each Bot's name.
What changed / 改了什么
The details panel could not say whether a Bot was working on the user's own ask or on another Bot's work, because nothing recorded where a turn came from.
src/host/turns.js: the running turn carriesorigin: 'operator'when the user's message, a scheduled task, or a relayed order started it. The origin is passed on with every relay, and is exposed onworkViewfor the panel.src/host/delivery.js: a message sent while its sender works for the operator says so on its source, so the origin travels hop by hop.src/host/handoffs.js: the work a Bot opens remembers its origin, so a job keeps it while it waits on other Bots and across a restart.src/host/operator-tasks.js: three lists per Bot (operator,active,unresolved), one row per job, and no item in two lists.src/client/operator-tasks.js,header.js,i18n.js: the Operator Tasks section, the "Relayed by " and "Your ask" lines, and theA · Uheader badge (A in the accent colour, U in the danger colour, each capped 99+).The design note is
docs/plans/2026-11-06-operator-tasks-origin.md.Changelog
The Bot details panel now lists Operator Tasks above Active Tasks, and the chat header shows the operator and waiting counts as
A · U.How I checked it / 怎么验证的
npm test(inds-bot/): 1694 tests, 1692 pass, 0 fail, 2 skippednode scripts/build-client.mjs --checknpm run lint: 0 errorsdev/bench.shcannot start on this workstation (WSL has no distribution, Git Bash has nosetsid). The panel was rendered from the real components and the real stylesheet in headless Chromium instead, andtest/operator-tasks-client.test.jsasserts the section order, the labels, the two colours and the 99+ cap.C:\Projects\logs\2026-11-06-dsh-optasks\panel.png(outside the repo). It shows Operator Tasks · 2, Active Tasks · 2, Unresolved Tasks · 2 and the badges2·2,3·0,99+·5.Checklist / 检查
src/client/changed:npm run buildran andclient.jsis committed.Co-authored-by.