Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review swarm: maintainabilityNo fresh transcript was produced for run |
Review swarm: historyNo fresh transcript was produced for run |
Review swarm: structureNo fresh transcript was produced for run |
Review swarm: FAILED
Cloud run: |
maintainability lens — PASSMaintainability review — PR #249 (agent lease renewal)BlockersNone. The change is small and behaves correctly against the fixed-clock and live tests. Mutation evidence in ConcernsShared
Heartbeat interval is not derived from the dispatched deadline — Notes
REVIEW_PASSED |
history lens — PASSBlockers: none. PR #249 passes the HISTORY lens at
Concern, non-blocking: Notes: I read the requested history and operational guidance. This is a source/history review; I did not independently rerun the reported tests. Broader workload acceptance remains outside this verdict. REVIEW_PASSED |
structure lens — MISSING |
|
🎯 review-swarm: FAILED (M:pass H:pass S:missing) Lens transcripts posted as sibling comments above. |
|
Closing as superseded — the objective is already solved on What happenedThis branch was committed at That is also what made this PR Why main's version is the one to keep
Merging this PR on top would not add coverage; it would fight that The diagnosis still standsThe underlying finding this branch came from was correct and is worth keeping in That verification is exactly why I am comfortable closing rather than rebasing: Not deleting the branchLeaving |
The DIRTY state was a semantic conflict: main gained withWorkerLease 83 minutes after #249's commit and wires it at worker.ts:94. Main's version renews at remaining/3, aborts via AbortSignal, rejects post-expiry renewals and drains before complete -- strictly more than the heartbeat. Closed with evidence, branch kept for its tests. Also caught a vacuous conflict probe (wrong merge-tree form + `|| echo 0`). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
…se-renewal Checking target-not-liveness immediately surfaced lease-renewal-0909 alive on a CLOSED #249. Re-verified 0 tracked changes / 0 unpushed / 0 writes in 60m before stopping it; kept the worktree and branch for its harvestable tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
Agent CLI steps that exceed the kernel's 30-second lease currently lose their attempt before reporting completion. Renew each attempt through the existing
step.heartbeatprotocol every 10 seconds while its CLI is running.Stop renewal on CLI settlement, execution failure, or worker close. Drain an outstanding renewal before completing; preserve CLI output with
worker_erroron renewal failure and surface both renewal and completion errors when both fail. No kernel or timeout changes.The real 34-second subprocess regression, simulated ten-minute case, lifecycle coverage, and literal command/output records are in the verification report. The report includes the original reproduction and the failure/pass pair after removing and restoring the fix byte-for-byte. It states the selected test scope and the prebuilt kernel used.
Closing stops renewals immediately, so a CLI still draining after close can report lease expiry. This preserves the requested shutdown contract. Ready for human review; do not merge automatically.
Note
Medium Risk
Changes core agent step execution and journal completion semantics for long steps and shutdown; mistakes could cause lease conflicts or incorrect completion reasons, though scope is isolated to the SDK worker.
Overview
AgentWorker now keeps the kernel attempt lease alive for long-running agent CLIs by calling existing
step.heartbeaton a 10s cadence (inside the 30s lease), via newstartWorkerHeartbeat.Renewal is non-overlapping (next tick only after the prior heartbeat ack), stops when the CLI finishes or throws, and
close()stops all heartbeats immediately—even if a CLI is still draining, which can surface lease conflicts.stop()waits for an in-flight heartbeat beforestepCompleteso completion cannot race a late renewal. Failed renewals forceworker_errorcompletion while still journaling CLI output; renewal, completion, and CLI errors collapse to a single error orAggregateError.Adds deterministic Vitest coverage (34s / 10min simulated steps, concurrency, close races) plus an opt-in live 34s subprocess test when
RELAYFLOWD_BINis set, and an evidence doc with reproduction and mutation checks. SDK-only; no kernel or protocol changes.Reviewed by Cursor Bugbot for commit 33297fa. Bugbot is set up for automated code reviews on this repo. Configure here.