Skip to content

fix(agents): harden skill-review lane against cold-load stalls - #115950

Merged
steipete merged 1 commit into
mainfrom
claude/inspiring-mestorf-fadd30
Jul 29, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/inspiring-mestorf-fadd30

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two live defects observed on 2026-07-29 in the skill-workshop experience review running on CommandLane.SkillWorkshopReview with the 150-second no-progress watchdog. On a fresh process, cold-loading all bundled extensions (~122 seconds) plus provider/model discovery ran inside the lane task without reporting progress, so the watchdog raised CommandLaneTaskTimeoutError (no progress for 216227ms) before the review model call started. Separately, AuthProfileMigrationRequiredError surfaced only after the lane timeout (observed at 550 seconds), and the scheduler re-looped on this terminal error class.

Why This Change Was Made

Prepared-model-runtime acquisition is live work, not a hang, so it now feeds the lane watchdog through a shared heartbeat helper extracted from the identical inlined settled-turn-finalization pattern; settled-turn finalization now uses the helper too. The experience-review scheduler treats AUTH_PROFILE_MIGRATION_REQUIRED as terminal: it drops the pending candidate and logs the actionable doctor message instead of re-arming.

The pending entry is intentionally deleted after runReview succeeds rather than before the call. Transient review failures therefore retain their evidence and re-arm after the 30-second idle interval, while terminal auth-migration failures drop cleanly.

User Impact

The first review after gateway startup, CLI runs, or fresh test processes no longer self-terminates during cold loading. Operators with legacy auth stores receive one clear run openclaw doctor --fix warning instead of a silent retry loop.

Evidence

  • node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/lane-runtime.test.ts src/skills/workshop/experience-review.test.ts
    • 2 Vitest shards passed in 7.70s
    • 21/21 workshop tests passed
    • 4/4 embedded-run lane tests passed
  • Composition regression: keeps a slow lane task alive while runtime acquisition makes progress proves a lane task with a 25-second no-progress budget survives a 52-second acquisition under the heartbeat.
  • node scripts/check-changed.mjs
    • lanes=core, coreTests
    • conflict, ratchet, formatting, boundary, dependency, dead-export, core/core-test typecheck, lint, database-first, runtime-cycle, and related guards passed
    • Blacksmith Testbox exitCode: 0 (commandMs: 556915)

@steipete
steipete marked this pull request as ready for review July 29, 2026 14:31
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 29, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 29, 2026, 10:35 AM ET / 14:35 UTC.

ClawSweeper review

What this changes

This PR adds a shared lane-heartbeat helper around prepared model-runtime acquisition and stops the skill-workshop review scheduler from retrying terminal auth-profile migration failures.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 8 items remain

Keep this PR open for a targeted correction. The shared helper emits timer-driven heartbeats while prepared-runtime acquisition is merely pending, so a genuinely stalled plugin load or provider discovery can no longer trip the lane’s no-progress watchdog. The supplied validation is mock/test and changed-check evidence, not after-fix real runtime proof.

Priority: P1
Reviewed head: 4bb2e0df22d0644f23f1a40b578bb039e16423b8
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch has focused intent and tests, but it introduces a P1 watchdog regression and lacks real after-fix behavior proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused Vitest and changed-check results, but it does not include after-fix runtime output showing a cold acquisition progresses successfully while a stalled acquisition still reaches a bounded failure; add redacted terminal/live logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused Vitest and changed-check results, but it does not include after-fix runtime output showing a cold acquisition progresses successfully while a stalled acquisition still reaches a bounded failure; add redacted terminal/live logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Synthetic heartbeats mask a stalled acquisition: The new helper calls the lane progress callback immediately and on a fixed interval until the supplied promise settles. It does not receive a loader/provider progress event, so a promise stuck inside acquisition still reports progress indefinitely.
The affected watchdog is used during runtime acquisition: The orchestrator wraps both isolated and normal prepared-runtime acquisition branches with the new interval-based helper, placing this behavior before the model call.
Regression test verifies elapsed time, not real acquisition progress: The added composition test keeps an unresolved acquisition alive by advancing fake timers; it confirms the synthetic heartbeat rather than proving loader/provider phases make observable progress.
Findings 1 actionable finding [P1] Preserve the no-progress watchdog for stalled acquisition
Security None None.

How this fits together

Embedded agent runs execute inside command lanes guarded by a no-progress watchdog. Before a model can run, the lane acquires a prepared runtime that loads plugin/provider state; completed runs can also enqueue a skill-workshop experience review for later model analysis.

flowchart LR
  A[Agent or CLI run] --> B[Embedded run lane]
  B --> C[Prepared runtime acquisition]
  C --> D[Plugin and provider discovery]
  D --> E[Model execution]
  E --> F[Completed-run review candidate]
  F --> G[Skill workshop scheduler]
  B --> H[No-progress watchdog]
Loading

Decision needed

Question Recommendation
Should prepared-runtime acquisition be allowed to suppress the lane no-progress watchdog without an acquisition-phase progress signal or a separate bounded deadline? Use real acquisition progress: Pass loader/provider progress notifications to the lane callback and preserve a bounded timeout when no acquisition phase advances.

Why: This is an availability contract choice: accepting timer-driven liveness can preserve slow cold starts but also removes the existing recovery path for acquisition deadlocks.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused Vitest and changed-check results, but it does not include after-fix runtime output showing a cold acquisition progresses successfully while a stalled acquisition still reaches a bounded failure; add redacted terminal/live logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve the no-progress watchdog for stalled acquisition (P1) - The interval calls noteLaneTaskProgress even when neither plugin loading nor provider discovery has advanced. A promise stuck inside either acquisition branch therefore stays alive forever instead of surfacing the lane timeout this watchdog owns. Feed it actual acquisition progress, or keep a bounded acquisition deadline; the new fake-timer test currently codifies the masking behavior.
  • Resolve merge risk (P2) - Merging the interval-based helper changes a no-progress watchdog into an elapsed-time heartbeat for runtime acquisition, so a real cold-load or provider-discovery deadlock can keep an agent lane occupied without producing the intended timeout.
  • Resolve merge risk (P1) - The PR body supplies focused tests and changed-check output, but no after-fix runtime trace or redacted live output showing a cold acquisition both survives legitimate work and still times out when acquisition stops advancing.
  • Improve patch quality - Replace the synthetic heartbeat with actual acquisition progress or a bounded acquisition deadline.
  • Improve patch quality - Add a regression that demonstrates a stalled acquisition still triggers the lane timeout.
  • Improve patch quality - Post redacted after-fix runtime output for the cold-load path and the stalled-acquisition path; updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review.

Findings

  • [P1] Preserve the no-progress watchdog for stalled acquisition — src/agents/embedded-agent-runner/run/lane-runtime.ts:15-19
Agent review details

Security

None.

PR surface

Source +33, Tests +151. Total +184 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 47 14 +33
Tests 2 157 6 +151
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 204 20 +184

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/skills/workshop/experience-review.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Preserve a bounded stalled-acquisition path (recommended)
    Replace the timer-driven heartbeat with actual loader/provider progress reporting or a dedicated bounded acquisition deadline before merge.
  2. Deliberately accept indefinite acquisition waits
    Merge the current behavior only if maintainers explicitly want cold acquisition to bypass the lane no-progress watchdog even when discovery stops advancing.

Technical review

Best possible solution:

Carry real progress signals from prepared-runtime loading and provider discovery into the lane watchdog, or retain a bounded acquisition-phase timeout, then provide redacted runtime evidence for both the cold-load success path and a deliberately stalled acquisition.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: make prepared-runtime acquisition remain pending after it starts; the new interval continues calling the lane progress callback, so the no-progress watchdog cannot distinguish that stall from real loader progress.

Is this the best way to solve the issue?

No. The scheduler’s terminal-auth handling is narrow and appropriate, but the shared heartbeat is not the best watchdog fix because it records elapsed time rather than progress at the acquisition boundary.

Full review comments:

  • [P1] Preserve the no-progress watchdog for stalled acquisition — src/agents/embedded-agent-runner/run/lane-runtime.ts:15-19
    The interval calls noteLaneTaskProgress even when neither plugin loading nor provider discovery has advanced. A promise stuck inside either acquisition branch therefore stays alive forever instead of surfacing the lane timeout this watchdog owns. Feed it actual acquisition progress, or keep a bounded acquisition deadline; the new fake-timer test currently codifies the masking behavior.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 628262a4afb3.

Labels

Label changes:

  • add P1: The patch can make a real agent-runtime stall persist instead of timing out and recovering.
  • add merge-risk: 🚨 availability: A fixed interval reports liveness while runtime acquisition may be stalled, which can hold an execution lane indefinitely.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused Vitest and changed-check results, but it does not include after-fix runtime output showing a cold acquisition progresses successfully while a stalled acquisition still reaches a bounded failure; add redacted terminal/live logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: The patch can make a real agent-runtime stall persist instead of timing out and recovering.
  • merge-risk: 🚨 availability: A fixed interval reports liveness while runtime acquisition may be stalled, which can hold an execution lane indefinitely.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused Vitest and changed-check results, but it does not include after-fix runtime output showing a cold acquisition progresses successfully while a stalled acquisition still reaches a bounded failure; add redacted terminal/live logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Synthetic heartbeats mask a stalled acquisition: The new helper calls the lane progress callback immediately and on a fixed interval until the supplied promise settles. It does not receive a loader/provider progress event, so a promise stuck inside acquisition still reports progress indefinitely. (src/agents/embedded-agent-runner/run/lane-runtime.ts:13, 4bb2e0df22d0)
  • The affected watchdog is used during runtime acquisition: The orchestrator wraps both isolated and normal prepared-runtime acquisition branches with the new interval-based helper, placing this behavior before the model call. (src/agents/embedded-agent-runner/run-orchestrator.ts:220, 4bb2e0df22d0)
  • Regression test verifies elapsed time, not real acquisition progress: The added composition test keeps an unresolved acquisition alive by advancing fake timers; it confirms the synthetic heartbeat rather than proving loader/provider phases make observable progress. (src/agents/embedded-agent-runner/run/lane-runtime.test.ts:54, 4bb2e0df22d0)
  • Scheduler error handling is separately covered: The workshop scheduler preserves pending work for generic review failures and drops only the terminal auth-profile migration error, with focused tests added for both outcomes. (src/skills/workshop/experience-review.ts:264, 4bb2e0df22d0)
  • Protected maintainer handling: This PR carries the maintainer label, so it remains open for explicit maintainer handling regardless of ordinary cleanup eligibility.

Likely related people:

  • steipete: The supplied context identifies steipete as the author of the only patch and commit for this agent-runtime and skill-workshop change; the available review evidence does not independently establish a broader current-main ownership trail. (role: likely follow-up owner; confidence: medium; commits: 4bb2e0df22d0; files: src/agents/embedded-agent-runner/run/lane-runtime.ts, src/agents/embedded-agent-runner/run-orchestrator.ts, src/skills/workshop/experience-review.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper rank-up moves reviewed for 4bb2e0df22d0644f23f1a40b578bb039e16423b8.

  • The requested replacement with loader/provider phase events or another acquisition deadline is intentionally skipped. Prepared-model-runtime publication already owns the stalled-work boundary: DEFAULT_MODEL_RUNTIME_BUILD_TIMEOUT_MS is 120 seconds, startSerializedSnapshotBuild applies it across queueing plus the build, and live provider discovery has its own 5-second timeout. src/agents/prepared-model-runtime.lifecycle.test.ts also proves a never-settling publication times out without overlapping its late build with a retry. The outer command-lane timer remains a no-progress watchdog; this change prevents it from preempting bounded active acquisition.
  • The requested stalled-acquisition regression is therefore already covered at the prepared-runtime owner boundary. The new lane composition test covers the separate contract changed here: a 25-second no-progress budget survives 52 seconds of actively heartbeating acquisition.
  • Additional after-fix live cold-load/stall output is skipped for this landing. The PR records the observed live defect and exact timings, while the after-fix proof is deterministic focused regression coverage, the complete core, coreTests changed gate, and exact-head hosted CI. A fresh-process bundled-plugin/provider cold load is environment-dependent and does not replace the owner-level timeout regression.
  • The availability merge risk is accepted as an explicit maintainer decision for this focused fix. No config, protocol, storage, or timeout-budget surface changes are included.

These moves were considered and are being skipped deliberately; no @clawsweeper re-review round trip is requested.

@steipete
steipete merged commit 9c065b5 into main Jul 29, 2026
184 of 196 checks passed
@steipete
steipete deleted the claude/inspiring-mestorf-fadd30 branch July 29, 2026 14:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant