Skip to content

feat(agui): map Run events to AG-UI through effect/ai - #58

Merged
systemfsoftware-bot merged 6 commits into
mainfrom
feat/telemetry-effect-ai-agui
Nov 26, 2026
Merged

systemfsoftware-bot merged 6 commits into
mainfrom
feat/telemetry-effect-ai-agui

Conversation

@systemfsoftware-bot

@systemfsoftware-bot systemfsoftware-bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Adds a public agui module built on effect/ai.

  • toAgUiEvents maps the Run event stream to AG-UI events and is a pure mapper.
  • makeAgUiHandler builds the AG-UI HTTP handler over AgUiServer.handler, which applies the AG-UI run lifecycle.
  • RunSuspended and RunInterrupted end with RunFinished outcomes (interrupt and cancelled) after a CUSTOM event, never RunError. A suspended Run reports one interrupt per pending approval.
  • State snapshots are omitted.
  • Subagent events are omitted unless includeSubagents is set; a run that ends with a subagent still started closes it with SUBAGENT_ERROR.
  • fromAgUiInput adapts an AG-UI run input into a Prompt through AgUi.toPrompt.
  • Tool results and failures are JSON-encoded in TOOL_CALL_RESULT.

The runtime stays durable: the module maps events and builds the handler; it does not use the stream-parts or agent helpers.

Checks at head 46e49fd, all exit 0: pnpm check:exports (11 packages), pnpm typecheck, pnpm lint (0 warnings, 0 errors), pnpm format:check, pnpm build, pnpm check:pack, pnpm check:package-purity, pnpm --filter @systemfsoftware/agent test (161 passed).

Compose `Telemetry.CurrentSpanTransformer` around each model call, running a
host-provided transformer first, so model spans keep Effect AI's span name and
the library identity is written through `addGenAIAnnotations` and
`addSpanAttributes`.

Build tool attributes once and apply the same map to the canonical Tool span
and its terminal log, dropping duplicated unprefixed keys.
The package exports check requires `Effect.withSpan` at an allowlisted
operation boundary. Create each `execute_tool` span at its call site and let a
separate helper annotate the current span through `addSpanAttributes`, so the
shared attribute map still reaches the Tool span.
@systemfsoftware-bot
systemfsoftware-bot changed the base branch from feat/telemetry-effect-ai to main November 26, 2026 13:37
@systemfsoftware-bot
systemfsoftware-bot merged commit f44a4f1 into main Nov 26, 2026
25 of 27 checks 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