mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-08 17:14:49 +08:00
WorkerStatus is fully tracked in worker_boot.rs but was invisible to external observers (clawhip, orchestrators) because opencode serve's HTTP server is upstream and not ours to extend. Solution: atomic file-based observability. - emit_state_file() writes .claw/worker-state.json on every push_event() call (tmp write + rename for atomicity) - Snapshot includes: worker_id, status, is_ready, trust_gate_cleared, prompt_in_flight, last_event, updated_at - Add 'claw state' CLI subcommand to read and print the file - Add regression test: emit_state_file_writes_worker_status_on_transition verifies spawning→ready_for_prompt transition is reflected on disk This closes the /state dogfood gap without requiring any upstream opencode changes. Clawhip can now distinguish a truly stalled worker (status: trust_required or running with no recent updated_at) from a quiet-but-progressing one.