Skip to main content

dispatch_blockinput

Function dispatch_blockinput 

Source
fn dispatch_blockinput(block_id: &str, data: Vec<u8>) -> Result<(), String>
Expand description

Route a decoded blockinput payload — the actual human-keystroke path (termViewModel.ts’s blockinput WS command, used by both the standalone Terminal widget and an agent pane’s composer-drawer shell) — to its block’s controller.

Mirrors controllerinput’s own lock check above: drops the input outright while block_id is under an active PtyShell agent lease, rather than forwarding it. This was agent_lock’s documented “Known gap” — blockinput, not controllerinput, is where a human’s real keystrokes actually travel, and until now nothing server-side stopped one from interleaving with an agent’s own PtyShellInput write into the same PTY. The frontend’s agentLocked() gate is still the primary UX layer (stops it before it’s even sent), but it is eventually consistent; this is the synchronous backstop against this handler’s own state.