Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 3:00 PM ET / 19:00 UTC. ClawSweeper reviewWhat this changesRoutes heartbeat agent runs through the existing bounded background lane so a slow heartbeat does not occupy the inbound-turn lane. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessNo blocking correctness finding. The shared fallback boundary now selects Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherGateway reply handling chooses a global lane and a per-session lane before starting an embedded or CLI agent run. The global lane controls process-wide admission, while the session lane preserves ordering within one conversation. flowchart LR
A[Heartbeat trigger] --> C[Reply runtime]
B[Visible channel turn] --> C
C --> D[Global lane selection]
D --> E[Session serialization]
E --> F[Embedded or CLI runner]
F --> G[Model provider]
G --> H[Reply delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +333, Docs +1. Total +337 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep lane selection at the shared fallback boundary, preserving per-session serialization while using the existing bounded background budget for heartbeats. Do we have a high-confidence way to reproduce the issue? Yes. The current source shows heartbeat and visible turns previously shared the Is this the best way to solve the issue? Yes. Selecting the lane once at the shared fallback boundary and forwarding it to the embedded runner fixes the owner boundary without changing session serialization or adding a new setting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2eecf3d3f2cc. 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 (5 earlier review cycles)
|
a676e42 to
ead8ac3
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
ead8ac3 to
f944f00
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f944f00 to
c1cae4c
Compare
|
Thanks for the thorough fix and proof. I’m taking this through a small maintainer rebase/edit to resolve the current |
Signed-off-by: sallyom <[email protected]>
b50a455 to
b85b6e5
Compare
|
Maintainer review: accepting the P1 availability tradeoff. Heartbeats now use bounded |
|
Merged via squash.
|
…26853) * fix(heartbeat): keep background runs off the main lane * docs(queue): describe heartbeat background lane * fix(agents): forward heartbeat lane to embedded fallback * test(agents): prove heartbeat and visible lane overlap * test(agents): expose heartbeat lane in embedded harnesses * refactor(agents): keep heartbeat lane choice at fallback boundary Signed-off-by: sallyom <[email protected]> --------- Signed-off-by: sallyom <[email protected]> Co-authored-by: sallyom <[email protected]>
Closes #126803
AI-assisted: Yes — implemented and validated with Codex.
What Problem This Solves
Fixes an issue where users sending visible-channel turns could wait minutes when a slow heartbeat embedded run occupied the process-wide
mainlane.Why This Change Was Made
Heartbeat embedded runs now use the existing bounded
cron-nestedglobal lane, while non-heartbeat runs continue to usemain. The lane is selected once before the native-versus-CLI fallback branch, then forwarded through both fallback candidates into the embedded runner, so both execution paths share the same admission invariant. Per-session lane ownership and writer serialization are unchanged, and no new concurrency setting or capacity is introduced.The queue contract now documents that inbound turns use
mainwhile heartbeat embedded runs use the bounded background lane.User Impact
A slow heartbeat no longer occupies process-wide inbound capacity, so visible turns for other sessions can start while that heartbeat is still running. A visible turn in the same configured heartbeat session remains serialized by that session's existing lane, preserving session consistency.
Evidence
Real behavior proof
wakeandchat.sendRPC handlers, heartbeat runner, embedded agent runtime, command lanes,diagnostics.lanes, and an OpenAI Responses-compatible loopback server.agents.defaults.maxConcurrentis1; awakestarts a heartbeat inagent:main:pr126853-heartbeat; the provider holds that request;chat.sendthen starts a visible turn inagent:main:pr126853-visible; both provider responses remain held while lane diagnostics are captured.OPENCLAW_E2E_SKIP_BUILD=1 OPENCLAW_E2E_VERBOSE=1 pnpm exec vitest run --config test/vitest/vitest.e2e.config.ts test/pr126853-heartbeat-visible-lane-proof.e2e.test.ts --reporter=verboseon Linux at headb50a455dbac2878313d2b1af8433c27c1cc859ee, immediately after the same test passed against a fresh full distribution build.test/pr126853-heartbeat-visible-lane-proof.e2e.test.tsis committed at the reviewed head and reproduces the trace without external credentials.cron-nestedbackground budget and may be deferred when that budget is saturated; this change does not alter that budget.Regression and validation
mainassignment restored,pnpm test src/agents/embedded-agent-runner/lanes.heartbeat.test.ts --runfails because the heartbeat-first/visible-turn-second interleaving produces only["heartbeat-start"].pnpm test src/agents/embedded-agent-runner/lanes.test.ts src/agents/embedded-agent-runner/lanes.heartbeat.test.ts --run— 2 files, 8 tests passed.pnpm test src/auto-reply/reply/agent-runner-execution-runtime.test.ts --run— 1 file, 10 tests passed. The owner-boundary test drives productionexecuteAgentTurnruntime selection and asserts the nativerunEmbeddedAgentcall receivestrigger: "heartbeat"andlane: "cron-nested".pnpm exec vitest run --config test/vitest/vitest.agents-embedded-agent-overflow-compaction.config.ts— 2 files, 14 tests passed. The two full./lanes.jsharness mocks now expose the productionresolveEmbeddedRunGlobalLaneexport, preserving the harnesses' existing normal global lanes and routing heartbeat runs tocron-nested.pnpm exec vitest run src/agents/embedded-agent-runner/compact.hooks.test.ts src/agents/embedded-agent-runner/run.lanes.test.ts src/agents/embedded-agent-runner/run.heartbeat-lane.test.ts test/pr126853-heartbeat-visible-lane-proof.e2e.test.ts— the selected default-config files passed, 2 files and 290 tests.pnpm check:changed— exit 0 across all 10 changed paths, including formatting, policy ratchets, dead-code scans, typechecks, lint, database-first checks, runtime loaders, and import-cycle checks..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --codex-bin /home/rev/.npm-global/bin/codex— TruffleHog clean; no accepted/actionable findings; overall review 0.98.58127fa73ed5255a95b7a982929292b4ac5408f5; pushed head isb50a455dbac2878313d2b1af8433c27c1cc859ee.ad1071bcd0596458e76a982e2cc07a3c5b48864b, PR refactor: split agent runner execution and preserve probe state #108137). No existing implementation PR for [Bug]: heartbeat embedded runs hold the main lane for minutes, starving visible-channel turns #126803 was found before publication.../codex/sdk/typescript/src/thread.ts:40-109,../codex/sdk/typescript/src/exec.ts:86-194, and../codex/codex-rs/app-server-protocol/src/rpc.rs:1-88; Codex keeps thread/turn streaming downstream, while OpenClaw owns this global-lane admission boundary.