Skip to content

Show each Bot's operator tasks above its active tasks - #11

Merged
neotechnet merged 2 commits into
stack/installed-0.2.7from
feat/operator-tasks-origin
Nov 6, 2026
Merged

neotechnet merged 2 commits into
stack/installed-0.2.7from
feat/operator-tasks-origin

Conversation

@neotechnet

Copy link
Copy Markdown
Owner

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 carries origin: '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 on workView for 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 the A · U header 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 (in ds-bot/): 1694 tests, 1692 pass, 0 fail, 2 skipped
  • node scripts/build-client.mjs --check
  • npm run lint: 0 errors
  • Smoke test: dev/bench.sh cannot start on this workstation (WSL has no distribution, Git Bash has no setsid). The panel was rendered from the real components and the real stylesheet in headless Chromium instead, and test/operator-tasks-client.test.js asserts the section order, the labels, the two colours and the 99+ cap.
  • Screenshot attached: rendered panel screenshot: 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 badges 2·2, 3·0, 99+·5.

Checklist / 检查

  • One issue, one subject.
  • src/client/ changed: npm run build ran and client.js is committed.
  • No keys, tokens or personal data, also in screenshots.
  • No AI tool as author or Co-authored-by.

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+.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T10:23:00.620076Z 932c621 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@neotechnet neotechnet closed this Nov 6, 2026
@neotechnet neotechnet reopened this Nov 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +75 to +77
const origin = rt.operatorTurnOf?.(fromId) !== undefined
? 'operator'
: (work === undefined ? undefined : state.works?.[work]?.origin)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread ds-bot/src/host/turns.js
Comment on lines +971 to +974
entry.origin = undefined
entry.originFrom = undefined
entry.askText = undefined
entry.originAt = undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@neotechnet neotechnet closed this Nov 6, 2026
@neotechnet neotechnet reopened this Nov 6, 2026
@neotechnet neotechnet closed this Nov 6, 2026
@neotechnet neotechnet reopened this Nov 6, 2026
@neotechnet neotechnet closed this Nov 6, 2026
@neotechnet neotechnet reopened this Nov 6, 2026
@neotechnet neotechnet closed this Nov 6, 2026
@neotechnet neotechnet reopened this Nov 6, 2026
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.
@neotechnet
neotechnet merged commit 4d7c152 into stack/installed-0.2.7 Nov 6, 2026
13 checks passed
@neotechnet
neotechnet deleted the feat/operator-tasks-origin branch November 6, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant