Skip to content

[Type Definitions] Types mismatch between RunResult and RunState #278

@AndyRightNow

Description

@AndyRightNow

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions