Skip to content

[bot] activeagent gem (Rails AI agent framework) not instrumented #187

Description

@braintrust-bot

Summary

The activeagent gem (v1.0.2, 84K+ downloads, released June 10, 2026) is a Rails-native AI agent framework not instrumented by this SDK. Positioned as "the only agent-oriented AI framework designed for Rails, where Agents are Controllers," it provides a clear agent execution surface — generate_now, generate_later, streaming via ActionCable, and action-as-tool calling — across OpenAI, Anthropic, Ollama, OpenRouter, and RubyLLM providers.

While the underlying LLM calls may be captured through existing openai, anthropic, or ruby_llm instrumentation, the activeagent agent-run layer (agent action dispatch, multi-turn orchestration, context management, callbacks) has no dedicated instrumentation.

What is missing

No instrumentation exists for any activeagent execution surface. Key APIs that should be instrumented:

Agent Execution

  • Agent.prompt(message: "...").generate_now — Synchronous agent execution. Invokes the agent action, drives the model through one or more turns, and returns the final response. This is the primary blocking execution path.
  • Agent.prompt(message: "...").generate_later — Asynchronous agent execution via ActiveJob. Queues agent execution as a background job.

Streaming

  • Streaming via ActionCableActiveAgent::GenerationChannel streams agent response chunks in real time to a WebSocket channel. Each streaming turn produces intermediate content events before a final completion event.

Tool / Action Calling

  • Agent actions as tools — Public instance methods defined in an agent class are automatically exposed to the LLM as callable tools. The framework dispatches tool calls by invoking the corresponding action method. Each action dispatch should produce a child span within the agent run.

Context / Transcript Management

  • with(...) — Sets context variables available to the agent during execution.
  • The framework maintains a message transcript across multi-turn interactions that should be captured in the root agent span.

Expected instrumentation

Agent run spans should capture:

  • Input: initial prompt / user message, agent class name, action (if explicit)
  • Metadata: provider (openai, anthropic, ruby_llm, etc.), model, agent configuration (generate_with setting), temperature/other inference params
  • Output: final generated response after all turns complete
  • Metrics: aggregated token usage across all turns (if available from provider)

Tool/action dispatch child spans should capture:

  • Action method name and arguments
  • Return value (tool result)

Braintrust docs status

not_foundactiveagent is not listed anywhere in Braintrust's integrations directory at https://www.braintrust.dev/docs/integrations. The SDK integrations page at https://www.braintrust.dev/docs/integrations/sdk-integrations lists only ruby-llm as a Ruby-specific integration. No mention of Rails agent frameworks.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib.rb — registers only 4 integrations: OpenAI, RubyOpenAI, RubyLLM, Anthropic. No ActiveAgent integration.
  • lib/braintrust/contrib/ — contains only openai/, ruby_openai/, ruby_llm/, anthropic/, and rails/ directories. No active_agent/ directory.
  • Appraisals — no appraisal scenarios for activeagent
  • braintrust.gemspec — no mention of activeagent
  • Grep for activeagent, active_agent, ActiveAgent, GenerationChannel, generate_now across lib/braintrust/ returns zero matches

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions