Skip to content

feat: instrument Inngest AgentKit execution - #2814

Draft
pear1-pea (pear1-pea) wants to merge 1 commit into
braintrustdata:mainfrom
pear1-pea:feat/agent-kit-instrumentation
Draft

pear1-pea (pear1-pea) wants to merge 1 commit into
braintrustdata:mainfrom
pear1-pea:feat/agent-kit-instrumentation

Conversation

@pear1-pea

Copy link
Copy Markdown

AgentKit currently produces no Braintrust spans for network orchestration, agent runs, model inference, routing or tool execution. This adds automatic instrumentation for the verified ESM and CommonJS layouts of @inngest/agent-kit 0.13.2.

The implementation follows the normal interceptor/provider/config path. Spans retain stable names and record network, agent and tool names in metadata. Tool preparation covers createTool plus plain, Inngest-function and MCP tools before invocation. It preserves tool objects, receivers and extra arguments, and leaves already immutable/accessor-based handlers unchanged. Those immutable handlers may lack individual tool spans. A separate manual module wrapper is outside this initial automatic-instrumentation scope.

Validation performed locally:

  • Focused instrumentation, registration and span-origin tests: 52 passed.
  • SDK source and test TypeScript checks passed.
  • Scoped formatting/lint and package build passed; lint reported zero warnings and zero errors.
  • Independent offline AgentKit 0.13.2 ESM/CJS runtime probes passed: network/routing/agent/model/tool parentage, parsed function calls, plain tool success/rejection, frozen tools, identity/receiver/arguments, usage and credential omission.

Refs #2396

This branch has not been deployed

No deployments
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