fix(wrapper): poll-based TUI readiness replaces fixed sleep#46
Merged
Conversation
Replaced time.sleep(8) in _launch_tmux() with _wait_for_tui_ready() which polls tmux capture-pane every 1s for up to 30s, requiring 2 consecutive stable readings with >100 chars. Added _verify_prompt_submitted() which retries paste once if the TUI didn't receive it, with fallback to logged prompt file for manual recovery. Fixes blank Claude Code session on GPU server where 8s was insufficient for cold start. Adapts to any machine speed automatically. PR-031 added to PRIORS — rule: never use fixed sleeps for external process readiness, always poll for a readiness signal. 524 tests, ruff clean, validate-docs 10/0/1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploying zero-operators with
|
| Latest commit: |
614693f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://788dee30.zero-operators.pages.dev |
| Branch Preview URL: | https://claude-lucid-swirles.zero-operators.pages.dev |
SamPlvs
added a commit
that referenced
this pull request
Apr 30, 2026
fix(wrapper): poll-based TUI readiness replaces fixed sleep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
time.sleep(8)in tmux launch with poll-based TUI readiness detection_wait_for_tui_ready()pollstmux capture-paneevery 1s for up to 30s, requiring 2 consecutive stable readings_verify_prompt_submitted()retries paste once if TUI didn't receive it, logs prompt file path for manual recoveryRoot cause
time.sleep(8)was calibrated on Mac Mini. GPU server (different hardware, extensions, cold-start latency) wasn't ready after 8s.tmux paste-bufferis fire-and-forget — silently drops the prompt with no error. User saw a blank Claude Code session.What changed
src/zo/wrapper.py:_wait_for_tui_ready(),_verify_prompt_submitted(),_capture_pane()methodsmemory/zo-platform/PRIORS.md: PR-031 addedTest plan
ruff checkcleanvalidate-docs.sh10/0 (Check 8 confidentiality clean)🤖 Generated with Claude Code