Skip to content

fix(cron): preserve plugin delivery targets - #87929

Merged
steipete merged 2 commits into
openclaw:mainfrom
TurboTheTurtle:fix/cron-preserve-plugin-target-87905
May 30, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
TurboTheTurtle:fix/cron-preserve-plugin-target-87905

Conversation

@TurboTheTurtle

@TurboTheTurtle TurboTheTurtle commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve plugin-resolved cron announce targets instead of stripping a matching channel/provider prefix after target resolution.
  • Track whether a resolved messaging target came from a plugin, directory lookup, or generic normalized fallback.
  • Add regression coverage for a BNCR-style canonical target whose grammar intentionally starts with the selected channel prefix.

Fixes #87905

Root Cause

resolveDeliveryTarget() stripped the selected channel/provider prefix from every resolved target. That was correct for generic normalized fallback targets, but wrong after a plugin resolver had already returned a canonical target such as Bncr:tgBot:-1003891624016:6278285192.

Verification

  • node --import tsx ./openclaw-87905-proof-*.mjs (temporary local runtime proof script, removed after run)
  • node scripts/run-vitest.mjs src/cron/isolated-agent/delivery-target.test.ts
  • node scripts/run-vitest.mjs src/cron/isolated-agent/delivery-target.test.ts src/infra/outbound/target-resolver.test.ts src/infra/outbound/target-normalization.test.ts src/infra/outbound/outbound-session.test.ts src/infra/outbound/targets.test.ts src/infra/outbound/message-action-runner.poll.test.ts
  • node_modules/.bin/oxfmt --check --threads=1 src/cron/isolated-agent/delivery-target.test.ts src/cron/isolated-agent/delivery-target.ts src/infra/outbound/outbound-session.test.ts src/infra/outbound/target-id-resolution.ts src/infra/outbound/target-normalization.test.ts src/infra/outbound/target-normalization.ts src/infra/outbound/target-resolver.test.ts src/infra/outbound/target-resolver.ts
  • git diff --check

Real behavior proof

Behavior addressed: Cron announce delivery no longer strips a provider-looking prefix from a plugin-canonical resolved target.

Real environment tested: Local OpenClaw worktree on this branch with installed dependencies, using the actual resolveDeliveryTarget() cron delivery runtime path and a temporary local runtime channel plugin registered through the OpenClaw plugin registry.

Exact steps or command run after this patch: ran a temporary local proof script with node --import tsx, registering a bncr runtime channel plugin whose target resolver returns Bncr:tgBot:-1003891624016:6278285192, then calling resolveDeliveryTarget(..., { dryRun: true }) for channel=bncr and that target.

Evidence after fix:

{
  "command": "resolveDeliveryTarget dry-run with local runtime channel plugin",
  "issue": 87905,
  "input": {
    "channel": "bncr",
    "to": "Bncr:tgBot:-1003891624016:6278285192"
  },
  "result": {
    "ok": true,
    "channel": "bncr",
    "to": "Bncr:tgBot:-1003891624016:6278285192",
    "mode": "explicit"
  },
  "preservedCanonicalTarget": true
}

Observed result after fix: the resolved dry-run delivery target kept the full canonical Bncr: target, and preservedCanonicalTarget was true.

What was not tested: No live BNCR network send was performed; this verifies the host-side cron target resolution path that previously stripped the canonical target before outbound delivery.

Supplemental tests

  • The new regression preserves plugin-canonical targets that begin with the selected channel prefix covers the same target shape in the focused cron suite.
  • Focused suite result: Test Files 1 passed (1), Tests 50 passed (50).
  • Adjacent resolver/session suite result: Test Files 6 passed (6), Tests 188 passed (188).

Author attribution

If this PR is squash-merged or reworked, please preserve author attribution for Andy Ye <[email protected]> or include:
Co-authored-by: Andy Ye <[email protected]>

@openclaw-barnacle openclaw-barnacle Bot added size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 29, 2026
@clawsweeper

clawsweeper Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 29, 2026, 12:55 PM ET / 16:55 UTC.

Summary
The PR adds internal target-resolution provenance and uses it in cron delivery so plugin and directory resolved targets are preserved while generic normalized fallback targets still have provider prefixes stripped.

PR surface: Source +14, Tests +90. Total +104 across 8 files.

Reproducibility: yes. for a source-level reproduction: current main resolves the channel target and then unconditionally strips the selected provider prefix from the resolved target. I did not run a live BNCR transport repro in this read-only pass.

Review metrics: 1 noteworthy metric.

  • Resolved target provenance: 1 internal field added; 3 origins distinguished. Merge safety depends on separating plugin, directory, and generic normalized results before cron delivery strips any provider prefix.

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] Wait for current-head CI and focused cron/outbound checks to finish green before merge.

Risk before merge

  • [P1] This intentionally changes cron delivery post-processing: plugin-resolved provider-prefixed targetResolver outputs will now be sent unchanged instead of stripped.
  • [P1] The supplied proof verifies the host-side cron resolution path with a temporary runtime plugin, but it does not include a live BNCR network send.
  • [P1] Some current-head checks were still in progress in the check-run summary, so merge should wait for the latest relevant checks to finish.

Maintainer options:

  1. Land with compatibility-aware checks (recommended)
    If maintainers accept plugin-resolved targets as canonical, merge after focused cron/outbound checks and current-head CI confirm generic normalized fallback stripping still works.
  2. Pause for plugin-surface review
    If maintainers are concerned that existing plugins relied on core stripping targetResolver outputs, pause for plugin API owner review before merge.

Next step before merge

  • [P2] No repair lane is needed; the branch already contains the narrow code/test fix and the remaining action is maintainer validation and merge ownership.

Security
Cleared: The diff changes TypeScript runtime and test code only, with no dependency, workflow, script, secret, permission, or package metadata changes.

Review details

Best possible solution:

Land the provenance-based fix after current-head checks finish, preserving plugin and directory canonical targets while keeping generic normalized fallback prefix stripping.

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

Yes for a source-level reproduction: current main resolves the channel target and then unconditionally strips the selected provider prefix from the resolved target. I did not run a live BNCR transport repro in this read-only pass.

Is this the best way to solve the issue?

Yes. The PR uses a narrow internal provenance field so core strips only generic normalized fallback targets and preserves plugin or directory canonical results, matching the plugin-owned target-resolution boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 67faef01828d.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix copied live output from the actual resolveDeliveryTarget cron path using a temporary runtime channel plugin; this is sufficient for the host-side target-resolution bug.

Label justifications:

  • P1: The linked bug can make announce-mode cron jobs fail delivery and accumulate errors even when the job body succeeds.
  • merge-risk: 🚨 compatibility: The PR changes how existing plugin-resolved targets are post-processed during cron delivery.
  • merge-risk: 🚨 message-delivery: The affected path decides the final outbound target for cron announce delivery, so a wrong provenance distinction can fail or misroute sends.
  • 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 after-fix copied live output from the actual resolveDeliveryTarget cron path using a temporary runtime channel plugin; this is sufficient for the host-side target-resolution bug.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix copied live output from the actual resolveDeliveryTarget cron path using a temporary runtime channel plugin; this is sufficient for the host-side target-resolution bug.
Evidence reviewed

PR surface:

Source +14, Tests +90. Total +104 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 18 4 +14
Tests 4 90 0 +90
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 108 4 +104

What I checked:

Likely related people:

  • Peter Steinberger: Current blame for the cron delivery target resolution block points to 3d7df2b, and history shows repeated work across cron delivery and outbound target resolution. (role: recent area contributor; confidence: high; commits: 3d7df2bc0747, ccea3a0615e5, 6776306387cc; files: src/cron/isolated-agent/delivery-target.ts, src/infra/outbound/target-resolver.ts)
  • Vincent Koc: History shows recent performance and seam work around cron delivery runtime helpers and outbound target-id resolution. (role: recent refactor contributor; confidence: medium; commits: 28787985c4eb, 6eb04c8aabdb, 08ca24837809; files: src/cron/isolated-agent/delivery-target.ts, src/infra/outbound/target-id-resolution.ts, src/infra/outbound/target-normalization.ts)
  • Shakker: History shows Shakker split and narrowed cron delivery target runtime seams adjacent to this fix. (role: delivery runtime seam refactor contributor; confidence: medium; commits: 24edb82eced9, 1a23627e32b9, 883a35a38cd8; files: src/cron/isolated-agent/delivery-target.ts, src/cron/isolated-agent/delivery-target.runtime.ts)
  • Gustavo Madeira Santana: History shows outbound target display and resolution heuristics were moved behind plugin-owned seams in commits that define the contract this PR relies on. (role: outbound target-resolution contributor; confidence: medium; commits: 8467fb660142, e93412b5ce13; files: src/infra/outbound/target-resolver.ts, src/infra/outbound/target-normalization.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.

@openclaw-barnacle openclaw-barnacle Bot added triage: blank-template Candidate: PR template appears mostly untouched. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 29, 2026
@TurboTheTurtle
TurboTheTurtle force-pushed the fix/cron-preserve-plugin-target-87905 branch from 4d029c5 to f10ce03 Compare May 29, 2026 07:27
@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. 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 May 29, 2026
@TurboTheTurtle
TurboTheTurtle force-pushed the fix/cron-preserve-plugin-target-87905 branch from f10ce03 to 4f410f2 Compare May 29, 2026 08:10
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 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 May 29, 2026
@TurboTheTurtle
TurboTheTurtle force-pushed the fix/cron-preserve-plugin-target-87905 branch from 4f410f2 to 3a5b21c Compare May 29, 2026 16:50
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@steipete steipete self-assigned this May 30, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 30, 2026
@steipete

Copy link
Copy Markdown
Contributor

Verification before merge:

  • Local: node scripts/run-vitest.mjs src/cron/isolated-agent/delivery-target.test.ts -> 1 file passed, 53 tests passed.
  • Local: node_modules/.bin/oxfmt --check --threads=1 src/cron/isolated-agent/delivery-target.test.ts -> passed.
  • Local: git diff --check -> passed.
  • Auto review: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main -> clean, no accepted/actionable findings.
  • GitHub checks on head 6707396146d658317678bad203da8470b27ea7ba: 124 success, 20 skipped, 1 neutral, 0 failed, 0 pending.
  • Relevant workflow run ids observed: 26696142796, 26696142798, 26696142804, 26696142806, 26696142809, 26696143294, 26696143296, 26696143303, 26696143312, 26696143327, 26696148969, 26696148974, 26696148976.

Known proof gap: no live BNCR network send was performed; coverage and local proof exercise the host-side cron target resolution path that stripped the canonical target before outbound delivery.

@steipete steipete 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.

Approved after local focused cron proof, clean autoreview, and green GitHub checks on head 6707396.

@steipete
steipete merged commit 2442e9c into openclaw:main May 30, 2026
146 checks passed
@TurboTheTurtle
TurboTheTurtle deleted the fix/cron-preserve-plugin-target-87905 branch May 31, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. 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: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: blank-template Candidate: PR template appears mostly untouched.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cron announce delivery strips plugin-canonical provider prefix after target resolution

2 participants