Skip to content

feat: emit artifact content + proposal_created on the event stream#25

Merged
drewstone merged 3 commits into
mainfrom
feat/produced-state-events
May 21, 2026
Merged

feat: emit artifact content + proposal_created on the event stream#25
drewstone merged 3 commits into
mainfrom
feat/produced-state-events

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Summary

Enrich the runtime event stream so a run carries what the agent produced — not just metadata. This is the emitter half of the ProducedState pathway (consumer half: extractProducedState in agent-eval#69).

  • Add content?: string to the artifact RuntimeStreamEvent variant.
  • Add a new proposal_created variant (proposalId, title, status?).
  • mapCommonBackendEvent maps both from the common SSE/HTTP wire — fail-loud, drops an event with no id.
  • Sanitizer gates content / proposal title behind includeControlPayloads (redacted by default).
  • trace-bridge maps proposal_created → a state_mutation trace event.

The runtime does not originate these — content events originate in the agent execution backend and pass through; this package provides the typed contract + wire mapping. Additive (+157 / -0).

Test plan

  • pnpm build — clean
  • pnpm typecheck — clean (new union variant handled in exhaustive consumers)
  • pnpm test — 218/218 (new wire-mapping + trace-bridge + redaction tests)

drewstone added 3 commits May 21, 2026 15:23
…tream

Add `content` to the `artifact` RuntimeStreamEvent variant and a new
`proposal_created` variant, so a run's event stream carries what the agent
produced, not just metadata. mapCommonBackendEvent maps both from the common
SSE/HTTP wire (fail-loud — drops an event with no id); the sanitizer gates
`content`/`title` behind includeControlPayloads (redacted by default);
trace-bridge maps proposal_created to a state_mutation trace event.

This package provides the typed contract + wire mapping. The runtime does
not originate these events — content events originate in the agent execution
backend and pass through; backend/tool-layer emission is separate.

Additive (+157, 0 deletions); 218/218 tests green.
`biome check src tests examples` ran red on two pre-existing errors:
noAssignInExpressions in chat-engine.test.ts (rewrote the indexOf loop as a
for(;;) + break, matching the file's existing style) and an unused import in
agent.test.ts. No behavior change; 218/218 tests green.
biome check --write reflowed the produced-state wire-mapping block to
satisfy the linter. No behavior change.
@drewstone drewstone merged commit b2ccf82 into main May 21, 2026
1 check passed
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.

1 participant