Skip to content

fix(agent): keep file search off the gateway event loop#194

Open
louiseboo wants to merge 1 commit into
EverMind-AI:mainfrom
louiseboo:fix/find-nonblocking-gateway
Open

fix(agent): keep file search off the gateway event loop#194
louiseboo wants to merge 1 commit into
EverMind-AI:mainfrom
louiseboo:fix/find-nonblocking-gateway

Conversation

@louiseboo

Copy link
Copy Markdown

Summary

  • offload FindTool filesystem traversal and result formatting to a worker thread
  • give FindTool an explicit 30-second execution ceiling
  • add deterministic regressions for event-loop responsiveness and registry timeouts

Root cause: FindTool.execute() performed synchronous Path.glob() traversal inside an async method. A slow filesystem walk blocked the gateway event loop, so channel polling and the surrounding asyncio.wait_for() timeout could not run until traversal returned.

Type

  • Bug fix
  • Feature
  • Refactor
  • Documentation

Verification

  • uv run pytest tests/test_search_tools.py tests/test_file_search_traversal_guard.py tests/test_tool_registry_timeout.py -q — 29 passed
  • make test-python — 59 passed
  • make lint-python — passed
  • uv run pre-commit run --files raven/agent/tools/file_search.py tests/test_search_tools.py — passed

A broader local suite attempt reached 4,477 passing tests, with 124 failures and 19 errors in environment-dependent EverOS, Boxlite, tui-use, and TUI integration tests unavailable on this machine. The focused search, traversal-guard, timeout, lint, and repository CI smoke suites above all pass.

Risk and rollback

  • Public tool schema, matching behavior, path guards, ordering, and output format are unchanged.
  • A timed-out worker may finish its current filesystem traversal in the background, but it no longer stalls the event loop or channel polling.
  • Rollback: revert the single fix commit.

Privacy

The issue and this PR contain only sanitized technical evidence. No private paths, business files, credentials, chat content, or user identifiers are included.

Fixes #193

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.

fix(agent): prevent filesystem find from blocking the gateway event loop

1 participant