Repository navigation
fix(openclaw_agent): salvage the partial trace when a run is cut short by timeout - #2615
Conversation
845393e to
35499fe
Compare
|
/claude review |
|
HOLD The partial-session salvage is a reasonable feature, and the disk-scan fallback ( BLOCKER β mutating the shared event loop's SIGTERM handler per-request. RISK β orphaned child process on SIGTERM cancel. Non-blocking: the portable-python bump (3.12.8β3.13.14, PBS 20260805) and the new Resolve the signal-handler lifecycle before merge β a broken graceful shutdown and unreliable salvage under concurrency are exactly the silent-in-production failures that page someone. |
35499fe to
f60c2a2
Compare
β¦t by timeout A timed-out rollout previously lost its whole transcript. The agent only reads OpenClaw's session file from the completion envelope (absent on a cut-short run), and the finally deletes the workdir. Now two cut-short paths are handled: our own config.timeout (TimeoutError), and an outer harness/sandbox timeout that SIGTERMs this process during its grace window before SIGKILL. On either, stop waiting, locate OpenClaw's incrementally-written session on disk (_find_partial_session), parse it, and return the partial output, so the harness records the transcript instead of an empty rollout. Returning quickly keeps it inside the grace window, so no harness change is needed. Pairs with the apptainer provider's SIGTERM-grace change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Elisa Martinez Abad <elisam@nvidia.com>
Signed-off-by: Elisa Martinez Abad <elisam@nvidia.com>
f116bb9 to
eb93a35
Compare
β¦the child process on salvage Signed-off-by: Elisa Martinez Abad <elisam@nvidia.com>
|
/claude review |
|
SHIP WITH CARE β partial-transcript salvage is a real robustness win, but the SIGTERM handling has a lifecycle regression. The core salvage logic is sound and well-tested: One RISK worth resolving before merge (inline on
The unit test that would catch this instead patches Everything else β async structure ( |
Signed-off-by: Christian Munley <cmunley@nvidia.com>
|
/claude review |
|
SHIP β solid partial-transcript salvage for cut-short OpenClaw runs. No reliability blockers. Scope is the agent harness only (no verifier/scorer, no async-HTTP, no
One NOTE (author's call, not blocking):
Behavior change worth flagging for reviewers: previously a timeout produced empty padded output (scored as a miss); now a partial transcript is scored. That's the intended feature (partial credit), but it will shift scores for runs that hit the timeout/SIGTERM window. |
|
/claude review |
|
SHIP β LGTM, no reliability concerns. Reviewed the OpenClaw partial-session salvage change. It's focused, careful, and well-tested. Verified points:
One intentional behavior change worth flagging for the reader, not a defect: a run timeout previously produced empty output (scored as empty); it now scores the partial on-disk transcript. That's the point of the PR and is documented in the inline comment, but it does shift what a timed-out rollout contributes to eval/training signal. |
What does this PR do?
Salvages the partial trace when an OpenClaw rollout is cut short by timeout, instead of losing the whole transcript.
Previously, the agent only read OpenClaw's session file from the completion envelope, which is absent on a cut-short run, and the
finallyblock deleted the workdir before anything could recover it β so a timed-out rollout came back empty. This PR handles both cut-short paths: our ownconfig.timeout(TimeoutError), and an outer harness/sandbox timeout that SIGTERMs this process during its grace window before SIGKILL. On either path, we stop waiting, locate OpenClaw's incrementally-written session on disk (_find_partial_session), parse it, and return the partial output β so the harness records a partial transcript instead of an empty rollout.Returning quickly on SIGTERM keeps the response inside the grace window, so no harness-side change is needed. Pairs with the apptainer provider's SIGTERM-grace change.
Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).