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:
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 requests
abortSignal - For cancellation support
experimental_telemetry - For observability and monitoring
onStepFinish - For step-level hooks and observability
Generation Control
maxOutputTokens - Token limit control
temperature - Response randomness control
topP - Nucleus sampling
topK - Top-k sampling
presencePenalty - Repetition penalties
frequencyPenalty - Frequency penalties
stopSequences - Custom stop sequences
seed - Deterministic generation
Tool Control
toolChoice - Control over tool selection behavior
stopWhen - Custom stop conditions for the agent loop
activeTools - Dynamic tool enabling/disabling
prepareStep - Step preparation hook
experimental_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)
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:
- 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!
Description
The
DurableAgentclass in the Workflow Development Kit is missing several important configuration options that are available in the AI SDK'sToolLoopAgentclass. This makes it difficult to migrate existing agent implementations to durable workflows while maintaining the same level of control and customization.Current Behavior
DurableAgentcurrently only supports three configuration options:modeltoolssystemExpected Behavior
DurableAgentshould support feature parity withToolLoopAgent, or at least provide access to the most commonly used configuration options.Missing Features
The following configuration options from
ToolLoopAgentare currently not available inDurableAgent: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 observabilityGeneration Control
maxOutputTokens- Token limit controltemperature- Response randomness controltopP- Nucleus samplingtopK- Top-k samplingpresencePenalty- Repetition penaltiesfrequencyPenalty- Frequency penaltiesstopSequences- Custom stop sequencesseed- Deterministic generationTool 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 functionalityOutput Control
output- Structured output with schema validationUse 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 observabilityCode Comparison
What works with
ToolLoopAgent(AI SDK):What's currently not possible with
DurableAgent:References
Workaround
Currently, there's no clear workaround to access these options when using
DurableAgent.Would it be possible to either:
DurableAgent, orHaving at least the most critical options (
providerOptions,temperature,maxRetries,onStepFinish, andexperimental_telemetry) would significantly improve the developer experience when building production-grade durable agents.Thank you!