strix icon indicating copy to clipboard operation
strix copied to clipboard

[BUG] TUI handshake times out (10s) on first "go run" when Go toolchain/module cache is cold

Open jav1er8 opened this issue 3 months ago • 3 comments

Describe the bug On an editable install running the TUI from source (go run), the very first launch fails with "Timed out waiting for TUI protocol ready". _HANDSHAKE_TIMEOUT = 10.0 in strix/interface/tui/backend/server.py is too short when Go has to download its own toolchain plus ~20 module dependencies (bubbletea, lipgloss, etc.) before the TUI process can even start responding.

To Reproduce Steps to reproduce the behavior:

  1. Have a go binary older than the version pinned in strix/interface/tui/go.mod, so go run triggers an automatic toolchain download (e.g. go1.24.0)
  2. Ensure the Go module cache is cold (no prior go mod download/go build in strix/interface/tui)
  3. cd to the repo root and run uv run strix --target <any target>
  4. First launch reliably times out during the handshake

Expected behavior The TUI compiles/downloads dependencies and starts within the handshake window, or the timeout accounts for a cold cache on first run.

​ INTERACTIVE SETUP UNAVAILABLE The interactive interface could not start: Timed out waiting for TUI protocol ready ​

System Information:

  • OS: Ubuntu 24.04 (WSL2 on Windows)
  • Strix Version or Commit: 1.5.3 (editable install, TUI via go run from source)
  • Python Version: 3.12.3
  • LLM Used: openrouter/deepseek/deepseek-v4-flash-0731

Additional context Workaround: pre-warm the Go cache once, outside Strix's timeout window:

​bash cd strix/interface/tui go mod download go build -o /tmp/strix-tui-check ./cmd/strix-tui ​

Subsequent go run invocations reuse the cached toolchain/modules and pass the handshake fine.

Suggested fix: extend _HANDSHAKE_TIMEOUT for the first launch specifically (or detect a cold module cache), and/or document in CONTRIBUTING.md that go mod download / make tui-build should run once before the first strix invocation on an editable install.

jav1er8 avatar Aug 28 '26 18:08 jav1er8

Hi! @0xallam @jav1er8 , I'd like to work on this issue.

My plan is to investigate the handshake timeout during the first go run on editable installs and implement a fix so cold Go toolchain/module downloads don't cause the TUI startup to fail. I'll also look into whether any contributor documentation should be updated if needed.

If no one is already working on it, could you please assign this issue to me? Thanks!

superezzdev avatar Aug 28 '26 18:08 superezzdev

Hi @superezzdev, are you still working on this? It’s been a couple of months since your comment and I don’t see a PR. If not, I’d like to pick it up. I have a small fix that gives go run a longer handshake timeout while packaged binaries keep the 10 seconds.

aniyow07 avatar Nov 03 '26 19:11 aniyow07

Hi @aniyow07 i'm not assigned that's why i was not working on this

superezzdev avatar Nov 03 '26 19:11 superezzdev