Skip to content

feat(sidebar): Needs attention section and request_attention tool - #485

Open
andrebrait wants to merge 3 commits into
mainfrom
feat/attention-sidebar
Open

andrebrait wants to merge 3 commits into
mainfrom
feat/attention-sidebar

Conversation

@andrebrait

Copy link
Copy Markdown
Collaborator

What

A Needs attention section above Workspaces lists the sessions that wait on the user, in the same host → workspace → session tree, rows and badges as Workspaces. It is hidden while empty, always alphabetical, and has no pin, reorder, sort, filter or add controls. Sessions stay in Workspaces too.

A session needs attention while either holds:

  1. An open blocking dialog (ask, confirm, select, input, editor, open_url): tool permission prompts, and omp-web's own send_to_session/new_session confirmations. This uses the awaitingInput flag from feat(sidebar): mark sessions waiting for user input #461.
  2. The agent asked for the user. ompweb's omp build (runner/) gives every top-level session a request_attention({ reason }) tool (an SDK customTools entry, loadMode: "essential"). It appends an omp-web-attention custom entry. The session list's tail scan reports it as SessionInfo.attention while no real user message and no further agent tool call follows it, and the client shows it only while the session is not running. It persists in the session file, so it survives idle reaping and restarts.

Design: docs/specs/2026-11-13-attention-sidebar-design.md.

Notes

  • Linked hosts: a remote daemon's attention field passes through sessionEntry (lib/hosts/hub.ts); a malformed value drops only that field. Older daemons omit it, and older hubs strip it.
  • The section is capped at 40% of the sidebar height and scrolls on its own.

Verification

  • npx tsc --noEmit -p .; bun test --parallel components/SessionSidebar*.test.mjs lib/session-reader.test.mjs lib/hosts/hub.test.mjs lib/i18n.test.mjs (163 pass); runner bun test (29 pass, includes runner/test/attention.test.ts).
  • Built UI checked in a headless browser with seeded sessions: section placement, only the marked session listed, a stale marker not listed, no pin control, independent collapse, unaffected by search, 40% cap with scrolling, light and dark themes.
  • Before the rebase onto feat: run ompweb's own omp build over its own channel instead of RPC #473, the stock-omp version was checked against a real omp 18.18.8 (--tools, --no-tools, rpc-ui); the runner version is covered by the runner test but has not run against a live model.

Sessions waiting on the user (an open blocking dialog, or the agent's
request_attention marker newer than the last user message while idle)
appear in a Needs attention section above Workspaces, grouped by host and
workspace and sorted alphabetically. ompweb's omp build
(runner/) gives every session it starts the request_attention tool.
A marker no longer counts once the agent made more tool calls; synthetic
user messages do not clear it; a malformed marker from a remote daemon
drops only that field. Adds component and link tests, the CHANGELOG
upgrade note and a divider under the section.

This branch has not been deployed

No deployments
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