Skip to content

feat(client): track Pilot tasks and scope views - #16

Merged
enkerewpo merged 5 commits into
syswonder:mainfrom
laojiahuo2003:feat/pilot-multitask-stream
Nov 3, 2026
Merged

enkerewpo merged 5 commits into
syswonder:mainfrom
laojiahuo2003:feat/pilot-multitask-stream

Conversation

@laojiahuo2003

Copy link
Copy Markdown
Contributor

Problem

Pilot can run several tasks in one conversation, but the client treated every
RTDL plan as part of one global stream. The execution tree, the Executor card
and the plan overview could show plans from different tasks, and a finished
call disappeared from the card on the next poll.

When the Executor query failed, the plan overview printed the raw
<AioRpcError ...> repr. It did not say which hop failed. A dead Atlas also
stacked requests, because each failed query waits on its 4 s deadline while
the overview polls every 2 s.

Changes

Task tracking

  • Read Pilot task_state events and keep a task list in the sidebar. You can
    follow the latest task or pin one.
  • Task snapshots persist with the conversation. They survive reload and
    conversation switching, and a new event replaces them.

Task-scoped execution views

  • The tree, the Executor card and the call context share one ownership scope.
    Without task ownership information (sessions saved before this change,
    Pilot builds that send only goal/status, or before the first task_state
    event), every plan this conversation holds a tree for counts as owned.
    Executor plans from other clients stay out.
  • The Executor card follows the plan the tree shows, which is the running
    one if any. It keeps one complete call group per plan, so completed calls
    stay visible and a newer owned plan is what replaces the group.
  • Canceled plans are no longer labeled completed, and Escape closes call
    details before the plan overview underneath.

Executor query errors

  • /api/executor/active-plans returns reason (atlas_unreachable,
    executor_not_registered, executor_unreachable, executor_error) and the
    endpoint involved. The frontend shows a translated headline and hint, with
    the raw gRPC detail folded into "Technical details".
  • A poll is skipped while the previous query is still in flight.

Plan overview

  • Live and saved plans are in separate sections. Saved plans are grouped by
    task, with status pills and a "View call details" button per call. Plans
    saved without task information get their own group.
  • The overview and the task list are rebuilt only when their content changes,
    so polls keep scroll position, open sections and clicks.
  • The modal close button keeps its size on narrow screens. A 680px rule
    stretched every .icon-button to full width.

Protocol

  • pilot_pb2.py is regenerated from the pilot.proto that robonix
    af458212 (feat(rbnx): declare capability transports in manifests (#296))
    emits at build time, with protobuf 6.31.1. The proto is generated from
    capability IDL in that repo and is not checked in here.

Known limitations

  • c2cd2b4 and 426e23a have no commit body. They are pushed history, so
    rewording them would need a force-push. I left them as they are.
  • A saved terminal state (failed or canceled) wins over a live running from
    the Executor. This guards against stale polls. If the Executor ever retries
    an op under the same op_id, the card would keep the old outcome.

Validation

  • 63 Python unit tests
  • 74 Playwright tests (desktop and mobile)
  • vitals.bundle.js rebuild is byte-identical
  • scripts/check_commit_authorship.py --base upstream/main --head HEAD passes

Link task selection to RTDL trees and Executor call summaries, retain completed calls, and add a conversation-wide plan overview.

Stabilize sidebar layout and scrolling, correct canceled plan labels and nested dialog dismissal, and cover the behavior with browser regressions.
Tag active-plan query failures with the hop that failed (Atlas, Executor
registration, Executor connection or Executor response) and show a readable
notice with the raw gRPC detail folded away. Skip a poll while the previous
query is still waiting on its deadline.

Group saved plans by task in the plan overview, with status pills and a
group for plans saved without task information. Rebuild the overview and
task list only when their content changes, so polls keep scroll position
and clicks.

Share one plan-ownership scope between the tree, the Executor card and the
call context, so plans from Pilot builds without task ownership show in
all three, and make the Executor card follow the plan the tree displays.
Keep the modal close button at its size on narrow screens and drop unused
translations.
Copilot AI balanced review requested due to automatic review settings October 30, 2026 05:45

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@enkerewpo enkerewpo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested locally: 63 Python and 74 Playwright tests pass. With an unreachable Atlas, /api/executor/active-plans returns reason: atlas_unreachable with the endpoint and a clean gRPC detail. pilot_pb2 field numbers match TaskStateEvent/TaskSummary on robonix dev, and Pilot sends a plan's owning task_state before the plan event, so the planIds scoping holds. Main ask: split out or explain the robonix.history removal. The other comment is small.

Comment thread src/robonix_client/static/app.js Outdated
Comment on lines +212 to +216
// One-time migration: preserve conversations without taskState (legacy sessions)
// and conversations still awaiting their first task_state event.
if (localStorage.getItem("robonix.taskOwnershipCleanup") !== "1") {
localStorage.removeItem("robonix.history");
localStorage.setItem("robonix.taskOwnershipCleanup", "1");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This drops the robonix.history migration and deletes the key on first load, but the comment says legacy conversations are preserved. It is unrelated to task scoping and silently discards old prompt history. Could you move it to a separate PR, or keep the migration?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, that change was unrelated. Reverted in 615133d: loadConversations is back to the upstream version, so the robonix.history migration is kept and nothing deletes the key. The test now checks that history is preserved and still migrates when robonix.conversations is unreadable.

Comment thread src/robonix_client/static/app.js Outdated
const controls = maybe("taskScopeControls");
if (controls) {
const buttons = [];
[["", "Follow latest task"]].forEach(([id, label]) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This loops over a single entry, and the id ? … : … branch can never be taken. A single button would be clearer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 615133d. It is now a single button with aria-pressed taken from state.followLatestTask. I also removed some UI leftovers that became dead in this PR (unused i18n entries and CSS rules).

Restore the upstream robonix.history migration in loadConversations.
The task ownership work no longer deletes old prompt history.

Render the scope control as a single "Follow latest task" button.

Remove leftovers from the replaced goal and RTDL panels: 25 i18n
entries with no remaining users (20 of them upstream entries whose
last caller this branch removed), the .goal-line, .goal-details and
hidden panel-header rules, and the duplicate .task-list-row block.
Translate the task panel aria-label.

Compute plan records and task plan ids once per render instead of
per item.

@enkerewpo enkerewpo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Re-ran on 615133d: 63 Python and 74 Playwright tests pass, and pilot_pb2 still matches the pilot contract on robonix dev.

@enkerewpo
enkerewpo merged commit 2d30ce1 into syswonder:main Nov 3, 2026
3 checks passed
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