Skip to content

fix(SWE-INFINITE): add timeout protection to MiniSWE agent#63

Open
catoneone wants to merge 1 commit intomainfrom
fix/miniswe-timeout
Open

fix(SWE-INFINITE): add timeout protection to MiniSWE agent#63
catoneone wants to merge 1 commit intomainfrom
fix/miniswe-timeout

Conversation

@catoneone
Copy link
Copy Markdown
Collaborator

Summary

  • Add per-request timeout (capped at 300s) to LiteLLM completion() calls via model_kwargs, preventing single API calls from hanging indefinitely on cold-starts or queue delays
  • Wrap agent.run() with asyncio.wait_for(timeout=self.config.timeout) to enforce a wall-clock deadline on the entire agent loop
  • Addresses root cause of Task 143 timeout: the Chutes API model could stall on first request with no timeout protection at any layer

Test plan

  • Run MiniSWE agent on a known-good task and verify it completes normally
  • Simulate API delay and confirm the agent times out gracefully within config.timeout seconds
  • Verify asyncio.TimeoutError is caught by the existing except Exception handler and surfaces in MiniSWEResult.error

🤖 Generated with Claude Code

Add per-request timeout (300s cap) to LiteLLM completion() via model_kwargs,
and wrap agent.run() with asyncio.wait_for() using config.timeout to prevent
indefinite hangs when the upstream model API queues or cold-starts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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