Skip to content

Port timeout.firstChunkMs, toolMs, and per-tool timeouts #702

Open

Description

@kblok

Follow-up to #697, which ports timeout.totalMs, stepMs, and chunkMs for generateText and streamText. Upstream TimeoutConfiguration also has:

  • firstChunkMs: the timeout until the first content chunk of each step (streaming only). generateText warns that it is unsupported.
  • toolMs and tools ({toolName}Ms): the timeout of tool executions. A tool that runs too long aborts and returns a tool-error.

Upstream tests not ported yet:

  • generate-text.test.ts > options.timeout: "should warn before the model responds when $warning.feature is configured" (the firstChunkMs case) and "should warn about both streaming-only timeouts in one call".
  • stream-text-timeout.test.ts: the whole streamText first chunk timeout describe, and streamText model output timeout boundaries (needs stream retries and tool timeouts).
  • execute-tool-call.test.ts and prepare-language-model-call-options.test.ts: the tool timeout and getToolTimeoutMs tests.

Also: AgentOptions has no Timeout. Upstream ToolLoopAgent takes timeout.

Activity

  1. kblok commented on Oct 21, 2026

    @kblok
    MemberAuthor

    Left out of #704.

  2. kblok commented on Oct 21, 2026

    @kblok
    MemberAuthor

    Not ported tests are listed in #704.

  3. kblok commented on Oct 21, 2026

    @kblok
    MemberAuthor

    PR #712 ports firstChunkMs (streamText) and the generateText warning tests. Still open here: toolMs and per-tool timeouts (execute-tool-call.test.ts, getToolTimeoutMs), the streamText model output timeout boundaries tests (need stream retries and tool timeouts), the firstChunkMs step-stream-cancel test (needs experimental_transform/stopStream), and AgentOptions.Timeout.

  4. kblok commented on Oct 21, 2026

    @kblok
    MemberAuthor

    PR #716 ports toolMs, per-tool timeouts (tools, getToolTimeoutMs), the executeToolCall > timeout tests, should keep toolMs active after the model finishes, and AgentOptions.Timeout.

    Still open here:

    • The rest of streamText model output timeout boundaries (needs stream retries, provider-executed tool timers, a fake clock).
    • The firstChunkMs step-stream-cancel test (needs experimental_transform/stopStream).
    • A per-call agent timeout (Agent.GenerateAsync has no per-call options).
  5. kblok commented on Oct 22, 2026

    @kblok
    MemberAuthor

    PR #730 ports the stepMs/totalMs-during-tool, output-timer-clearing, chunkMs-next-step, and provider-executed-tool boundary tests, plus the per-call agent timeout (Agent.GenerateAsync/Stream timeout argument).

    Still open here, each blocked on a missing feature:

    • should clear chunkMs before a long streaming tool (both variants): needs streaming tools (async generator execute).
    • should give a $retryKind retry a fresh firstChunkMs budget (stream and callback), should re-arm firstChunkMs after retrying an attempt that produced output, and the retry case of should start chunkMs only after output begins: need streamRetries and the onError retry result.
    • should keep stepMs cumulative across $retryKind retries: needs model-call retries from MaxRetries and streamRetries.
    • should clear firstChunkMs when the registered step stream is cancelled: needs experimental_transform and stopStream.
    • The preliminary flag on the tool-result stream part (the provider-executed tool test is partial without it).
    • A fake clock, so the boundary tests can use the upstream budgets instead of scaled real timers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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