Repository navigation
feat: add lease heartbeat command - #1356
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 16, 2026, 8:45 AM ET / 12:45 UTC. ClawSweeper reviewWhat this changesThis PR adds Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain Keep open: source review finds no blocking correctness defect, but this external PR still needs inspectable real lease behavior proof before merge. Likely related people: steipete (high confidence). Priority: P2 Review scores
Verification
How this fits togetherThe Crabbox CLI resolves a lease to either a coordinator-managed backend or a direct SSH provider, then updates lifecycle state. The new command accepts a lease identifier and returns the committed or touched lease state to external SSH-based drivers. flowchart LR
A[Heartbeat command] --> B[Lease configuration]
B --> C{Coordinator managed?}
C -->|Yes| D[Provider-bound coordinator heartbeat]
C -->|No| E[Exact claim and provider touch]
D --> F[Lease state output]
E --> F[Lease state output]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Add a redacted terminal transcript from a real owned lease showing the heartbeat result and refreshed expiry, then merge the focused implementation if that proof confirms the documented behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a proposed command, while its fixture tests provide a clear contract-level validation path. Is this the best way to solve the issue? Yes, pending real behavior proof: using the existing provider-bound heartbeat and touch operations preserves the established lifecycle boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ba91f2845395. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Summary
crabbox heartbeat --id <lease-or-slug> [--provider <p>] [--idle-timeout <duration>] [--json]Touchfallback only after exact local-claim and terminal-state checksWhy
External drivers can keep a warm Crabbox lease busy entirely over SSH without invoking
crabbox run. In that workflow, ordinary SSH activity and read-onlyinspect/statuscalls do not advance the coordinator'slastTouchedAt, so an actively used machine can cross its idle deadline and be reaped.This provides the missing explicit keepalive surface for openclaw/openclaw#124546 without adding a second endpoint or changing the coordinator protocol.
Backend behavior
Managed coordinator leases use the same provider-bound heartbeat client methods as the existing background heartbeat loop. Registered mode updates both the canonical coordinator lease and the exact claimed direct-provider resource because both own expiry state. Coordinator-free SSH providers use their existing
Touchcapability. Unsupported providers fail with a clear lease-heartbeat diagnostic.Unknown, unowned, expired, released, or otherwise terminal coordinator leases retain the coordinator's existing error shape. Direct-provider mutation requires an exact matching local claim and rejects terminal state before touching the resource.
Verification
go build -trimpath -o bin/crabbox ./cmd/crabboxgo vet ./...go test -race ./...node scripts/check-command-docs.mjsnode scripts/build-docs-site.mjs.agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-outputNo new configuration keys, credentials, secrets, Worker source changes, or coordinator protocol changes are required.