-
Notifications
You must be signed in to change notification settings - Fork 72
Description
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:
modeltoolssystem
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
providerOptions- Essential for configuring provider-specific settings (e.g., custom headers, API configurations)maxRetries- For configuring retry behavior on failed requestsabortSignal- For cancellation supportexperimental_telemetry- For observability and monitoringonStepFinish- For step-level hooks and observability
Generation Control
maxOutputTokens- Token limit controltemperature- Response randomness controltopP- Nucleus samplingtopK- Top-k samplingpresencePenalty- Repetition penaltiesfrequencyPenalty- Frequency penaltiesstopSequences- Custom stop sequencesseed- Deterministic generation
Tool Control
toolChoice- Control over tool selection behaviorstopWhen- Custom stop conditions for the agent loopactiveTools- Dynamic tool enabling/disablingprepareStep- Step preparation hookexperimental_repairToolCall- Tool call repair functionality
Output Control
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)temperatureand other generation params - To control response quality and determinismmaxRetries- To handle transient failures gracefullyonStepFinish- For monitoring and debugging agent behaviorexperimental_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:
- Add these configuration options to
DurableAgent, or - 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!