Skip to content

(activity): light has-busy-agents for remote parents and local parents without a PTY #247

Description

@devsuitup

Symptom

.has-busy-agents (the parent row marker) only lights for a parent that is in activeSessions: activeSubagentsByParent is fed by the subagent-spawned / subagent-completed IPC, emitted by detectSubagentTransitions() (session-transitions.js), which scans activeSessions only.

Two parents never light:

  • a remote parent, even though the watch channel ((remote): push liveness over a persistent watch channel #241) is recursive and hears every agent-<id>.jsonl write — sessionIdFromRel in remote-activity.js requires a UUID basename, so subagent events are dropped rather than attributed;
  • a local parent launched outside Switchboard.

Read, not executed: confirm with a live subagent on the host before coding.

Fix

In the source adapter (see the domain-layer issue), attribute a subagent transcript event to its parent by walking up from the path — enumerateSessionFiles() in read-session-file.js knows the layouts — and emit subagentSpawned / subagentCompleted (or a decaying agentsBusy) for the parent, whatever the source.

Acceptance

  • A remote parent whose subagent is writing shows has-busy-agents within the watch coalescing window.
  • Same for a local parent with no PTY of ours.
  • The attribution function is pure and tested against the real subagent layouts; a mutation dropping the parent resolution makes it red.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions