Pre-flight Checklist
📝 Bug Description
Running the full Go test suite can hang for ~10 minutes due to TestRunArgsNoCommandLaunchesTUI launching Bubbletea with real terminal I/O.
In some Linux environments, instead of returning quickly with a TTY-related error (or nil), the test blocks inside Bubbletea until Go’s package timeout triggers.
This causes flaky CI/local runs and very long feedback loops.
🔄 Steps to Reproduce
- Run:
go test -count=1 -v ./...
- Observe progress reaching:
ok github.com/gentleman-programming/gentle-ai/internal/agents/windsurf ...
- Execution appears stuck before next package output, then eventually fails after ~10 minutes in
internal/app.
✅ Expected Behavior
TestRunArgsNoCommandLaunchesTUI should be deterministic and complete quickly in all environments (including headless/CI), without depending on real TTY behavior.
❌ Actual Behavior
The test blocks for almost the entire package timeout and then fails:
panic: test timed out after 10m0s
running tests:
TestRunArgsNoCommandLaunchesTUI (9m59s)
...
github.com/charmbracelet/bubbletea.(*Program).Run(...)
github.com/gentleman-programming/gentle-ai/internal/app.RunArgs(...)
./gentle-ai/internal/app/app.go:114
github.com/gentleman-programming/gentle-ai/internal/app.TestRunArgsNoCommandLaunchesTUI(...)
./gentle-ai/internal/app/parity_test.go:165
FAIL github.com/gentleman-programming/gentle-ai/internal/app 600.008s
🖥️ Environment
- Gentle AI Version:
v1.18.3
- Operating System: Linux (Arch/Manjaro)
- AI Agent / Client: Other (local
go test run)
- 📋 Affected Area: TUI (terminal UI)
💡 Logs / Error Output
Relevant section from gotest.log:
panic: test timed out after 10m0s
running tests:
TestRunArgsNoCommandLaunchesTUI (9m59s)
goroutine ...:
github.com/charmbracelet/bubbletea.(*Program).eventLoop(...)
github.com/charmbracelet/bubbletea.(*Program).Run(...)
github.com/gentleman-programming/gentle-ai/internal/app.RunArgs(...)
./gentle-ai/internal/app/app.go:114
github.com/gentleman-programming/gentle-ai/internal/app.TestRunArgsNoCommandLaunchesTUI(...)
./gentle-ai/internal/app/parity_test.go:165
...
FAIL github.com/gentleman-programming/gentle-ai/internal/app 600.008s
Additional Context
Tests were executed from a local source checkout.
Current test implementation (internal/app/parity_test.go) expects either:
- nil (TTY available), or
- immediate TTY-related error in headless mode.
However, in this environment Bubbletea can block in input/event loops instead of returning quickly, making the test non-deterministic.
Suggested direction:
- avoid running real
Program.Run() in unit tests (inject/mock TUI launcher),
- keep optional integration test with PTY if needed,
- add short fail-fast timeout guard for this path.
Pre-flight Checklist
status:approved📝 Bug Description
Running the full Go test suite can hang for ~10 minutes due to
TestRunArgsNoCommandLaunchesTUIlaunching Bubbletea with real terminal I/O.In some Linux environments, instead of returning quickly with a TTY-related error (or nil), the test blocks inside Bubbletea until Go’s package timeout triggers.
This causes flaky CI/local runs and very long feedback loops.
🔄 Steps to Reproduce
go test -count=1 -v ./...internal/app.✅ Expected Behavior
TestRunArgsNoCommandLaunchesTUIshould be deterministic and complete quickly in all environments (including headless/CI), without depending on real TTY behavior.❌ Actual Behavior
The test blocks for almost the entire package timeout and then fails:
🖥️ Environment
v1.18.3go testrun)💡 Logs / Error Output
Relevant section from
gotest.log:Additional Context
Tests were executed from a local source checkout.
Current test implementation (
internal/app/parity_test.go) expects either:However, in this environment Bubbletea can block in input/event loops instead of returning quickly, making the test non-deterministic.
Suggested direction:
Program.Run()in unit tests (inject/mock TUI launcher),