Workflow tool: persist each agent() call's label/phase in the agent's on-disk metadata at spawn time

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 17, 2026

Summary

When a Workflow script spawns agents via agent(prompt, {label, phase}), the harness
knows the label and phase of every call — but neither is written to the agent's
on-disk records until the run completes. Mid-run, journal.jsonl only carries
started/result entries keyed by an opaque hash, and agent-<id>.meta.json
contains no label or phase.

This makes live observability tooling blind: anything that tails the transcript
directory to render a run's progress (which agent belongs to which phase, under
which label) can only resolve the mapping after the run has finished.

Request

Either of these would close the gap — (b) is the cleaner contract:

a) Prefix each spawned agent's prompt with a small structured marker carrying
label/phase (machine-readable, strippable by display tools), or

b) Persist label and phase in agent-<id>.meta.json at spawn time — the
harness already has both values in hand when it creates the file. This keeps
prompts untouched and gives on-disk consumers a stable, documented place to
read the mapping live.

Current workaround

Workflow authors can manually prefix their prompts with a structured comment tag
that observability tools parse from the transcript (this is what I do today for
generated workflows). But for hand-written inline scripts the agent() call
belongs to the harness's Workflow tool, so nothing can inject the tag locally —
every hand-written workflow renders as "assignment pending" until completion.

Why it matters

The Workflow tool's journal/transcript layout is already a de-facto interface
for observability tooling (replay, live DAG rendering, cost attribution). One
field written at spawn instead of at completion makes the whole live path work
without any prompt mutation or protocol change.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗