Skip to content

feat: Add timeout handling to MCP server requests - Add 5-minute time…#27

Merged
coleam00 merged 1 commit intocoleam00:mainfrom
takshit12:feature/add-mcp-timeout-handling
Mar 9, 2025
Merged

feat: Add timeout handling to MCP server requests - Add 5-minute time…#27
coleam00 merged 1 commit intocoleam00:mainfrom
takshit12:feature/add-mcp-timeout-handling

Conversation

@takshit12
Copy link
Copy Markdown

@takshit12 takshit12 commented Mar 1, 2025

Add timeout handling to MCP server requests

Changes Made

  1. Added a 5-minute (300 seconds) timeout configuration to the graph service requests
  2. Implemented proper error handling for timeout scenarios
  3. Added detailed error logging for both timeouts and request failures
  4. Improved error messages for better debugging

Why These Changes?

  1. Timeout Configuration:

    • Previously, requests to the graph service had no keep getting timed out
    • This lead to requests not working
    • The 5-minute timeout provides a reasonable upper limit for long-running operations
  2. Error Handling:

    • Added specific handling for requests.exceptions.Timeout
    • Added general handling for other request exceptions
    • This provides better error visibility and debugging capabilities
  3. Logging Improvements:

    • Added detailed logging when timeouts occur
    • Added thread ID context to logs
    • This helps track and debug issues across different conversation threads

Technical Details

The main changes were made in mcp/mcp_server.py in the _make_request function:

  • Added timeout=300 parameter to requests.post
  • Added try-catch block with specific handling for timeout exceptions
  • Added detailed error logging with thread context

Impact

These changes will:

  • Prevent requests from hanging indefinitely
  • Provide clearer error messages when timeouts occur
  • Make debugging easier with improved logging
  • Give a better user experience by failing fast when operations take too long

…out, proper error handling, and improved logging
@coleam00 coleam00 merged commit 30e586b into coleam00:main Mar 9, 2025
@coleam00
Copy link
Copy Markdown
Owner

coleam00 commented Mar 9, 2025

This was very needed, thank you!

HillviewCap pushed a commit to HillviewCap/Archon that referenced this pull request Apr 1, 2025
…out, proper error handling, and improved logging (coleam00#27)

Co-authored-by: Takshit Mathur <takshitmathur@gmail.com>
tazmon95 pushed a commit to tazmon95/Archon that referenced this pull request Aug 16, 2025
…dcoded-ports

fix: Remove hardcoded ports and require environment variables
coleam00 pushed a commit that referenced this pull request Apr 7, 2026
* Add git worktree support for isolated parallel development

Enable each conversation to work in an isolated git worktree via new
/worktree command (create/list/remove). Worktree path takes priority
over cwd in orchestrator's directory resolution chain.

- Add worktree_path column to conversations (migration 003)
- Add /worktree create <branch> | list | remove commands
- Update orchestrator: worktree_path > cwd > default_cwd
- Add 7 tests for worktree command coverage

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix worktree safety: prevent orphaned worktrees and respect uncommitted changes

- Check if conversation already has a worktree before creating new one
- Remove --force flag from worktree remove to let git warn about uncommitted changes
- Document git as first-class citizen in CLAUDE.md
- Add test for already-using-worktree rejection

Co-Authored-By: Claude <noreply@anthropic.com>

* Add --force flag to /worktree remove for uncommitted changes

- Add optional --force flag to discard uncommitted changes
- Provide friendly error message when worktree has uncommitted changes
- Update help text to document the --force option
- Let git's natural guardrails surface errors first, then offer escape hatch

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Tyone88 pushed a commit to Tyone88/Archon that referenced this pull request Apr 16, 2026
* Add git worktree support for isolated parallel development

Enable each conversation to work in an isolated git worktree via new
/worktree command (create/list/remove). Worktree path takes priority
over cwd in orchestrator's directory resolution chain.

- Add worktree_path column to conversations (migration 003)
- Add /worktree create <branch> | list | remove commands
- Update orchestrator: worktree_path > cwd > default_cwd
- Add 7 tests for worktree command coverage

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix worktree safety: prevent orphaned worktrees and respect uncommitted changes

- Check if conversation already has a worktree before creating new one
- Remove --force flag from worktree remove to let git warn about uncommitted changes
- Document git as first-class citizen in CLAUDE.md
- Add test for already-using-worktree rejection

Co-Authored-By: Claude <noreply@anthropic.com>

* Add --force flag to /worktree remove for uncommitted changes

- Add optional --force flag to discard uncommitted changes
- Provide friendly error message when worktree has uncommitted changes
- Update help text to document the --force option
- Let git's natural guardrails surface errors first, then offer escape hatch

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
ibuildthings-instrumentl added a commit to instrumentl/Archon that referenced this pull request Apr 20, 2026
fix(deps): bump lodash to >=4.18.0 (Dependabot coleam00#26, coleam00#27)
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.

2 participants