Skip to content

(trace): subagent activity is traced from its single write path, with its source - #292

Merged
devsuitup merged 1 commit into
mainfrom
fix/291-trace-subagent-source
Sep 14, 2026
Merged

devsuitup merged 1 commit into
mainfrom
fix/291-trace-subagent-source

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Closes #291.

Found while reading the overnight trace on v0.0.79 (.work-files/switchboard/trace-2026-09-13-nuit.md, measure 3): one remote parent produced 2 277 class.subagent running:true and zero recv.subagent-spawned, because the trace call lived in the local IPC handler while #288 made the remote and local-transcript sources call noteSubagentActivity() directly.

  • noteSubagentActivity(parent, agentId, source, extra) is now the sole emitter of recv.subagent-spawned; source is local-ipc (default), remote-watch or local-transcript; the local handler passes its bootstrap/heartbeat fields through extra, so the payload shape is unchanged for the local case and emitted once.
  • recv.subagent-completed carries via: ipc (local completion event), ttl (the 60 s prune — the only completion the remote and local-transcript sources ever get), parent-cleared (parent PTY exit or remote stop).
  • docs/activity-trace.md updated.
  • Tests (7)–(12) in test/dom-sidebar-subagent-running-parity.test.js: one spawned event per source, exactly one for the local path, the three via values.

… its source

recv.subagent-spawned was emitted only by the local IPC handler, so remote
and local-transcript subagents never appeared in the trace even while their
running dot was painted. noteSubagentActivity now emits it with the source
(local-ipc, remote-watch, local-transcript); recv.subagent-completed carries
via ipc / ttl / parent-cleared. Closes #291.
@devsuitup
devsuitup merged commit 6e04c3e into main Sep 14, 2026
10 checks passed
@devsuitup
devsuitup deleted the fix/291-trace-subagent-source branch September 14, 2026 06:08
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.

(trace): subagent activity from remote and local-transcript sources is not traced

1 participant