Skip to content

(remote): mirror subagent meta.json sidecars - #249

Merged
devsuitup merged 1 commit into
mainfrom
fix/remote-meta-json
Sep 10, 2026
Merged

(remote): mirror subagent meta.json sidecars#249
devsuitup merged 1 commit into
mainfrom
fix/remote-meta-json

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Closes #244.

Why

Remote subagents rendered SUB instead of their agent type. The type lives in a sidecar agent-<id>.meta.json next to the transcript, read by readSubagentMeta(); the remote inventory only listed *.jsonl, so the sidecar was never mirrored and the lookup returned null on the mirrored root.

What

  • LIST_COMMAND lists *.meta.json alongside *.jsonl; parseInventory, fetchFiles and the mirror filter accept them through a separate isSafeMetaRelPath guard. isSafeRelPath stays .jsonl-only, so the watch channel keeps treating only transcript writes as activity.
  • Transcripts are fetched before sidecars inside a cycle, so MAX_CYCLE_FILES / MAX_CYCLE_BYTES ((remote): bound a sync cycle by file count and total bytes #238) never let sidecars starve them.
  • A sidecar-only change is reported to the indexer under its transcript's rel path: a subagent whose transcript was already mirrored gets re-derived when the sidecar lands, instead of staying SUB until the transcript itself changes.
  • Context doc: new "Remote hosts — meta.json sidecars" paragraph in .ai/contexts/session-cache.md.

Measured on the host: 251 sidecars, ~140 bytes each, layout <project>/<session>/subagents/agent-<id>.meta.json.

Proof

Mutations on the shipped files, each red on its own test only: .jsonl-only inventory guard → listing test; .jsonl-only mirror filter → mirror/readSubagentMeta, sidecar-mapping and priority tests; drop the fetch priority → priority test; drop the sidecar→transcript mapping → mapping test.

task check: 1216 pass, 0 fail, 8 pre-existing skips.

readSubagentMeta() reads a sidecar next to the subagent transcript, but
the remote inventory only ever listed *.jsonl, so mirrored subagents
rendered SUB regardless of their real type (#244). Widen the inventory
find and a dedicated isSafeMirrorRelPath gate (kept separate from
isSafeRelPath so remote-watch's activity classification is untouched) to
carry .meta.json alongside its transcript, with transcripts kept ahead of
sidecars when a sync cycle is full.
@devsuitup
devsuitup merged commit 284699e into main Sep 10, 2026
10 checks passed
@devsuitup
devsuitup deleted the fix/remote-meta-json branch September 10, 2026 13:21
@devsuitup devsuitup mentioned this pull request Sep 10, 2026
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.

(remote): mirror subagent .meta.json so remote subagents show their type instead of SUB

1 participant