Skip to content

fix(heartbeat): skip poll when active session lane is busy - #14396

Closed
grunt3714-lgtm wants to merge 1 commit into
openclaw:mainfrom
grunt3714-lgtm:fix/13573-heartbeat-skip-busy
Closed

grunt3714-lgtm wants to merge 1 commit into
openclaw:mainfrom
grunt3714-lgtm:fix/13573-heartbeat-skip-busy

Conversation

@grunt3714-lgtm

@grunt3714-lgtm grunt3714-lgtm commented Feb 12, 2026 •

Copy link
Copy Markdown

Fixes #13573

Summary

Heartbeat polling previously only checked the global main queue lane before running. Embedded Pi runs are queued in per-session lanes (session:<key>), so a session could be actively busy while heartbeat still fired and collided with that run.

This change makes heartbeat skip when either:

  • the global main lane has in-flight work, or
  • the resolved heartbeat session lane has in-flight work.

Changes

  • Resolve heartbeat session earlier in runHeartbeatOnce
  • Check queue depth for both main and session:<heartbeatSessionKey> lanes
  • Return skipped: requests-in-flight when either lane is busy
  • Add regression test: heartbeat-runner.skips-session-busy.test.ts

Validation

  • pnpm -s vitest run src/infra/heartbeat-runner.skips-session-busy.test.ts

Greptile Overview

Greptile Summary

This PR updates runHeartbeatOnce to resolve the heartbeat session key earlier and skip heartbeat execution when either the global CommandLane.Main queue or the resolved per-session session: lane has in-flight work, preventing heartbeat from colliding with active embedded Pi runs. It also adds a regression test that asserts heartbeats are skipped when the active session lane reports queued work via the injected getQueueSize dependency.

Confidence Score: 3/5

  • This PR is mostly safe but may regress delivery of exec/cron completion events when a session lane stays busy.
  • The core change is small and well-targeted (additional queue-depth check), and the new test covers the intended regression. However, the skip condition is evaluated before exec/cron event handling, which can prevent those events from being processed if the session lane remains in-flight, changing user-visible behavior in a way that seems unintended for exec/cron notifications.
  • src/infra/heartbeat-runner.ts

(4/5) You can add custom instructions or style guidelines for the agent here!

- Check both main lane and active heartbeat session lane queue depth
- Prevent heartbeat poll collisions with in-flight embedded session runs
- Add regression test for busy session lane skip

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +424 to 429
const { entry, sessionKey, storePath } = resolveHeartbeatSession(cfg, agentId, heartbeat);
const queueReader = opts.deps?.getQueueSize ?? getQueueSize;
const mainQueueSize = queueReader(CommandLane.Main);
const sessionQueueSize = queueReader(resolveEmbeddedSessionLane(sessionKey));
if (mainQueueSize > 0 || sessionQueueSize > 0) {
return { status: "skipped", reason: "requests-in-flight" };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exec/cron events can stall

runHeartbeatOnce now returns { status: "skipped", reason: "requests-in-flight" } whenever either CommandLane.Main or the resolved session: lane has in-flight work (src/infra/heartbeat-runner.ts:424-430). This check runs before the exec/cron event handling (peekSystemEvents(sessionKey)), so if a long-running session lane is busy, heartbeat will never process pending exec completion / cron system events for that session, potentially blocking those notifications indefinitely.

If exec/cron events are intended to be delivered even while a session lane is busy, the busy-lane check needs to exempt opts.reason === "exec-event" and opts.reason?.startsWith("cron:") (or otherwise ensure pending events can still be relayed).

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/infra/heartbeat-runner.ts
Line: 424:429

Comment:
**Exec/cron events can stall**

`runHeartbeatOnce` now returns `{ status: "skipped", reason: "requests-in-flight" }` whenever either `CommandLane.Main` *or* the resolved `session:` lane has in-flight work (`src/infra/heartbeat-runner.ts:424-430`). This check runs *before* the exec/cron event handling (`peekSystemEvents(sessionKey)`), so if a long-running session lane is busy, heartbeat will never process pending exec completion / cron system events for that session, potentially blocking those notifications indefinitely.

If exec/cron events are intended to be delivered even while a session lane is busy, the busy-lane check needs to exempt `opts.reason === "exec-event"` and `opts.reason?.startsWith("cron:")` (or otherwise ensure pending events can still be relayed).

How can I resolve this? If you propose a fix, please make it concise.

@grunt3714-lgtm

Copy link
Copy Markdown
Author

Closing — heartbeat scheduler reliability was addressed in #14901 (2026.2.12). No longer needed.

silas-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Apr 20, 2026
…upstream

22 comment-edits across 13 files. All bare `#N` references that point
to karmaterminal/openclaw or karmaterminal/openclaw-bootstrap fork
issues now use the prefixed `karmaterminal/openclaw#N` (or
`karmaterminal/openclaw-bootstrap#N`) form so they cannot be silently
auto-linked to unrelated upstream openclaw/openclaw issues.

Citations changed:
- bug #639 -> #639 (8 sites: compact-reasons.{ts,test.ts}, followup-runner.ts ×3, agent-runner-execution.ts ×3, request-compaction-tool.ts ×2)
- (#580) / See #580 -> (#580) / See #580 (4 sites: context-pressure.{ts,test.ts})
- (#531) -> (#531) (2 sites: scheduler.test.ts)
- issue #475 -> #475 (1 site: session-cost-usage.ts)
- bootstrap#475 -> karmaterminal/openclaw-bootstrap#475 (1 site: discoverAllSessions.test.ts; the line above already used the prefixed form, this was the laggard)
- Bug #473 fix / issue #473 -> #473 (3 sites: subagent-announce.continuation.runtime.{ts,test.ts})
- review gap on #188 -> review gap on #188 (1 site: status.test.ts; also dropped a named-prince prefix in the same test label, which separately satisfies part of #200)

Left alone (out of scope per issue):
- Pre-existing upstream openclaw/openclaw citations (openclaw#26905, openclaw#36142, openclaw#60552, openclaw#28491, openclaw#41981, openclaw#18264, openclaw#59428, openclaw#31311, openclaw#14869, openclaw#17971, openclaw#29683, openclaw#58409, openclaw#35481, openclaw#30115, openclaw#14396, openclaw#19537, #1205, #1435, openclaw#26881, openclaw#32228, openclaw#35074, openclaw#26881)  -- these were present at v2026.4.14 and resolve correctly.
- delegate-dispatch.ts:62 (`openclaw#189.`) -- already in the canonical prefixed form per the issue's exception note.

Refs #199
azuretek added a commit to azuretek/nucleo that referenced this pull request Sep 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Sep 19, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Sep 22, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Sep 23, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Sep 23, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Sep 23, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Sep 23, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 8, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 8, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 8, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 8, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 8, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 9, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 9, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 10, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 10, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 10, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 11, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 11, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 17, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 17, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 17, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 17, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 18, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
azuretek added a commit to azuretek/nucleo that referenced this pull request Oct 20, 2026
A backgrounded exec that exits while its requester session is busy relied
on the idle heartbeat wake to surface its completion. That wake is skipped
as requests-in-flight whenever the session's command lane is non-empty and
retries every second without an attempt cap (see openclaw#14396, closed without
merge), so it never gets admitted and the completion starves for as long as
the session stays active.

Add an exec-completion steering queue that mirrors the subagent steering
path: every embedded run turn leases any pending exec completions for its
session and prepends them to the turn, so a busy session picks them up on
its next turn regardless of lane contention. The durable system event and
idle heartbeat wake remain the fallback for a fully idle session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

heartbeat: skip poll when session already busy

1 participant