Skip to content

Blocking calls in async paths: audit thread::sleep and std::fs in tool paths, pick one convention #6149

Description

@Hmbown

From the 0.9.14 refactor backlog.

  • thread::sleep in production paths: cloud_dispatch.rs ~1613 (sandbox-ready poll loop), lane/src/runtime.rs ~1401 (10 ms), plus others outside tests. On the runtime they park a worker thread. Convert to tokio::time::interval with cancellation, or a notify on the resource itself. Audit first — some are already under spawn_blocking.
  • ~30 non-test files mix async fn with std::fs:: (tools/file_search, read_media, terminal_session, revert_turn, tool_preparation, turn_loop helpers). Decide one convention and enforce it once: (a) tool I/O uses tokio::fs, or (b) execute_planned_tools runs handlers on the blocking pool (spawn_blocking per batch — 81 sites already use the pattern). (b) is the ponytail answer for tools that read big files.

Deliverable: the convention written down in docs plus the sites moved. Size: M.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustPull requests that update rust codetoolsTool execution, tool schemas, tool UX, and built-in tool behavior

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions