Skip to content

Windows: bash tool fails (WinError 2) and web.fetch timeout can cascade to max_steps_reached #88

@shawbaiw

Description

@shawbaiw

Summary

On Windows, bub can hit two issues in one session:

  1. bash tool fails with FileNotFoundError: [WinError 2] when bash is unavailable.
  2. web.fetch timeout can surface as repeated tool failures, and the run may end with max_steps_reached=20.

Environment

  • OS: Windows (PowerShell)
  • Python: 3.14
  • uv: 0.10.8
  • Project: bubbuild/bub

Reproduction

  1. Start CLI:
    uv run bub
    
  2. Ask a prompt that includes an URL, e.g.:
    简单介绍一下你自己(https://github.com/bubbuild/bub)
    

Expected

  • If web.fetch times out, return a friendly error and continue safely.
  • Shell tool should still work on Windows environments without bash.

Actual

  • web.fetch may raise timeout tracebacks.
  • bash tool tries bash -lc ... only, then fails with WinError 2.
  • Model may keep stepping and end with max_steps_reached=20.

Error snippets

web.fetch timeout:

TimeoutError
...
aiohttp.ClientSession(...)
session.get(...)

bash tool error:

FileNotFoundError: [WinError 2] 系统找不到指定的文件。

Suggested fix

  • In src/bub/tools/builtin.py:
    • bash tool: choose shell by platform (bash -> pwsh/powershell on Windows -> sh).
    • web.fetch: catch asyncio.TimeoutError and return a readable timeout message.

If useful, I can open a PR with this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions