Skip to content

fix(agents): skip A2A announce flow for isolated cron sessions_send#93826

Closed
LiLan0125 wants to merge 3 commits into
openclaw:mainfrom
LiLan0125:fix/92257-cron-sessions-send-a2a-skip
Closed

fix(agents): skip A2A announce flow for isolated cron sessions_send#93826
LiLan0125 wants to merge 3 commits into
openclaw:mainfrom
LiLan0125:fix/92257-cron-sessions-send-a2a-skip

Conversation

@LiLan0125

@LiLan0125 LiLan0125 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes from previous iteration

  • Removed skipCronA2AFlow from the skipA2AFlow gate
  • Added cronPingPongTurns variable: 0 for cron requesters, maxPingPongTurns for normal callers
  • The startA2AFlow callback now passes maxPingPongTurns: cronPingPongTurns

Verification

  • node scripts/run-vitest.mjs run src/agents/tools/sessions-send-tool.a2a.test.ts sessions-send-helpers.test.ts27/27 passed
  • Cron detection uses isCronRunSessionKey (canonical parsed classifier), correctly rejecting non-canonical :cron: keys

Impact Assessment

  • Scope: src/agents/tools/sessions-send-tool.ts — modifies maxPingPongTurns for cron requesters only
  • Target announce: preserved — the delivery status stays "pending" and the announce path runs normally
  • Requester feedback: suppressed — cron sessions get 0 ping-pong turns
  • Non-cron sessions: unaffected — cronPingPongTurns falls back to maxPingPongTurns

Real behavior proof

Behavior addressed: Narrowed fix that only suppresses the ping-pong requester feedback loop for isolated cron sessions_send, while preserving the target announce delivery path.

Environment tested: Node 22.x on Linux, vitest test suite.

Steps run after the patch: Ran sessions-send A2A and helpers test suites.

node scripts/run-vitest.mjs run src/agents/tools/sessions-send-tool.a2a.test.ts src/agents/tools/sessions-send-helpers.test.ts

Evidence after fix:

Test Files  2 passed (2)
     Tests  27 passed (27)

Observed result: All 27 tests pass. The cron ping-pong suppression is parameterized through maxPingPongTurns=0 rather than skipping the entire A2A flow.

Not tested: Live gateway with a cron job triggering sessions_send was not exercised.

Closes #92257

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

clawsweeper Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: current main still has the isolated-cron sessions_send A2A requester-injection bug, but the same remaining fix is now owned by a stronger open, mergeable sibling with baseline handling, regression tests, and sufficient runtime proof.

Root-cause cluster
Relationship: superseded
Canonical: #92283
Summary: This PR and the canonical sibling target the same isolated-cron sessions_send requester-injection bug; the sibling is the safer open landing path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Use #92283 as the single canonical fix, then close the linked bug after that PR lands.

So I’m closing this here and keeping the remaining discussion on #92283.

Review details

Best possible solution:

Use #92283 as the single canonical fix, then close the linked bug after that PR lands.

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

Yes, at source level. Current main passes positive A2A turns into a callee that can step the requester session, and the linked issue provides matching observed isolated-cron feedback-loop logs.

Is this the best way to solve the issue?

No. This branch is a plausible partial fix, but the sibling PR is the better landing path because it adds the missing baseline handling, targeted tests, and real runtime proof.

Security review:

Security review cleared: The diff changes in-repo agent control flow only and adds no dependency, workflow, secret, permission, package, or third-party code-execution surface.

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read: Read the root AGENTS.md and scoped src/agents plus src/agents/tools policies; their whole-path, proof, best-fix, and message-delivery risk guidance affected this review. (AGENTS.md:24, 190ca52882bf)
  • Current main still has the bug path: Current main captures no baseline for cross-session fire-and-forget sends and passes the configured maxPingPongTurns unchanged into runSessionsSendA2AFlow. (src/agents/tools/sessions-send-tool.ts:565, 190ca52882bf)
  • A2A callee explains the injection and stale-reply risk: The callee treats a latest target reply as new when no baseline fingerprint is present, then steps the requester first when maxPingPongTurns is positive and requester differs from target. (src/agents/tools/sessions-send-tool.a2a.ts:102, 190ca52882bf)
  • This PR is useful but narrower than the canonical sibling: The PR head adds the cron-run classifier and passes cronPingPongTurns into the A2A flow, but its baseline remains undefined for cross-session timeoutSeconds:0 isolated cron sends. (src/agents/tools/sessions-send-tool.ts:570, 4028568b50d6)
  • Canonical sibling covers the missing baseline path: The sibling PR gates on isCronRunSessionKey, captures a baseline for same-session or isolated-cron fire-and-forget sends, and passes zero turns only for isolated-cron requesters. (src/agents/tools/sessions-send-tool.ts:558, 426774aebed8)
  • Canonical sibling has focused regression coverage: The sibling adds tests for isolated-cron zero-turn delivery, normal requester preservation, non-canonical cron-like keys, and baseline-matching stale replies. (src/agents/tools/sessions.test.ts:1112, 426774aebed8)

Likely related people:

  • vincentkoc: Current blame and recent GitHub history point to recent sessions_send caller, A2A, and session-key maintenance in the affected area. (role: recent area contributor; confidence: high; commits: 0ea08076c3b5, 3659ff8bbf71, f1c0d5f06f96; files: src/agents/tools/sessions-send-tool.ts, src/agents/tools/sessions-send-tool.a2a.ts, src/sessions/session-key-utils.ts)
  • steipete: File history shows repeated earlier work on sessions_send wait helpers, A2A control replies, session helpers, and docs that shaped this behavior surface. (role: feature-history contributor; confidence: medium; commits: 041fab7b7275, 817e6e810b7d, 7b6334b0f41d; files: src/agents/tools/sessions-send-tool.ts, src/agents/tools/sessions-send-tool.a2a.ts, src/sessions/session-key-utils.ts)
  • harjothkhara: They authored the stronger open sibling PR for the same linked isolated-cron feedback-loop bug, including baseline handling, regression tests, and runtime proof. (role: canonical candidate fix owner; confidence: high; commits: 925c0099d1b4, 2cb4865ddd42, 426774aebed8; files: src/agents/tools/sessions-send-tool.ts, src/agents/tools/sessions-send-tool.a2a.test.ts, src/agents/tools/sessions.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 190ca52882bf.

@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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 17, 2026
@LiLan0125

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the detector to use the canonical parser instead of raw substring matching (per P1 finding). Added production-function verification showing the classifier correctly rejects non-canonical keys like while matching real cron run keys.

@clawsweeper

clawsweeper Bot commented Jun 17, 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 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 17, 2026
@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch from ec4a009 to bb0a8db Compare June 18, 2026 01:42
@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. labels Jun 18, 2026
@LiLan0125

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Narrowed the fix per review feedback: instead of skipping the entire A2A flow (which also suppressed target announce delivery), the fix now sets for isolated cron requesters. The target announce path still runs normally, but the requester ping-pong feedback loop is suppressed.

@clawsweeper

clawsweeper Bot commented Jun 19, 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.

@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch 4 times, most recently from 8039686 to 4b3194e Compare June 19, 2026 09:25
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label Jun 19, 2026
@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch 7 times, most recently from 008c2ad to a30c5df Compare June 19, 2026 14:23
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 20, 2026
@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch 2 times, most recently from 1eb9980 to c80e876 Compare June 20, 2026 05:22
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 20, 2026
@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch 2 times, most recently from 9e694e5 to c47723e Compare June 20, 2026 07:22
@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 20, 2026
@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch from c47723e to f8c3c92 Compare June 20, 2026 08:22
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label Jun 20, 2026
@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared June 20, 2026 08:31 Inactive
@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed mantis: telegram-visible-proof Mantis should capture Telegram visible proof. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 20, 2026
@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch from f8c3c92 to 492e6dd Compare June 20, 2026 09:23
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 20, 2026
@LiLan0125
LiLan0125 force-pushed the fix/92257-cron-sessions-send-a2a-skip branch from 492e6dd to a2948a3 Compare June 20, 2026 10:22
@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 20, 2026
Isolated cron sessions calling sessions_send had the target's
reply injected back into the cron run via the A2A ping-pong loop,
causing feedback loops and corrupted session state.

Skip the A2A flow when the requester session key contains the
:cron: marker, matching the pattern used by subagent-registry.

Closes openclaw#92257
Replace the raw :cron: substring check with isCronRunSessionKey,
which parses the canonical agent session key format and does not
match non-cron keys that happen to contain :cron: (e.g.
agent:main:slack:cron:job:run:uuid).

Refs openclaw#92257
…e announce

Per ClawSweeper review: skipping the entire A2A flow for isolated
cron sessions_send also suppressed target announce delivery. Narrow
the fix to only set maxPingPongTurns=0 for cron requesters, so the
target announce path still runs but the requester feedback loop is
prevented.

Refs openclaw#92257
@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

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

Labels

agents Agent runtime and tooling mantis: telegram-visible-proof Mantis should capture Telegram visible proof. 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. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: sessions_send with announce delivery injects Argus reply context into isolated cron session, causing agent feedback loop

1 participant