Repository navigation
feat(agui): map Run events to AG-UI through effect/ai - #58
Merged
Merged
Conversation
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
changed the base branch from
feat/telemetry-effect-ai
to
main
November 26, 2026 13:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a public
aguimodule built oneffect/ai.toAgUiEventsmaps the Run event stream to AG-UI events and is a pure mapper.makeAgUiHandlerbuilds the AG-UI HTTP handler overAgUiServer.handler, which applies the AG-UI run lifecycle.RunSuspendedandRunInterruptedend withRunFinishedoutcomes (interrupt and cancelled) after aCUSTOMevent, neverRunError. A suspended Run reports one interrupt per pending approval.includeSubagentsis set; a run that ends with a subagent still started closes it withSUBAGENT_ERROR.fromAgUiInputadapts an AG-UI run input into a Prompt throughAgUi.toPrompt.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).