Skip to content

fix(models): handle stalled litellm tool-call streams#879

Open
snvtac wants to merge 1 commit into
SWE-agent:mainfrom
snvtac:snvtac/874-provider-stream-timeout
Open

fix(models): handle stalled litellm tool-call streams#879
snvtac wants to merge 1 commit into
SWE-agent:mainfrom
snvtac:snvtac/874-provider-stream-timeout

Conversation

@snvtac

@snvtac snvtac commented Jun 26, 2026

Copy link
Copy Markdown

Fixes #874.

Summary

  • add a controlled ProviderTimeout exit for LiteLLM provider read timeouts
  • consume LiteLLM chat stream wrappers into a normal response so streamed tool-call deltas are parsed by the existing tool-call path
  • apply the default read timeout only for stream=True calls, preserving explicit timeout / request_timeout overrides and leaving non-stream requests on LiteLLM defaults
  • cover stalled and successful streamed tool-call responses, plus clean agent exit behavior

Tests

  • MSWEA_SILENT_STARTUP=1 .venv/bin/python -m pytest -q tests/models tests/agents
  • PRE_COMMIT_HOME=.cache/pre-commit .venv/bin/pre-commit run --files src/minisweagent/exceptions.py src/minisweagent/models/litellm_model.py src/minisweagent/models/litellm_response_model.py src/minisweagent/models/litellm_textbased_model.py tests/agents/test_default.py tests/models/test_litellm_model.py tests/models/test_litellm_textbased_model.py tests/models/test_litellm_response_model.py

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.

mini-swe-agent hangs while the provider stalls mid tool-call stream

1 participant