Rich UI slice 9: bounded bash_watch for a viewed task
Rich UI slice 9: a phone viewing a running shell task can wait briefly for new output with bash_watch, through the carrier route.
- Bounded polling goes through the existing observation-only native watch handler. A deferred completion releases its executor slot, and only the completed response is projected back to the phone.
- The reply budget is capped at 20 s from the original frame receipt, including queued or deferred time, and keeps any earlier client deadline. That needed one call site in
subc/mod.rsto pass the existing receipt budget intorich_ui::session::submit. - Carrier dispatch stays non-worker and preset-free. A phone watch never renews the task, recovers it, attaches a view or writes session sidecars, and it never moves the task's kill deadline.
Tests: closed arguments and timeout bounds, literal and regex matches, exit, delayed output and exit, a 10,000 ms request clamped to 5,000 ms, unchanged task metadata and deadline, and a loaded task near its kill hand-off margin. A regression resets only the budget's receipt time to admission time and fails exactly the late-admission test.
Verified on the build server: 425 Rich UI, consent, tool-provider and bash_watch library tests, plus the Windows target check. Production stays unpublished, since the manifest isn't published yet.
Summary by cubic
Adds a bounded bash_watch operation for a viewed task through the carrier route, so a phone can briefly poll for new output or exit without holding an executor slot or extending task lifetime.
Details
- Uses the observation-only native watch handler; a deferred completion releases its executor slot and only the completed response is projected back.
- Caps the reply budget at 20 s from frame receipt, including queued or deferred time, while preserving any earlier client deadline; passes the receipt budget into
rich_ui::session::submit. - Carrier dispatch stays non-worker and preset-free; a phone watch never renews, recovers, attaches a view, writes session sidecars, or moves the task's kill deadline.