Skip to content

acpmux: tasks: give a session a task, end it with a typed result in one call, list a chat's tasks - #24992

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
hb-acpmux/task-results
Oct 24, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
hb-acpmux/task-results

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Part 1 of goal 8 in the design doc (leo-workspace research/2026-10-24-acpmux-tasks-liveness-urgency.md, leo-workspace#1010): task state with typed results, and acpmux task ls.

Leo, 2026-10-24: "shouldn't you be able to tell more metadata regarding... when things are completed, when things are not completed?"

What it does

  • acpmux task new SESSION "title" [--stop "done when"] [brief] (_acpmux/task_new): gives a session on this daemon a task. The task is a brief in the existing ledger (dispatch.rs, kind: "task") that records the giver's session id (fromSession). The lane gets the brief as the giver's message (the session_message chip), with the task id first and the one call that ends it.
  • acpmux task done|blocked|failed ID --summary "one line" [--pr URL]... [--sha SHA]... [--why …] extends _acpmux/report and does not duplicate it. hub/tasks.rs checks the result: the summary is one line of at most 300 characters; why is required unless the state is done; PRs are https URLs; SHAs are 7 to 40 hex digits. A bad result is refused with task.result_invalid. Only the task's own session or the chat that gave it can end it (task.not_yours). Sending the same call again is a replay (replayed: true) and gives one result and one card. The person on this machine (its socket) may also end a task; a Web or peer connection, which proves no session, may not. When someone other than the lane ends a task, the card says Ended by: NAME. The replay check runs under the ledger's lock, so two identical reports at once send one card. A card that can't be delivered (the giver is gone, or the prompt is refused) stays on the row as result.undelivered; task ls shows it, and the same call again sends it again.
  • The result goes back to the giver's chat once, as one prompt with the new provenance task_result {from, fromName, to, taskId, state}. The chat draws it as the lane's sender card, and the card opens the lane. No card is sent when the giver ended the task itself.
  • acpmux task ls [--from NAME | --all] [--open] (_acpmux/tasks): lists the tasks this chat gave, open ones first, with each lane's state now and each result's summary.
  • The gallery has a task-result variant (RemoteSender.gallery.ts).

blocked stays open, so the giver can end the task once it is unblocked. Not in this PR, each in its own later PR: tasks for a peer's session, liveness (a lane that closes with its task still open), urgency boxes, and the coordinator sweep.

Size

About 1,030 changed lines, over the ~800 guideline. About 400 of them are tests, the gallery variant, and the regenerated protocol spec and methods.ts; the code itself is about 615 lines. The brief handlers were moved out first, as their own PR (#24970), so server/requests.rs changes by only 7 lines here. Splitting the CLI from the RPC would land a task_new nobody can call.

Tests (huge-blue)

  • New and passing: tests/hub_integration/tasks.rs, with
    • a_task_brings_its_typed_result_back_to_the_chat_that_gave_it_once
    • a_blocked_task_says_why_and_a_task_is_given_only_to_a_session_here (also: Web and Peer are refused task.not_yours, red without the fix; and the person's own result says Ended by:)
    • two_reports_at_once_send_one_card_and_a_card_not_delivered_is_kept_and_sent_again (red on the earlier head: a refused sender name left a starting row)
  • Also passing: the hub::tasks unit tests and the webview test incomingMessage.test.ts ("a task's result is its lane's message, and opens the lane").
  • peer_integration 32/32. lib 719/720: the one failure, protocol_registry_names_every_served_method (_acpmux/unknown), is red on base as well. clippy, cargo fmt, vp fmt, typecheck and bun (33) are clean.
  • The protocol spec was blessed and regenerated (protocol_ir_is_current, acpmux-protocol:codegen).

Capture

No capture: the only visible change is that a task's result draws as the lane's existing sender card, unchanged, and that card opens the lane. Showing it in the app takes a live acpmux daemon with two chats, and the capture minis run with no agent backend (the agent-pane tour marks chat as optional). The gallery's new task-result variant (RemoteSender.gallery.ts) shows the card, and gallery visual evidence captures it. The real-chat end-to-end check is on Leo's machine once the nightly carries this.

Review

Codex xhigh via acpmux (session review-24939 on huge-blue): SHIP at 54a3db8, after four rounds. It found that a Web or peer connection could end a task (fixed: task.not_yours); that two reports at once could send two cards; that a refused sender name left a claimed row; that a card that failed to send was only logged; and that keyed retries of an undelivered card, and late send failures, misbehaved. Each of these has a test.

Agent session: big-red

🤖 Generated with Claude Code

teamleaderleo and others added 4 commits October 24, 2026 14:54
…ne call, list a chat's tasks

acpmux task new SESSION TITLE writes a brief for a session on this daemon
(dispatch starts a new one) with the giver's session id, and sends the lane
the brief with the task id and its one-call finish first. acpmux task
done|blocked|failed ID --summary [--pr] [--sha] [--why] extends
_acpmux/report with a checked result; the result comes back to the giver
once, as the lane's card (provenance task_result). acpmux task ls lists the
tasks a chat gave, open first, with each lane's state now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16c8c-54ec-71b2-a0fa-125d1404dd72&host=big-red
…omeone else ended names them

Codex review: a connection with no caller could end a task, and a Web or peer one
proves no session, so its result would read as the lane's own card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16c8c-54ec-71b2-a0fa-125d1404dd72&host=big-red
…ore claiming; keep a card not delivered and send it again on retry

Codex review of d2121a8 (BLOCK, three P2s):
- the replay check ran on a stale row, so two reports at once could both send a card; it now runs under the ledger's lock
- an invalid fromAgent was refused after the task was claimed, leaving a starting row; it is checked first
- a card that failed to send was only logged; the row now says result.undelivered and why, task ls shows it, and the same call again sends it again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16c8c-54ec-71b2-a0fa-125d1404dd72&host=big-red
… late send failure marks only its own result

Codex review of cf1b618 (BLOCK, two P2s):
- the lastReportKey replay ran before the undelivered check, so a retry with an idempotencyKey replayed forever
- a send failure marked whatever result the task had by then; it now marks only the result it sent (its at)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16c8c-54ec-71b2-a0fa-125d1404dd72&host=big-red
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by hb-acpmux on big-red · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-sbpzl created for this PR by the cmux coordinator.

@blacksmith-sh

blacksmith-sh Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Found 35 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpc8vhazmj/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpkjy2i5pv/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
src/pages/settings/categories.test.ts/categories.test View Logs
src/pages/settings/categories.test.ts/categories.test View Logs
src/pages/settings/serverCard.test.tsx/serverCard.test.tsx View Logs

...and 25 more test failures. View all on Blacksmith: run 40139446261, run 40139446238

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo
teamleaderleo merged commit 30393d1 into feat-cmux-next Oct 24, 2026
196 of 217 checks passed
@teamleaderleo
teamleaderleo deleted the hb-acpmux/task-results branch October 24, 2026 23:20
@github-actions

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Probably yours: accent-glass-invariants.test.ts fails here but not on main's latest full suite. Seen on other PRs too (likely flaky): claimPaint.test.tsx, claimPaint.test.tsx, agent-pane-agents-pill.test.ts and 12 more. This PR merged before its CI finished: fix forward on main.

CI failed on 54a3db8814 (run 40139446261 attempt 1): 2 code, 1 unknown.

Job Verdict Why
web / react-apps-base-check (2) code a web test failed
web / react-apps-base-check (3) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs claimPaint.test.tsx a pooled Settings page claimed by the host reports its paint once its first screen is in: failed (job)
  • seen on other PRs claimPaint.test.tsx a Settings page loaded fresh reports its first paint once its first screen is in: failed (job)
  • new in this PR accent-glass-invariants.test.ts no orange or system accent and no opaque glass on 2030 gallery stages: failed (job)
  • seen on other PRs agent-pane-agents-pill.test.ts by default the running agents sit in the tray above the composer, not in the transcript: failed (job)
  • seen on other PRs agent-pane-background-tasks.test.ts the summary card lists the chat's background tasks: running ones first, the finished folded: failed (job)
  • seen on other PRs agent-pane-queue-collapse.test.ts a long queue > an opened long queue keeps Show less and the focused row in sight, never a half row (...: failed (job)
  • seen on other PRs agent-pane-queue-collapse.test.ts a long queue > an opened queue with a two-line row shows whole rows only, no row under another (capt...: failed (job)
  • seen on other PRs agent-pane-queue-collapse.test.ts a long queue > a folded queue with a long row opened shows only whole rows above the fold (capture, ...: failed (job)
  • seen on other PRs categories.test.ts the categories are the approved ones, in order: failed (job)
  • seen on other PRs serverCard.test.tsx the card shows status, version line, socket and tailnet address: failed (job)
  • ... 6 more in the job logs
Matched log lines
web / react-apps-base-check (2): (fail) a pooled Settings page claimed by the host reports its paint once its first screen is in [182.56ms]
web / react-apps-base-check (3): (fail) the categories are the approved ones, in order [0.13ms]

Not re-run automatically: web / react-apps-base-check (2), web / react-apps-base-check (3), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

This branch had an error being deployed

1 failed and 2 inactive deployments
cmux-tui-merge-tree — 54a3db88 Deployed Oct 24, 2026 by teamleaderleo via publish the merge tree #5604
artifacts — 54a3db88 Deployed Oct 24, 2026 by teamleaderleo via add the Windows daemon to the tree #51093
sentry-dsyms — 54a3db88 Deployed Oct 24, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #51093
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