fix(activity): render native activity of one input in one progress bubble #49

Merged
karsten merged 1 commit from fix/native-activity-single-bubble into main 2026-11-05 18:34:22 +00:00
Owner

Operator-reported noise with MATRIX_NATIVE_ACTIVITY=true: main, dispatcher classifier and worker turns of one input each created their own persistent Matrix message (NativeActivityDelivery keyed one editable message per turn id).

Fix (plugin side; full per-input correlation of classifier/worker phases additionally uses harness/core#266, which adds only the origin anchor id to the dispatcher routing envelope; without it this PR falls back to one bubble per dispatched task):

  • MatrixChannel.taskActivity passes the host completion-anchor id of the originating input (already supplied by core: main turns via the input, classifier/worker via the dispatcher's routing envelope from the task's durable dependency anchor).
  • NativeActivityDelivery keys the native message by (address, anchor id), falling back to (address, dispatched task id), then the old per-turn id. Each internal turn renders one bounded line (max 8 per bubble, max 128 bubbles tracked) into that single message via the existing edit path.
  • Tool names/states stay visible; arguments/results never enter the payload (unchanged).
  • Restart recovery marks every in-flight tool line of a shared bubble interrupted (multiline-safe).

Tests (test/native-activity-bubble.test.mjs, real MatrixChannel + TurnActivity against materialized core): one input → 1 progress bubble + final answer exactly once (previously 4); fallback per task; 2 inputs same room / same anchor other room isolated; worker failure visible; slow delivery/race bounded with latest terminal state; restart recovery. On origin/main the new test fails (4/2/8 bubbles).

Validation: core main c248ca1 with these plugin bytes materialized: tsc --noEmit 0, build 0, existing native tests 18/18, plugin tests 25/25. Full core suite 1465 pass / 21 fail locally; the failure set is identical with unmodified plugins (macOS /tmp canonical-home + missing dist before build), so not caused by this change. Mandatory review: 1 round, passed, 0 findings, fingerprint c72b3cb7.

Not included / not activated: core plugins.lock.json pin bump + release + daemon restart are required for this to go live. Core PR #265 and routing PR #264 untouched.

Operator-reported noise with `MATRIX_NATIVE_ACTIVITY=true`: main, dispatcher classifier and worker turns of **one** input each created their own persistent Matrix message (`NativeActivityDelivery` keyed one editable message per turn id). **Fix (plugin side; full per-input correlation of classifier/worker phases additionally uses harness/core#266, which adds only the origin anchor id to the dispatcher routing envelope; without it this PR falls back to one bubble per dispatched task):** - `MatrixChannel.taskActivity` passes the host completion-anchor id of the originating input (already supplied by core: main turns via the input, classifier/worker via the dispatcher's routing envelope from the task's durable dependency anchor). - `NativeActivityDelivery` keys the native message by `(address, anchor id)`, falling back to `(address, dispatched task id)`, then the old per-turn id. Each internal turn renders one bounded line (max 8 per bubble, max 128 bubbles tracked) into that single message via the existing edit path. - Tool names/states stay visible; arguments/results never enter the payload (unchanged). - Restart recovery marks every in-flight tool line of a shared bubble interrupted (multiline-safe). **Tests** (`test/native-activity-bubble.test.mjs`, real `MatrixChannel` + `TurnActivity` against materialized core): one input → 1 progress bubble + final answer exactly once (previously 4); fallback per task; 2 inputs same room / same anchor other room isolated; worker failure visible; slow delivery/race bounded with latest terminal state; restart recovery. On origin/main the new test fails (4/2/8 bubbles). **Validation:** core main c248ca1 with these plugin bytes materialized: `tsc --noEmit` 0, build 0, existing native tests 18/18, plugin tests 25/25. Full core suite 1465 pass / 21 fail locally; the failure set is identical with unmodified plugins (macOS `/tmp` canonical-home + missing dist before build), so not caused by this change. Mandatory review: 1 round, passed, 0 findings, fingerprint c72b3cb7. **Not included / not activated:** core `plugins.lock.json` pin bump + release + daemon restart are required for this to go live. Core PR #265 and routing PR #264 untouched.
fix(activity): render native activity of one input in one progress bubble
All checks were successful
plugins-ci / compatibility (push) Successful in 2m46s
b34c126332
Main, dispatcher classifier and worker turns of the same originating input
previously each created their own persistent Matrix message. Key the native
bubble by the host completion-anchor id (fallback: dispatched task id, then
turn) and render one bounded line per internal turn into it. Tool names and
states stay visible; arguments/results never enter the payload. Restart
recovery marks every in-flight tool line interrupted.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/plugins!49
No description provided.