Skip to content

Clamp wait_for_agents timeout to the tool's ceiling - #1165

Open
bearsyankees wants to merge 1 commit into
mainfrom
devin/clamp-wait-for-agents-timeout
Open

Clamp wait_for_agents timeout to the tool's ceiling#1165
bearsyankees wants to merge 1 commit into
mainfrom
devin/clamp-wait-for-agents-timeout

Conversation

@bearsyankees

Copy link
Copy Markdown
Collaborator

Models sometimes request very large wait timeouts (hours or more). The raw value went straight into the inner asyncio.wait_for, so the SDK's tool-call ceiling fired first and aborted the call instead of returning the clean timeout payload that tells the agent to keep working or finish. Clamp the requested value into [1s, 300s], wait on the clamped value, and echo it back.

Models sometimes request very large wait timeouts (hours or more).
The raw value went straight into the inner asyncio.wait_for, so the
SDK's tool-call ceiling fired first and aborted the call instead of
returning the clean timeout payload that tells the agent to keep
working or finish. Clamp the requested value into [1s, 300s], wait on
the clamped value, and echo it back.
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR clamps wait_for_agents timeouts to the supported 1–300 second range so the inner timeout can return a clean payload before the SDK ceiling fires.

  • Adds centralized timeout normalization and reports the effective timeout in timeout responses.
  • Adds coverage for oversized, non-positive, in-range, and early-return cases.

Confidence Score: 5/5

The PR appears safe to merge with no concrete correctness or security defects identified.

The timeout is normalized before reaching asyncio.wait_for, the returned payload consistently reports the effective duration, and tests cover the affected timeout boundaries and early-return paths.

Important Files Changed

Filename Overview
strix/tools/agents_graph/tools.py Clamps requested wait durations before the inner wait and reports the effective value without changing early-return behavior.
tests/test_wait_dedupe.py Adds focused tests for timeout clamping, payload reporting, and existing deduplication paths.

Reviews (1): Last reviewed commit: "Clamp wait_for_agents timeout to the too..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant