Skip to content

fix: short-circuit selection TUI when expert key is provided#657

Merged
FL4TLiN3 merged 1 commit intomainfrom
fix/docker-start-exit
Feb 26, 2026
Merged

fix: short-circuit selection TUI when expert key is provided#657
FL4TLiN3 merged 1 commit intomainfrom
fix/docker-start-exit

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Fix perstack start <expert> <query> exiting silently with code 0 in Docker (Bun-compiled binary)
  • Root cause: Ink's render() for the selection phase caused the Bun event loop to exit before React useEffect could fire exit(), so waitUntilExit() never resolved
  • Fix: when initialExpertKey is already known, return the selection result directly without rendering Ink

Test plan

  • bun run typecheck passes
  • bun run test passes (47 tui-components tests)
  • bun run build passes
  • bun run format-and-lint passes
  • Verified in Docker: docker run --rm -t -e ANTHROPIC_API_KEY=... perstack start create-expert "query" now renders TUI and executes expert
  • Previously exited immediately with code 0 and no output

🤖 Generated with Claude Code

In Bun-compiled binaries (Docker), the Ink render() for the selection
phase caused the event loop to exit before React effects could fire,
making `perstack start <expert> <query>` exit silently with code 0.

Skip the Ink render entirely when initialExpertKey is already known,
returning the selection result directly instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 merged commit 6b83bb6 into main Feb 26, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 deleted the fix/docker-start-exit branch February 26, 2026 18:17
@FL4TLiN3 FL4TLiN3 mentioned this pull request Feb 26, 2026
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.

1 participant