Skip to content

refactor: use channel target resolution APIs#85814

Merged
steipete merged 4 commits into
mainfrom
refactor/channel-target-resolution-api
May 23, 2026
Merged

refactor: use channel target resolution APIs#85814
steipete merged 4 commits into
mainfrom
refactor/channel-target-resolution-api

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Replace internal parser-style channel target routing with the modern messaging target resolver and outbound session-route APIs.
  • Deprecate the parser-family SDK APIs and the openclaw/plugin-sdk/messaging-targets subpath while keeping legacy compatibility quarantined in compat-only paths.
  • Move bundled channel callers and cron/heartbeat/agent delivery onto resolved targets/routes, with regression coverage for forum topics, provider prefixes, and empty provider-prefixed recipients.

Replaces #49704.

Verification

  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo
  • node scripts/run-vitest.mjs src/infra/outbound/agent-delivery.test.ts src/auto-reply/reply/group-id.test.ts
  • node scripts/run-vitest.mjs src/cron/isolated-agent/delivery-target.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/infra/outbound/agent-delivery.ts
  • pnpm check:changed via Testbox tbx_01ksb66sjerk0v891awe6js8z8, Actions run 26341965828
  • Autoreview clean: no accepted/actionable findings

Behavior addressed: Cron and agent delivery now resolve channel targets through the modern target/session-route APIs instead of leaking forum/parser-specific syntax through core.
Real environment tested: Local macOS checkout plus Blacksmith Testbox Linux changed gate.
Exact steps or command run after this patch: pnpm check:changed
Evidence after fix: Testbox tbx_01ksb66sjerk0v891awe6js8z8, Actions run 26341965828, exit 0.
Observed result after fix: Changed lanes passed for core, core tests, extensions, extension tests, docs, and tooling.
What was not tested: Live provider delivery against real external messaging services.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling channel: qa-channel Channel integration: qa-channel size: XL maintainer Maintainer-authored PR labels May 23, 2026
@clawsweeper

clawsweeper Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Latest ClawSweeper review: 2026-05-23 20:10 UTC / May 23, 2026, 4:10 PM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

PR Surface
Source +483, Tests +1153, Docs +8, Other +1. Total +1645 across 51 files.

View PR surface stats
Area Files Added Removed Net
Source 34 840 357 +483
Tests 12 1223 70 +1153
Docs 4 19 11 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 51 2083 438 +1645

Summary
The branch moves cron, heartbeat, gateway, agent delivery, bundled channel plugins, SDK docs, and compat metadata from parser-style target parsing to channel target resolver and outbound session-route APIs.

Reproducibility: no. Source inspection and the predecessor PR describe the parser-backed topic route failure, but this read-only review did not establish a live current-main Telegram cron reproduction.

PR rating
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Summary: The patch looks coherent and tested, but mock-only proof keeps the overall readiness low for a Telegram-visible delivery refactor.

Rank-up moves:

  • Add redacted live Telegram Desktop or bot-to-bot proof showing cron or agent delivery into a forum topic.
  • Confirm maintainer acceptance of the parser API and plugin-sdk/messaging-targets deprecation window.
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.

Real behavior proof
Needs real behavior proof before merge: The PR provides Testbox/Actions and focused tests but explicitly lacks live provider delivery proof; add redacted Telegram proof and update the PR body for re-review.

Mantis proof suggestion
A native Telegram proof would materially reduce the biggest merge risk around topic route delivery across the refactored path. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

telegram desktop proof: verify cron or agent delivery to a Telegram forum topic resolves the chat/topic route and does not deliver to the root chat.

Risk before merge

  • The PR deprecates public plugin SDK parser surfaces and the plugin-sdk/messaging-targets subpath, so maintainers need to accept the compatibility window and migration wording before merge.
  • Cron, heartbeat, gateway, and agent command delivery all start using target/session-route canonicalization; a subtle route mismatch could misdirect messages or lose topic/thread association across channels.
  • The PR body explicitly says live provider delivery was not tested, while the Telegram review standard asks for real Telegram proof for topic/transport changes.

Maintainer options:

  1. Prove live topic delivery first (recommended)
    Before merge, add redacted real Telegram proof that cron or agent delivery resolves a forum topic route and does not fall back to the root chat.
  2. Accept tests-only transport coverage
    Maintainers can intentionally merge with the current Testbox/unit coverage if they are comfortable owning any live-channel regressions found after landing.
  3. Pause for SDK deprecation approval
    If the parser API and subpath deprecation direction is not already approved, pause until maintainers confirm the compatibility window and migration wording.

Next step before merge
Human review should confirm the SDK deprecation direction and require redacted live Telegram topic delivery proof before merge.

Security
Cleared: No dependency, workflow, secret, or supply-chain changes were found; the remaining concerns are functional routing and compatibility risks.

Review details

Best possible solution:

Land only after maintainers accept the parser API deprecation plan and redacted live Telegram proof shows cron or agent delivery preserves the intended chat/topic route, with legacy compat quarantined and covered by tests.

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

No. Source inspection and the predecessor PR describe the parser-backed topic route failure, but this read-only review did not establish a live current-main Telegram cron reproduction.

Is this the best way to solve the issue?

Mostly yes, but not merge-complete yet. Moving delivery onto target/session-route APIs fits the ownership boundary, while the SDK deprecation and live transport behavior still need maintainer acceptance and proof.

Label changes:

  • add P2: This is a normal-priority channel delivery and SDK compatibility refactor with broad surface but no emergency evidence.
  • add merge-risk: 🚨 compatibility: The diff deprecates public plugin SDK parser helpers and a plugin-sdk subpath, which can affect third-party plugin authors during upgrade.
  • add merge-risk: 🚨 message-delivery: The refactor changes how cron, heartbeat, gateway, and agent delivery resolve channel targets and thread/topic routes.
  • add merge-risk: 🚨 session-state: The new path derives outbound session routes and thread IDs, so a mismatch could associate delivery with the wrong session or topic.

Label justifications:

  • P2: This is a normal-priority channel delivery and SDK compatibility refactor with broad surface but no emergency evidence.
  • merge-risk: 🚨 compatibility: The diff deprecates public plugin SDK parser helpers and a plugin-sdk subpath, which can affect third-party plugin authors during upgrade.
  • merge-risk: 🚨 message-delivery: The refactor changes how cron, heartbeat, gateway, and agent delivery resolve channel targets and thread/topic routes.
  • merge-risk: 🚨 session-state: The new path derives outbound session routes and thread IDs, so a mismatch could associate delivery with the wrong session or topic.
  • rating: 🦪 silver shellfish: Current PR rating is 🦪 silver shellfish because proof is 🦪 silver shellfish, patch quality is 🐚 platinum hermit, and The patch looks coherent and tested, but mock-only proof keeps the overall readiness low for a Telegram-visible delivery refactor.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides Testbox/Actions and focused tests but explicitly lacks live provider delivery proof; add redacted Telegram proof and update the PR body for re-review.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR touches Telegram topic delivery behavior that can be shown in a short Telegram Desktop proof.

Acceptance criteria:

  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo
  • node scripts/run-vitest.mjs src/infra/outbound/agent-delivery.test.ts src/auto-reply/reply/group-id.test.ts
  • node scripts/run-vitest.mjs src/cron/isolated-agent/delivery-target.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/infra/outbound/agent-delivery.ts
  • redacted live Telegram topic delivery proof

What I checked:

Likely related people:

  • steipete: Current-main blame on the central cron delivery, outbound session, and target parsing files points to Peter Steinberger's recent commit across this routing surface. (role: recent area contributor; confidence: medium; commits: f6ab188db0f3; files: src/cron/isolated-agent/delivery-target.ts, src/infra/outbound/targets-session.ts, src/infra/outbound/outbound-session.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 2656f13ff876.

@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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels May 23, 2026
@clawsweeper

clawsweeper Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels May 23, 2026
@steipete steipete merged commit c4f0da0 into main May 23, 2026
99 checks passed
@steipete steipete deleted the refactor/channel-target-resolution-api branch May 23, 2026 20:26
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* refactor: use channel target resolution apis

* refactor: satisfy delivery lint

* refactor: remove unused target parsing shim

* fix: preserve routed cron topic targets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord channel: qa-channel Channel integration: qa-channel channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. 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. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant