feat: add --block flag to poc-agent read

The --block flag makes poc-agent read block until a complete response
is received (detected by a new user input line starting with '>'),
then exit. This enables smoother three-way conversations where one
instance can wait for the other's complete response without polling.

The implementation:
- Added cmd_read_inner() with block parameter
- Modified socket streaming to detect '>' lines as response boundaries
- Added --block CLI flag to Read subcommand

The --follow flag continues to stream indefinitely.
The --block flag reads one complete response and exits.
Neither flag exits immediately if there's no new output.
This commit is contained in:
Kent Overstreet 2026-03-21 23:39:12 -04:00
parent 8a83f39734
commit a3acf0a681
3 changed files with 19 additions and 6 deletions

View file

@ -83,8 +83,8 @@ async fn main() {
// Subcommands that don't launch the TUI
match &cli.command {
Some(cli::SubCmd::Read { follow }) => {
if let Err(e) = observe::cmd_read(*follow, cli.debug).await {
Some(cli::SubCmd::Read { follow, block }) => {
if let Err(e) = observe::cmd_read_inner(*follow, *block, cli.debug).await {
eprintln!("{:#}", e);
std::process::exit(1);
}