-
Notifications
You must be signed in to change notification settings - Fork 501
Closed
Labels
Description
Please read this first
- Have you read the docs? Agents SDK docs
- Have you searched for related issues? Others may have faced similar issues.
Describe the bug
RunState cannot be used to instantiate a RunResult even with the same generic types.
Debug information
- Agents SDK version: (e.g.
v0.0.14) - Runtime environment (e.g.
Node.js 22.16.0)
Repro steps
See TS Playground Reproduction
Updated a more common usage pattern with type inference:
const inferredState = new RunState(anyContext, 'input', agent, 10)
const inferredResult = new RunResult(inferredState)I believe this would be how the constructors or fromString are used the most.
Expected behavior
There should be no errors.
Possible Fix
Add an extra generic type parameter in RunResult:
TAgentOutputType extends AgentOutputType