Repository navigation
feat(cli): allow send --if done - #401
rimumomuri wants to merge 2 commits into
Conversation
|
A second use case for this, from a coordinator rather than a person: Answerback assigns work to agents running in hc terminals and wants to send a follow-up task to an interactive agent after it finished the first. I built the same change independently on 329cb66 before finding this PR, and the type, schema and |
# Conflicts: # crates/herdr-core/src/SKILL.md # schema/hc.openrpc.json
Closes #154. A fresh take on #164 (by @dlucik), rebased on current
masteras suggested when it was closed. The change is the same; credit for the approach goes there.Programs that report
doneat the end of a turn and stay there (Claude Code does) cannot get a guarded follow-up today:--if donefails argument parsing, and--if idlegivesstatus_mismatch. The only option left is a send with no condition, which also types into the shell once the program has exited.Still reproducible on hc 0.1.22 (macOS arm64):
The input path already compares the status word under the same lock, so only the type changes:
IdleOrWorkingbecomesSendIfwithidle | working | done(CLI--ifandterminal.sendif).blockedis unchanged: it is refused without--forceand is not a value ofif.schema/hc.openrpc.jsonis regenerated (additive for clients of the released API),docs/commands.mdis refreshed, and the manual gets one line.donerefuses--if idlewithout typing, and accepts--if doneboth through the CLI and throughterminal.send. It fails onmasterand passes with the change.Checks on macOS arm64 (Rust 1.95.0, Zig 0.16.0):
cargo fmt --check,cargo clippy -D warnings(native and the Windows type-check fromjust lint),just docs-check, andcargo test --locked(561 passed) all pass.cargo denywas not run because there are no dependency changes.