Skip to content

Feature: diagnostics stuck-session recovery ladder (steer → nudge → abort) #86159

Description

@tagomago-me

Problem

Built-in diagnostics stuck-session recovery only supports abort-drain (abort_embedded_run) and release_lane after stuckSessionAbortMs. Before that threshold, stalled embedded runs log recovery=none / observe_only.

For production assistants, aborting a long tool-heavy turn is often the wrong first move. Operators want a configurable ladder:

  1. Steersessions.steer / interrupt active run with a recovery prompt
  2. Nudgesessions.send if still no user-visible progress
  3. Abortsessions.abort / abortAndDrainEmbeddedPiRun only as last resort

Today this requires a separate cron/heartbeat agent, which is fragile (model may ignore instructions, spam channels if misconfigured, etc.).

Proposed config

{
  diagnostics: {
    stuckSessionWarnMs: 120000,
    stuckSessionAbortMs: 720000,
  stuckSessionRecovery: {
      mode: "steer-then-nudge-then-abort", // | "abort" (current behavior)
      steerMessage: "…",  // optional template
      nudgeMessage: "…",
      recheckMs: 30000,
    }
  }
}

Expected behavior

  • On session.stalled / eligible stalled_agent_run, run steer first (same path as sessions.steer / chat abort+inject).
  • Re-check progress after recheckMs; if still stalled, sessions.send nudge.
  • Re-check again; if still stalled and age ≥ stuckSessionAbortMs, fall back to current abort-drain.
  • Emit structured diagnostic events: recovery.requested / recovery.completed with action: steer|nudge|abort.
  • Never deliver recovery messages to external channels unless the session itself would reply there.

Workaround in use

Cron heartbeat every 4m executing the ladder via openclaw gateway call sessions.steer|abort + sessions_send, with gateway abort at 12m as final fallback.

Environment

OpenClaw 2026.5.22, multi-agent gateway (Discord/Telegram), embedded Pi runs, lossless-claw context engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper-recovery-stuckclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions