Repository navigation
fix: avoid rich live conflicts in warp connect and hide ctrl-c tip in daemon - #4
Merged
Merged
Conversation
… daemon warp.connect() used console.status (a rich Live), which crashes with 'Only one live display may be active at once' when the bridge rotates WARP from a concurrent request thread. Replace it with a plain print + polling loop that is thread-safe and keeps the foreground UX. serve() printed 'Ctrl-C to stop.' unconditionally, so the daemon child (re-runs 'start bridge' with stdout redirected to the log file) wrote a misleading interactive tip into openrot-bridge.log. Gate it on sys.stdout.isatty() and add regression tests for both fixes.
Reviewer's GuideThe PR removes Rich Live usage from WARP connection polling to prevent concurrent live-display conflicts, makes the bridge’s Ctrl-C hint TTY-aware for cleaner daemon logs, and adds focused tests covering both behaviors. Sequence diagram for thread-safe WARP connection pollingsequenceDiagram
participant Request as Request thread
participant Cascade
participant Warp as warp.connect()
participant Console
participant WARP
Request->>Cascade: cascade.rotate()
Cascade->>Warp: warp.rotate()
Warp->>WARP: _run(connect)
Warp->>Console: console.print(waiting message)
loop up to 120 attempts
Warp->>WARP: is_connected()
WARP-->>Warp: connection status
alt connected
Warp-->>Cascade: True
else not connected
Warp->>Warp: time.sleep(0.5)
end
end
Flow diagram for TTY-aware bridge Ctrl-C hintflowchart TD
A["bridge.serve()"] --> B["console.print listening message"]
B --> C{"sys.stdout.isatty()"}
C -->|yes| D["console.print Ctrl-C to stop."]
C -->|no| E["omit interactive hint"]
D --> F["continue serving"]
E --> F
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
vispar-tech
added a commit
that referenced
this pull request
Oct 13, 2026
fix: avoid rich live conflicts in warp connect and hide ctrl-c tip in daemon
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.
What
Two fixes found while summarizing the project logs:
rich.errors.LiveError: Only one live display may be active at once(19 tracebacks inopenrot-bridge.log)warp.connect()usedconsole.status(...), which starts a richLive.do_POST→_handle→cascade.rotate()→warp.rotate()→connect()), a concurrent request can start a secondLiveon the sameConsole→ crash of the handler thread.console.statusblock with a plainconsole.print+ polling loop. Thread-safe, same foreground UX.Ctrl-C to stop.appearing in daemon logsbridge.serve()printed the tip unconditionally. The daemon child re-runsstart bridgewith stdout redirected to the log file, so the misleading interactive tip landed inopenrot-bridge.log.sys.stdout.isatty()(daemon child / redirected runs have a non-TTY stdout).Tests
test_warp.py:connect()must not start a rich Live (returns True even whenconsole.statuswould explode) and still emits the plain waiting message.test_bridge.py:Ctrl-C to stop.absent when stdout is not a TTY, present when it is.Verify
ruff check/ruff format --checkpassmypy openrot/cleanpytest: 300 passed, coverage 86%Summary by Sourcery
Prevent concurrent WARP connection attempts from crashing the bridge and keep daemon logs free of interactive-only messages.
Bug Fixes:
Tests: