Skip to content

DurableAgent missing feature parity with AI SDK Agent class #168

@kvnwolf

Description

@kvnwolf

Description

The DurableAgent class in the Workflow Development Kit is missing several important configuration options that are available in the AI SDK's ToolLoopAgent class. This makes it difficult to migrate existing agent implementations to durable workflows while maintaining the same level of control and customization.

Current Behavior

DurableAgent currently only supports three configuration options:

  • model
  • tools
  • system

Expected Behavior

DurableAgent should support feature parity with ToolLoopAgent, or at least provide access to the most commonly used configuration options.

Missing Features

The following configuration options from ToolLoopAgent are currently not available in DurableAgent:

Critical Missing Features

  1. providerOptions - Essential for configuring provider-specific settings (e.g., custom headers, API configurations)
  2. maxRetries - For configuring retry behavior on failed requests
  3. abortSignal - For cancellation support
  4. experimental_telemetry - For observability and monitoring
  5. onStepFinish - For step-level hooks and observability

Generation Control

  1. maxOutputTokens - Token limit control
  2. temperature - Response randomness control
  3. topP - Nucleus sampling
  4. topK - Top-k sampling
  5. presencePenalty - Repetition penalties
  6. frequencyPenalty - Frequency penalties
  7. stopSequences - Custom stop sequences
  8. seed - Deterministic generation

Tool Control

  1. toolChoice - Control over tool selection behavior
  2. stopWhen - Custom stop conditions for the agent loop
  3. activeTools - Dynamic tool enabling/disabling
  4. prepareStep - Step preparation hook
  5. experimental_repairToolCall - Tool call repair functionality

Output Control

  1. output - Structured output with schema validation

Use Case

I need several of these options in my durable agents, particularly:

  • providerOptions - To configure custom provider settings (e.g., custom endpoints, headers)
  • temperature and other generation params - To control response quality and determinism
  • maxRetries - To handle transient failures gracefully
  • onStepFinish - For monitoring and debugging agent behavior
  • experimental_telemetry - For production observability

Code Comparison

What works with ToolLoopAgent (AI SDK):

import { ToolLoopAgent } from 'ai';

const agent = new ToolLoopAgent({
  model: openai('gpt-4o'),
  instructions: 'You are a helpful assistant.',
  tools: { myTool },
  providerOptions: {
    openai: {
      headers: { 'Custom-Header': 'value' }
    }
  },
  temperature: 0.7,
  maxRetries: 3,
  onStepFinish: ({ step }) => {
    console.log('Step finished:', step);
  },
  experimental_telemetry: {
    isEnabled: true,
    functionId: 'my-agent'
  }
});

What's currently not possible with DurableAgent:

import { DurableAgent } from '@workflow/ai/agent';

const agent = new DurableAgent({
  model: 'anthropic/claude-haiku-4.5',
  system: 'You are a helpful assistant.',
  tools: { myTool },
  // ❌ providerOptions: {...},  // Not available
  // ❌ temperature: 0.7,  // Not available
  // ❌ maxRetries: 3,  // Not available
  // ❌ onStepFinish: {...},  // Not available
  // ❌ experimental_telemetry: {...},  // Not available
  // ... and many more options
});

References

Workaround

Currently, there's no clear workaround to access these options when using DurableAgent.

Would it be possible to either:

  1. Add these configuration options to DurableAgent, or
  2. Provide guidance on how to achieve similar functionality with the current API?

Having at least the most critical options (providerOptions, temperature, maxRetries, onStepFinish, and experimental_telemetry) would significantly improve the developer experience when building production-grade durable agents.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions