Skip to content

fix #91420: [Bug]: Delivery retry loop corrupts active sessions (R-004) β€” retry selector bypasses delivery.mode=none#91453

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-91420
Jun 13, 2026
Merged

fix #91420: [Bug]: Delivery retry loop corrupts active sessions (R-004) β€” retry selector bypasses delivery.mode=none#91453
vincentkoc merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-91420

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Narrows run-scoped sessions_send retry behavior instead of removing every durable retry path.
  • Blocks unsafe run-scoped active-run queue rejection reroutes: runtime_rejected, source reply delivery mode mismatch, compacting runs, and non-cron run-looking keys now surface the queue error on the original target.
  • Re-gates active queue delivery to run-scoped target keys so ordinary active session sends continue through the existing gateway agent path.
  • Preserves the Fix run-scoped sessions_send pingback fallbackΒ #86638 stranded cron pingback path by falling back only from a structurally valid cron run key to its durable cron parent when the active run is no longer steerable.
  • Keeps successful run-scoped active-run queue delivery intact, including the best-effort path when transcript commit waiting is unsupported.
  • Does not change public schema, config, provider routing, session visibility policy, or documented agent-to-agent reply-back behavior.

Linked context

Closes #91420

Related: #86638 shipped the stranded cron pingback fallback that this patch keeps, but now under a narrower session-key and queue-reason gate.

Was this requested by a maintainer or owner? No direct maintainer request; this follows the open bug report plus bot/review feedback asking for issue-specific proof and a safer retry design if #86638 remains part of the runtime contract.

Maintainer review notes

  • Fix classification: root-cause fix for the run-scoped active delivery boundary.
  • Maintainer-ready confidence: High; the diff is limited to sessions_send active-run retry routing plus focused regression coverage, and the runtime proof exercises the blocked unsafe path, the preserved safe cron fallback, and the ordinary active-session gateway path.
  • Root cause: the previous retry path treated active-run queue failure as permission to derive another session key and start a fresh agent run, so a failed run-scoped delivery could silently cross from active runtime state into a durable session.
  • Why this is root-cause fix: run-scoped delivery must respect the active queue as the state boundary; ordinary active session targets must keep using the gateway agent path, and only the Fix run-scoped sessions_send pingback fallbackΒ #86638 stranded cron case has a durable parent contract, so fallback is now gated by structural cron key parsing and safe queue reasons.
  • Why it matters / User impact: rejected retry delivery no longer risks duplicate relay messages, polluted durable sessions, or later provider/tool payload confusion, while ordinary active-session sends keep their existing gateway routing and cron pingbacks that were stranded because the active run is no longer streaming can still reach the durable cron parent.
  • What did NOT change: normal direct sessions_send, ordinary active-session gateway agent routing, successful run-scoped active-run queue delivery, transcript-commit best-effort retry, documented A2A reply-back behavior, channel delivery policy, session visibility, provider routing, schema, config, defaults, and migrations.
  • Architecture / source-of-truth check: the change stays inside sessions_send; it reuses parseAgentSessionKey() / isCronRunSessionKey() instead of restoring broad :run:<id> suffix stripping.
  • Related open PR / competition scan: daily-fix candidate checks found no linked open PR for [Bug]: Delivery retry loop corrupts active sessions (R-004) β€” retry selector bypasses delivery.mode=noneΒ #91420 before this branch was initialized, so this is not a same-contract competing PR.
  • Target test file: src/agents/openclaw-tools.sessions.test.ts; adjacent guardrails also run src/agents/embedded-agent-runner/runs.test.ts and src/agents/tools/sessions-send-tool.a2a.test.ts.
  • Scenario locked in: unsafe run-scoped active-run queue rejection returns an error for the original run-scoped session key without starting a durable agent call; safe stranded cron delivery falls back only to agent:leasing-ops:cron:monthly-utility; ordinary active session targets still use the gateway agent path and do not fail on source reply mode mismatch.
  • Why this is the smallest reliable guardrail: the regression covers the exact state transition that previously leaked across session boundaries, the existing Fix run-scoped sessions_send pingback fallbackΒ #86638 contract that should not be regressed, and the ordinary active-session compatibility path called out by ClawSweeper.
  • Patch quality notes: fallback is not a catch-all default or mitigation shim; it is allowed only for structurally valid cron run keys with not_streaming or no_active_run queue outcomes.
  • Risk labels considered: availability and message-delivery.
  • Risk explanation: the highest-risk area is message-delivery availability for callers that depended on broad durable-session reroutes after any active-run queue failure.
  • Why acceptable: unsafe delivery failures now fail explicitly, while the known stranded cron pingback path still has a durable parent retry route.
  • Maintainer tradeoff to accept before merge: this preserves the Fix run-scoped sessions_send pingback fallbackΒ #86638 stranded cron parent fallback, but rejects runtime rejection, delivery mode mismatch, compacting, and non-cron :run: keys instead of silently starting a new durable-session agent run.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: unsafe rejected run-scoped active-run sessions_send delivery no longer falls back through a durable session key, the Fix run-scoped sessions_send pingback fallbackΒ #86638 stranded cron run case still falls back to the durable cron parent, and ordinary active session targets remain gateway-routed instead of being steered through the active queue.

  • Real environment tested: local patched OpenClaw runtime with isolated OPENCLAW_HOME; the issue-specific proof invokes the production sessions_send tool against the active embedded-run queue registry.

  • Exact steps or command run after this patch:

    • Ran a focused TDD RED/GREEN regression for the ordinary active-session gateway path requested by ClawSweeper after the update-branch refresh.
    • Re-ran the full sessions tool regression file and adjacent embedded-run/A2A guardrails on the updated PR head.
    • Ran an isolated issue-path proof harness that registers production active embedded-run handles and invokes production sessions_send with timeoutSeconds: 0 for all three routing boundaries.
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):

    Copied console output from the isolated issue-path proof harness:

    {
      "proof": "issue-91420-safe-sessions-send-run-scoped-delivery",
      "invocation": "production sessions_send tool with active embedded-run queue registry",
      "scenarios": {
        "unsafeRuntimeRejected": {
          "status": "error",
          "sessionKey": "agent:leasing-ops:cron:monthly-utility:run:run-fast",
          "error": "queue_message_failed reason=runtime_rejected sessionId=caller-active-session gatewayHealth=live error=active session ended before queued steering message was committed",
          "queueMessageCalls": 1,
          "gatewayAgentFallbackCalls": 0,
          "assertions": {
            "explicitRuntimeRejectedError": true,
            "originalRunScopedSessionPreserved": true,
            "noDurableAgentFallback": true
          }
        },
        "safeStrandedCronFallback": {
          "status": "accepted",
          "runId": "durable-cron-parent-run",
          "reportedSessionKey": "agent:leasing-ops:cron:monthly-utility:run:run-fast",
          "durableCronParentKey": "agent:leasing-ops:cron:monthly-utility",
          "queueMessageCalls": 0,
          "gatewayAgentFallbackCalls": 1,
          "gatewayAgentSessionKeys": [
            "agent:leasing-ops:cron:monthly-utility"
          ],
          "assertions": {
            "acceptedThroughDurableCronParent": true,
            "originalRunScopedSessionReported": true,
            "onlyDurableCronParentUsed": true,
            "activeQueueNotInvokedAfterNotStreaming": true
          }
        },
        "ordinaryActiveGatewayPath": {
          "status": "accepted",
          "runId": "ordinary-agent-run",
          "reportedSessionKey": "agent:main:main",
          "queueMessageCalls": 0,
          "gatewayAgentCalls": 1,
          "gatewayAgentSessionKeys": [
            "agent:main:main"
          ],
          "assertions": {
            "acceptedThroughGatewayAgent": true,
            "ordinarySessionPreserved": true,
            "noActiveQueueDelivery": true,
            "onlyOrdinaryGatewayAgentUsed": true,
            "noSourceReplyModeMismatch": true
          }
        }
      },
      "assertions": {
        "unsafeRuntimeRejectedDoesNotFallback": true,
        "safeStrandedCronFallbackPreserved": true,
        "ordinaryActiveSessionsStayGatewayRouted": true
      }
    }
  • Observed result after fix: the unsafe runtime-rejected scenario returns status="error" with queue_message_failed reason=runtime_rejected and records gatewayAgentFallbackCalls=0; the safe stranded cron scenario returns status="accepted" and records exactly one gateway agent call to agent:leasing-ops:cron:monthly-utility; the ordinary active-session scenario returns status="accepted", records queueMessageCalls=0, and sends exactly one gateway agent call to agent:main:main.

  • What was not tested: the reporter's full macOS 16-agent fleet, external channel accounts, and the intermittent production corruption loop.

  • Proof limitations or environment constraints: the deterministic proof uses an in-process local runtime harness because the public gateway HTTP/RPC API does not expose a stable way to force active queue runtime_rejected or not_streaming on demand; it exercises the production sessions_send tool and active-run queue registry, but it is not a live reproduction of the reporter's full external fleet.

  • Before evidence (optional but encouraged): before the production change in this iteration, the new focused stranded-cron regression failed with AssertionError: expected 'error' to be 'accepted', proving the safe Fix run-scoped sessions_send pingback fallbackΒ #86638 fallback had not yet been restored.

Tests and validation

Commands run:

pnpm install --frozen-lockfile
node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-core.config.ts src/agents/openclaw-tools.sessions.test.ts -t "ordinary active session"
node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-core.config.ts src/agents/openclaw-tools.sessions.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/embedded-agent-runner/runs.test.ts src/agents/tools/sessions-send-tool.a2a.test.ts
OPENCLAW_HOME="$(mktemp -d)" TASK_WORKTREE="$PWD" pnpm exec tsx <issue-91420 runtime proof harness>

Regression coverage added or updated:

  • Kept the run-scoped runtime_rejected active delivery test requiring an explicit error and no durable agent call.
  • Added source reply delivery mode mismatch coverage requiring no fallback for run-scoped targets.
  • Added ordinary active-session coverage requiring gateway agent routing and no source reply mode mismatch failure.
  • Added stranded cron run coverage requiring fallback only to the durable cron parent.
  • Added non-cron run-looking key coverage requiring no suffix-stripping fallback.
  • Preserved coverage that successful run-scoped active-run queue delivery still avoids fallback agent runs.

What failed before this fix:

FAIL sessions_send keeps ordinary active session targets on the gateway agent path
AssertionError: expected 'error' to be 'accepted'

Earlier in this PR iteration, before restoring the safe #86638 cron fallback, the stranded-cron regression also failed with:

FAIL sessions_send falls back from stranded cron run key to durable cron parent
AssertionError: expected 'error' to be 'accepted'

Risk checklist

Did user-visible behavior change? (Yes/No) Yes β€” unsafe rejected run-scoped active delivery now reports an error instead of silently retrying through a durable session; ordinary active session targets keep the existing gateway agent path; safe stranded cron pingback fallback remains accepted.

Did config, environment, or migration behavior change? (Yes/No) No.

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No) Yes β€” tool execution routing is narrowed so failed active-run queue delivery cannot use a persistent session as an implicit relay except for the explicitly preserved durable cron parent path.

What is the highest-risk area? Existing workflows that depended on broad durable-session fallback for non-cron or runtime-rejected active-run sends will now see explicit send errors.

How is that risk mitigated? The change only affects rejected run-scoped active queue delivery; normal direct sessions_send, ordinary active-session gateway routing, successful run-scoped active-run queue delivery, transcript-commit best-effort delivery, documented A2A reply-back behavior, and the #86638 stranded cron fallback are covered by focused tests and runtime proof.

Current review state

What is the next action? Ready for CI and bot re-review after the update-branch refresh and round-two author fix.

What is still waiting on author, maintainer, CI, or external proof? CI and ClawSweeper need to consume this updated commit and PR body. External reporter-environment proof is not available from this local setup; the maintainer decision is whether this narrower retry contract correctly balances #91420's session boundary against #86638's stranded cron pingback fallback while preserving ordinary active-session gateway routing.

Which bot or reviewer comments were addressed?

  • RF-001: addressed by the round-two author fix below; the previous status: ⏳ waiting on author label was caused by the ordinary active-session compatibility finding, not by missing proof.
  • RF-002 / RF-003 / RF-005 / RF-006: addressed by re-gating active queue delivery to run-scoped target keys and adding a regression proving ordinary active session targets still use the gateway agent path without source reply delivery mode mismatch.
  • RF-004: disclosed as the intended compatibility tradeoff for rejected run-scoped sends; the broad durable-session reroute remains blocked, but ordinary active-session sends are no longer affected by that tradeoff.
  • RF-007: addressed by rerunning src/agents/openclaw-tools.sessions.test.ts on the updated PR head; result: 34 passed.
  • RF-008: addressed by rerunning src/agents/embedded-agent-runner/runs.test.ts and src/agents/tools/sessions-send-tool.a2a.test.ts on the updated PR head; result: 44 passed.
  • ClawSweeper/Codex review focus: the PR now includes maintainer-visible proof for the unsafe rejection path, the preserved safe cron fallback, and the ordinary active-session gateway path.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 8, 2026
@clawsweeper

clawsweeper Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 11, 2026, 5:56 AM ET / 09:56 UTC.

Summary
The branch narrows sessions_send timeoutSeconds=0 active-run retry routing, keeps cron-parent fallback only for safe queue outcomes, and adds focused sessions_send regression coverage.

PR surface: Source +31, Tests +185. Total +216 across 2 files.

Reproducibility: no. live current-main reproduction was run in this read-only review. The issue is source-reproducible from current main's broad fallback path plus the reporter attachment, and the PR adds focused before/after-style regression coverage for the routing boundary.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainers should explicitly accept the narrowed retry contract and verify the required CI state on the current head before merge.

Risk before merge

  • [P2] Existing workflows that depended on broad durable-session reroutes after rejected non-cron or runtime-rejected run-scoped sends will now receive explicit errors instead of accepted fallback runs.
  • [P2] The PR preserves the shipped cron-parent fallback from Fix run-scoped sessions_send pingback fallbackΒ #86638, so maintainers should explicitly accept that carve-out as the compatibility boundary.
  • [P1] This read-only review did not rerun tests; it relies on source inspection, PR-head diff, PR-body runtime proof, and the contributor's listed validation commands.

Maintainer options:

  1. Accept the narrowed retry contract (recommended)
    Merge after maintainers explicitly accept that unsafe run-scoped active queue failures should error while only stranded cron run keys may fall back to their durable parent.
  2. Rework before merge for broader compatibility
    If maintainers want more fallback compatibility, require the branch to preserve additional shipped fallback cases behind a clearly named, tested contract instead of the current cron-only carve-out.
  3. Pause if the cron carve-out is not agreed
    If the team cannot accept either the cron-only fallback or fail-closed behavior for unsafe active-run delivery, pause this PR and decide the permanent sessions_send retry policy first.

Next step before merge

  • [P2] The remaining action is maintainer acceptance of the retry compatibility boundary and normal merge validation, not an automated code repair.

Security
Cleared: The diff changes agent runtime routing and tests only; it does not add dependencies, CI, credentials, permissions, downloads, or package execution surfaces.

Review details

Best possible solution:

Land the narrow sessions_send routing fix after maintainers accept the compatibility tradeoff and CI is acceptable, then close the linked issue after merge.

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

No live current-main reproduction was run in this read-only review. The issue is source-reproducible from current main's broad fallback path plus the reporter attachment, and the PR adds focused before/after-style regression coverage for the routing boundary.

Is this the best way to solve the issue?

Yes, this appears to be the best fix shape: it stays inside sessions_send, replaces broad suffix stripping with existing session-key helpers, preserves the shipped cron fallback, and avoids adding config or removing documented A2A behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1e878dde7c3c.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied console output from an issue-path harness invoking production sessions_send against the active embedded-run queue registry and showing the unsafe error path, preserved cron fallback, and ordinary gateway path after the fix.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: πŸ‘€ ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied console output from an issue-path harness invoking production sessions_send against the active embedded-run queue registry and showing the unsafe error path, preserved cron fallback, and ordinary gateway path after the fix.
  • remove rating: 🌊 off-meta tidepool: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: The PR addresses a reported agent/session workflow regression that can duplicate messages, misroute delivery, and corrupt active session state.
  • merge-risk: 🚨 compatibility: The diff intentionally changes rejected run-scoped active delivery from broad durable-session fallback to explicit errors except for the cron-parent case.
  • merge-risk: 🚨 session-state: The changed boundary controls whether failed active-run delivery can cross into durable sessions and affect transcript/session state.
  • merge-risk: 🚨 message-delivery: The diff changes retry routing and failure behavior for sessions_send delivery, including when messages are delivered, rejected, or rerouted.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: πŸ‘€ ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied console output from an issue-path harness invoking production sessions_send against the active embedded-run queue registry and showing the unsafe error path, preserved cron fallback, and ordinary gateway path after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied console output from an issue-path harness invoking production sessions_send against the active embedded-run queue registry and showing the unsafe error path, preserved cron fallback, and ordinary gateway path after the fix.
Evidence reviewed

PR surface:

Source +31, Tests +185. Total +216 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 52 21 +31
Tests 1 233 48 +185
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 285 69 +216

What I checked:

  • Repository policy read and applied: Root AGENTS.md and scoped src/agents AGENTS.md files were read; the root policy treats fallback, auth/session state, and message delivery changes as compatibility-sensitive merge risks even with green CI. (AGENTS.md:18, 1e878dde7c3c)
  • Current main still has the broad fallback behavior: On current main, timeoutSeconds=0 enables active-run fallback, resolves any active embedded run session, strips a :run suffix with resolveRunScopedFallbackSessionKey, and starts a new gateway agent request on that fallback key after queue rejection. (src/agents/tools/sessions-send-tool.ts:225, 1e878dde7c3c)
  • PR narrows the fallback contract: At PR head, active queue delivery is gated to run-scoped agent keys, fallback is limited to structurally valid cron run keys, and fallback is allowed only for no_active_run or not_streaming queue outcomes; other queue failures surface as queue errors. (src/agents/tools/sessions-send-tool.ts:204, 78d6af555407)
  • Queue outcome contract supports the PR's reason gates: The embedded-run queue API returns closed failure reasons including no_active_run, not_streaming, compacting, source_reply_delivery_mode_mismatch, transcript_commit_wait_unsupported, and runtime_rejected, and formats them into queue_message_failed errors. (src/agents/embedded-agent-runner/runs.ts:57, 1e878dde7c3c)
  • Session-key helper contract supports cron-only parsing: parseAgentSessionKey canonicalizes agent session keys, and isCronRunSessionKey matches only cron::run: agent-rest shapes, which the PR reuses instead of raw suffix stripping. (src/sessions/session-key-utils.ts:232, 1e878dde7c3c)
  • PR regression coverage targets the changed boundary: The PR tests reject runtime_rejected and source_reply_delivery_mode_mismatch without durable fallback, keep ordinary active sessions on the gateway agent path, preserve stranded cron fallback, reject non-cron run-looking fallback, and keep successful active queue delivery. (src/agents/openclaw-tools.sessions.test.ts:1496, 78d6af555407)

Likely related people:

  • TurboTheTurtle: Authored the merged fallback PR that added run-scoped active fallback handling now being narrowed here. (role: introduced behavior; confidence: high; commits: 81e7e8ef24de; files: src/agents/tools/sessions-send-tool.ts, src/agents/openclaw-tools.sessions.test.ts)
  • Peter Steinberger: git log and shortlog show repeated sessions_send, session-tool context, provenance, and run-wait refactors on the central files. (role: heavy area contributor; confidence: medium; commits: 42d6e35cb45f, 85409e401b65, 3dda75894b80; files: src/agents/tools/sessions-send-tool.ts, src/agents/tools/sessions-send-tool.a2a.ts, src/agents/openclaw-tools.sessions.test.ts)
  • Vincent Koc: Current checkout blame attributes the existing fallback lines to recent main history and release/main maintenance commits in the same file history. (role: recent area contributor; confidence: medium; commits: 4afe616f224c, 5181e4f7c82b; files: src/agents/tools/sessions-send-tool.ts)
  • Tak Hoffman: History shows a focused sessions_send stale reply carryover fix adjacent to the duplicate/reply behavior involved in this report. (role: adjacent owner; confidence: medium; commits: 5b4669632a9d; files: src/agents/tools/sessions-send-tool.ts)
What the crustacean ranks mean
  • πŸ¦€ challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • πŸ¦ͺ silver shellfish: thin signal; proof, validation, or implementation needs work.
  • πŸ§‚ unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: πŸ¦ͺ silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 8, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: πŸ‘€ ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: πŸ¦ͺ silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: πŸ“£ needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 8, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 9, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: πŸ§‚ unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: πŸ‘€ ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 9, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 9, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: πŸ‘€ ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: πŸ§‚ unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 9, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 10, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 10, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 10, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: πŸ‘€ ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 10, 2026
@zhangguiping-xydt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: πŸ‘€ ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 13, 2026

@vincentkoc vincentkoc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blocking findings.

This is the right owner-boundary fix: sessions_send now uses the active-run queue only for run-scoped targets, keeps the existing stranded cron-run fallback for structurally valid cron run keys, and reports unsafe queue rejections instead of rerouting them through durable sessions. Ordinary active sessions stay gateway-routed.

Best-fix verdict: best. I checked the sessions_send owner path, the run-scoped key helpers, active-run delivery fallback behavior, and adjacent session-tool regression coverage. Removing all fallback would break the shipped cron pingback recovery path; moving this into the endpoint/session store would leave the retry selector bug in the tool path.

Verification:

  • git diff --check origin/main...HEAD
  • node_modules/.bin/oxfmt --check src/agents/openclaw-tools.sessions.test.ts src/agents/tools/sessions-send-tool.ts
  • node scripts/run-oxlint.mjs src/agents/openclaw-tools.sessions.test.ts src/agents/tools/sessions-send-tool.ts
  • autoreview: clean after rebase
  • Crabbox Azure cbx_737f52db0db0 / run run_ddbe1aea4671: node scripts/run-vitest.mjs src/agents/openclaw-tools.sessions.test.ts β€” 34 passed
  • GitHub CI on exact head cefa507ed4ee4d69b8be8d43ae7292f30b1cc7e9: green; transient Labeler 504 was rerun and passed

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

Labels

agents Agent runtime and tooling merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: πŸ‘€ ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Delivery retry loop corrupts active sessions (R-004) β€” retry selector bypasses delivery.mode=none

2 participants