Skip to content

feat(tasks): multi-host board with 'All hosts' default and host filter - #15

Open
HoangNguyen0403 wants to merge 11 commits into
RoundRedDot:mainfrom
HoangNguyen0403:feat/multi-host-tasks-board
Open

HoangNguyen0403 wants to merge 11 commits into
RoundRedDot:mainfrom
HoangNguyen0403:feat/multi-host-tasks-board

Conversation

@HoangNguyen0403

@HoangNguyen0403 HoangNguyen0403 commented Nov 4, 2026 •

Copy link
Copy Markdown

Summary

This PR introduces multi-host support to better-paseo's Tasks board:

  1. Unified Multi-Host Board by Default:

    • Concurrently aggregates tasks across all active Paseo daemons using Paseo's official Plugin Client API (useHosts() and getPaseoClient()).
    • Progressive loading: marks ready: true immediately for the local host while remote hosts stream in their initial snapshots without blocking on latency.
  2. First-Class Host Filters across All Surfaces:

    • Filter Bar: Added Host ▾ menu button with connection status indicators and an "All hosts" default toggle.
    • Details Sidebar Drawer: Added a 5th segment tab ([Server] / Host) alongside Agent, Project, Workspace, and Labels with live task counters per machine.
    • Filter Sheet: Added a collapsible Host section.
    • URL & Route Persistence: Encodes hostIds under parameter h (?h=srv_1,srv_2), defaulting to all hosts.
  3. Card Fields Setting & Live Settings Preview:

    • Added host as a configurable card field in Cards settings (Fields), enabled by default in Standard and Full density presets.
    • Live settings Preview reflects the Host toggle dynamically in real time (sample cards show/hide the host badge as the user toggles the switch).
    • Backwards-compatible schema preprocessor (migrateCardHost) ensures existing user configs seamlessly derive their host visibility without flipping density to "Custom".
  4. Remote Action Routing & Permissions:

    • Cards from remote hosts display a subtle • <Host> badge in the card meta row.
    • Remote Approvals & Denials: Approving or denying tool execution (respondToPermission) on remote tasks routes directly to the remote daemon via getPaseoClient(card.hostId). Local availability checks are cleanly bypassed for remote hosts to prevent false agent_missing / "Task no longer exists" rejections.
    • Remote Details History: Conversation prompts and message history in the Details Sidebar are loaded directly from the origin host client.
    • Host-Aware Navigation: "Open tab" and card clicks forward { serverId: card.hostId, agentId: card.id } to navigation.openAgent, cleanly switching Paseo to that host.
    • Stopping remote tasks surfaces a friendly hint to open the tab and stop on the remote machine.

Why this approach over daemon relays (PR #9)?

PR #9 attempted backend daemon-to-daemon connections, which stalled due to remote credential/relay token resolution. This implementation uses the app client-side SDK (useHosts(), getPaseoClient(), navigation.openAgent({ serverId, agentId })), which the Paseo app already authenticates and maintains persistently. Zero daemon changes or relay tokens required.

Test Plan

  • npm run typecheck passes with 0 errors (tsc --noEmit).
  • vitest run test/unit/tasks-multi-host.test.ts (7/7 passed).
  • Full test suite vitest run passes across all 266 files (6,387 tests passed).
Screenshot 2026-11-04 at 12 42 08

@HoangNguyen0403
HoangNguyen0403 force-pushed the feat/multi-host-tasks-board branch 3 times, most recently from e7e6ab6 to 8aebbd4 Compare November 10, 2026 14:21
@rburdet

rburdet commented Nov 12, 2026

Copy link
Copy Markdown

@HoangNguyen0403 can you fix conflicts ?

@luoph

luoph commented Nov 13, 2026

Copy link
Copy Markdown

Thanks for the multi-host work and the test coverage. This branch currently conflicts with main, and #35 also implements a multi-host board. We need to select one approach before merging either change.

For the selected approach, please verify host-specific action routing and identity handling, including agents and workspaces with the same IDs on different hosts, remote read failures, and disconnect/reconnect behavior. The final conflict-resolved revision will also need the required checks and two-host client validation.

…esolutions

The merged handle now forwards main's refreshUnreads to every host's store.
Keep the sidebar's showEmpty, the filter badge comment, the render tests'
sessionStorage reset and the multi-host mock's store fallback that the
merge resolutions carried.
Host joins FILTER_GROUP_ORDER first, so the sidebar's tabs, the filter bar
and the sheet read Host, Agent, Labels, Project, Workspace. The tab layout
tests and the filter bar's word order follow it.
…orkspaces apart

- Selection, card lookups and reveal carry the card's host, so two hosts
  that know the same agent id select and open their own card.
- Parent resolution takes the host, and the merged handle routes it to that
  daemon's store instead of the first store that knows the id.
- Read, unread, archive and unarchive are daemon-bound RPCs: a remote card
  now says to open it on its host rather than hitting the local daemon with
  a colliding id. Permission answers, details reads, open and the opened
  mark use the card's own client.
- Workspace and project filter values carry their host, so one host's
  workspace does not filter another's, and the projects of two hosts stay
  apart in the filter menus.
- Two-host tests: colliding agent and workspace ids, parent routing,
  disconnect/reconnect (subscriptions released), plus selection identity.
@HoangNguyen0403
HoangNguyen0403 force-pushed the feat/multi-host-tasks-board branch from 8aebbd4 to 0b36bb8 Compare November 15, 2026 09:40
@HoangNguyen0403

Copy link
Copy Markdown
Author

Rebased onto main (246a1305) and resolved the conflicts; the branch is MERGEABLE/CLEAN against the current base. Conflicted files kept both sides' intent:

  • client/tasks/cards/task-card.tsx: host tag + fields.host gating alongside main's parentTag() tip rendering.
  • client/tasks/board/filter-bar.tsx, filter-sheet.tsx, use-board.ts: host control/menu and hostIds alongside main's boxed toolbar controls, searchable sheet, openedTask and new mocks.

Host identity and action routing (the review question)

Verified and fixed where the old merge crossed hosts:

  • Same agent id on two hosts: the board lists both cards; selection and lookups now carry hostId (SidebarSelection.hostId, cardById(id, hostId), findCard(..., hostId)), so each row opens/selects its own card. Parent resolution takes the host and the merged handle routes it to that daemon's store, not the first store that knows the id.
  • Same workspace id on two hosts: workspace and project filter values are host-qualified (workspaceKey), so the filter menus list two entries and picking one filters only that host's cards. card filter and cardFilterValue use the same key.
  • Remote reads: card details read first prompt / last message / last human message through the card's own getPaseoClient(hostId); a remote failure leaves the local board and its error state intact (error only when every host fails).
  • Routing by action: permission answers, open (serverId + agentId) and the opened/unread mark use the card's client. Read, unread, archive, unarchive and stop are daemon-bound RPCs (they run against the current daemon), so a remote card now says "Open this task on its host to change it" instead of calling the local daemon with a colliding id.
  • Disconnect/reconnect: a host leaving useHosts drops its cards and releases its subscriptions; coming back re-lists it and restores the cards (covered by test).

Validation run

  • npm run typecheck — clean.
  • npm test — 297 files, 9,924 tests passed on this base.
  • npm run check:hermes — OK (Hermes V1 and legacy 0.81.5; built bundle + Tasks chunk).
  • npm run build:client — OK (bundle 726 KB, Tasks chunk 838 KB).
  • New two-host tests in test/unit/tasks-multi-host.test.ts: colliding agent ids (both cards, host-aware parent routing), colliding workspace ids (two filter values, one host's filter), offline → cards dropped + subscriptions released → reconnect → cards and re-list; plus selection identity in tasks-sidebar-model.test.ts.

Open point: if read/archive on a remote card should be done from the board rather than opening its tab, that needs an SDK path that targets another daemon (today's read/archive RPCs are bound to the current daemon). Tell me if that is required for this PR or acceptable as the current hint.

@HoangNguyen0403

Copy link
Copy Markdown
Author

Thanks for the multi-host work and the test coverage. This branch currently conflicts with main, and #35 also implements a multi-host board. We need to select one approach before merging either change.

For the selected approach, please verify host-specific action routing and identity handling, including agents and workspaces with the same IDs on different hosts, remote read failures, and disconnect/reconnect behavior. The final conflict-resolved revision will also need the required checks and two-host client validation.

Resolve conflict and added test to covered

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.

3 participants