-
Notifications
You must be signed in to change notification settings - Fork 45
Split orchestration and decouple UI/output #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split orchestration and decouple UI/output #20
Conversation
bf361dd to
4badae4
Compare
a6e277a to
3c786ad
Compare
Run TUI in a dedicated thread, route CLI output through a writer task, split orchestration into controller and post‑process modules, and keep UI/CLI layers focused on presentation with unbounded channels and early Summary phase updates
3c786ad to
2bf3174
Compare
|
Thanks for the detailed PR. I have some concerns about the changes though.
I'd like to understand what specific issue you observed that motivated these changes. If there was actual UI jitter or blocked workers, I'd love to see that addressed in a more targeted way. Could you please provide a controlled test where it demonstrates that there is jitter or the worker threads were actually stalled? Much appreciated, |
|
Hi Kaveh, thanks for the thoughtful review.
The motivation wasn’t EventStream; it was the synchronous terminal operations (especially
This was driven by worst‑case rather than average‑case. stdout/stderr are synchronous, and under slow downstream (pty/ssh/tmux)
Unbounded was a deliberate choice: the event volume is strictly bounded by durations/intervals (hundreds per run) and that’s deterministic. When the volume is small and guaranteed, unbounded doesn’t pose a practical OOM risk and is appropriate—while avoiding backpressure and
We increased modularity as a best practice to reduce coupling. Orchestration and post‑processing were separated so UI/CLI remain presentation‑only while domain logic and run lifecycle don’t depend on the interface. This lowers coupling, improves testability, and makes future changes safer (e.g., swap UI or storage/export without touching measurements). It’s not abstraction for its own sake, but deliberate separation of responsibilities for maintainability.
A controlled scenario is to run under tmux/ssh and enter tmux copy‑mode during the test. In that mode tmux stops actively reading from the PTY and stops refreshing the screen, so the output buffer fills up. Once the buffer is full, normal |
|
Thanks for sending the pr. I did provide a sample code snippet in your other pr that would be helpful in demonstrating actual potential issues. Unfortunately this seems too theoretical and I"m guessing llm-generated which is more concerned with "correctness" rather than actual real world utility. This is almost 1000 lines of code for things that you can measure yourself and I'd be happy to take feedback if an actual problem was demonstrated, for instance terminal::draw takes microseconds and isn't blocking anything that would be noticeable by a human. |
Why
What changed
Why these choices
Impact