Skip to content

feat: add timeout to Agent.generate_response()#20

Merged
rosspeili merged 1 commit intoARPAHLS:mainfrom
rosspeili:feat/agent-timeout
Mar 20, 2026
Merged

feat: add timeout to Agent.generate_response()#20
rosspeili merged 1 commit intoARPAHLS:mainfrom
rosspeili:feat/agent-timeout

Conversation

@rosspeili
Copy link
Copy Markdown
Contributor

Closes #1

Closes #1

Description

This PR prevents sessions from hanging indefinitely when an external API or local model node (like Ollama) becomes completely unresponsive.

Changes Made

  • Added a timeout: int = Field(default=30) setting to AgentConfig in rooms/config.py.
  • Updated the litellm.completion() call in rooms/agent.py to utilize this timeout config rule.
  • Added explicit try/except handling for litellm.Timeout to gracefully log the error and permit the session to proceed instead of permanently freezing the interaction.

Verification

All internal tests pass successfully with these changes.

@rosspeili rosspeili merged commit 9a0c6bf into ARPAHLS:main Mar 20, 2026
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.

feat: add timeout to Agent.generate_response()

1 participant