Skip to content

[Bug]: E2E test shows "timeout must be an integer" SDK warning causing retries #290

@sjnims

Description

@sjnims

Bug Description

During E2E test execution, the Anthropic SDK receives a non-integer timeout value, triggering multiple retry attempts with the warning:

[WARN] Retry attempt 1: timeout must be an integer (waiting 1084ms)

This warning appears repeatedly (up to 3 retry attempts) before the system falls back to alternative behavior.

Important context: All unit tests pass. This issue only manifests during E2E test execution with real API calls.

Steps to Reproduce

  1. Run RUN_E2E_TESTS=true npm test -- tests/e2e/
  2. Observe the test output during scenario generation or execution
  3. See repeated "timeout must be an integer" warnings with retry attempts

Expected Behavior

API calls should succeed on the first attempt without timeout-related warnings. The timeout parameter should be passed as an integer to the Anthropic SDK.

Actual Behavior

Multiple retry attempts occur due to timeout type issues:

[WARN] Retry attempt 1: timeout must be an integer (waiting 1084ms)
[WARN] Retry attempt 1: timeout must be an integer (waiting 1044ms)
[WARN] Retry attempt 2: timeout must be an integer (waiting 2056ms)
[WARN] Retry attempt 2: timeout must be an integer (waiting 2004ms)
[WARN] Retry attempt 3: timeout must be an integer (waiting 4253ms)
[WARN] Retry attempt 3: timeout must be an integer (waiting 4044ms)
[WARN] LLM generation failed, using fallback scenarios

The system eventually falls back to alternative scenarios, so tests can proceed, but this indicates a parameter typing issue.

Environment

  • OS: macOS
  • Node.js: v25.x
  • Test runner: Vitest
  • Anthropic SDK: (check package.json for version)

Error Logs / CLI Output

[WARN] Retry attempt 1: timeout must be an integer (waiting 1022ms)
[WARN] Retry attempt 1: timeout must be an integer (waiting 1015ms)
[WARN] Retry attempt 2: timeout must be an integer (waiting 2040ms)
[WARN] Retry attempt 2: timeout must be an integer (waiting 2168ms)
[WARN] Retry attempt 3: timeout must be an integer (waiting 4220ms)
[WARN] Retry attempt 3: timeout must be an integer (waiting 4042ms)
[WARN] LLM generation failed, using fallback scenarios

Additional Context

  • Unit tests pass without this warning
  • The retry mechanism handles the error gracefully (fallback works)
  • This suggests either:
    1. E2E test configuration passes a non-integer timeout
    2. A timeout value calculation somewhere produces a float instead of int
    3. A type coercion issue in the API client setup for E2E tests

Investigation should check:

  • Where timeout values are set for E2E tests
  • Whether Math.floor() or similar is needed somewhere
  • The Anthropic SDK's timeout parameter requirements

Related to #289 - both are E2E-specific issues where unit tests pass.


🤖 Created with Claude Code

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcomponent:utilsUtilities: retry, concurrency, logging (src/utils/)priority:mediumShould be addressedsdk:anthropicAnthropic SDK usage (Stages 2 and 4)status:analyzedIssue has been analyzed by Claude

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions