Skip to content

fix(agents): flow agents silently drop stepMs/toolMs from timeout objects #67

@zrosenbauer

Description

@zrosenbauer

Summary

When a flow agent receives a timeout object with keys other than totalMs (e.g. stepMs, toolMs, per-tool timeouts), those keys are silently ignored. This can mislead callers into thinking granular timeout control is active when it isn't.

Context

Raised by CodeRabbit in PR #65 (thread PRRT_kwDORkqTG8523WJU).

Flow agents manage their own step orchestration and don't forward directly to the AI SDK's generateText/streamText, so stepMs, toolMs, and per-tool timeout keys are meaningless at the flow level. Only totalMs is extracted to create a flow-level AbortSignal.

Current behavior

// This silently ignores stepMs — no warning, no error
await myFlowAgent.generate({
  input: { ... },
  timeout: { totalMs: 30000, stepMs: 5000 },
});

Location

  • packages/agents/src/core/agents/flow/flow-agent.tsresolveSignal() function (~line 296)

Options to consider

  1. Warn — Log a warning via the flow agent's logger when unsupported timeout keys are detected
  2. Throw — Throw an error if any key besides totalMs is present
  3. Narrow the type — Use a more specific timeout type for flow agents (number | { totalMs?: number }) instead of the full BaseGenerateParams timeout type

Related

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