Repository navigation
Conversation
The isolated cron executor resolved the channel-native current-channel id only inside its embedded branch, so a CLI-backed run (Codex app-server and every other CLI provider) reached `runCliAgent` with `messageChannel` and `agentAccountId` but no recipient/thread. `buildCliMcpGrantContext` then minted a loopback grant without `currentChannelId`/`currentThreadTs`, and `createExecTool` built `notifyDeliveryContext` with an empty target — so a background exec completion carried no route and the later heartbeat relay fell back to the owner DM. Resolve the route once above the runtime branch and hand it to both runners; the CLI runner takes it as `currentChannelId` plus `currentThreadTs`, its vocabulary for the embedded `messageTo`/ `messageThreadId` pair. User impact: Telegram forum-topic (and any threaded-channel) automations on a CLI runtime keep background exec completions and message-tool sends in their originating topic instead of leaking topic-local operational output into the owner's DM. Fixes openclaw#138316
…gets `resolveCurrentChannelTarget` loaded the channel-plugin runtime for every targeted cron run, but only a thread needs channel-specific conversion (the one implementer returns the target unchanged without one). An unthreaded route now returns its target directly, so CLI-backed runs regain the direct path they had before the route was resolved above the runtime split.
The existing regression test stops at the executor-to-CLI parameters, so no proof covered the four production owners the route crosses afterwards. This drives the real loopback grant, gateway tool resolution, exec notify queue, and heartbeat delivery with a real background process and asserts the delayed completion is delivered to the originating forum topic. On the merge-base the same test fails at the delivery boundary: `expected '<owner-dm>' to be '<chat>:topic:47'`.
|
Codex review: needs real behavior proof before merge. What this changesThe PR passes the resolved channel recipient and normalized thread through shared CLI and embedded cron runner parameters. Example: An isolated CLI cron job targets Telegram account ops, chat -100123, topic 47.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: current main still omits CLI cron recipient/thread context, and the focused patch contains no discrete introduced bug. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe isolated cron executor converts resolved delivery settings into runner context; CLI grant construction forwards that context to tools, whose background completions enter the session-event delivery owner. flowchart TD
A[Cron delivery settings] --> B[Channel target normalization]
B --> C[Shared runner parameters]
C --> D[CLI tool grant]
C --> E[Embedded runner]
D --> F[Background exec completion]
F --> G[Session event delivery]
G --> H[Telegram transport]
Technical reviewBest possible solution: Retain the shared route-propagation repair and establish correct delivery plus final-effect rejection through the existing delivery owners. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the CLI recipient/thread omission and its grant/notification consumers; no runtime reproduction was performed during this read-only review. Is this the best way to solve the issue? Resolving context once before runtime branching fixes the producer omission while preserving plugin normalization; it does not establish the broader delayed-delivery authority guarantees. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8b677154aef0. Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Final-effect authorization for the newly propagated delayed-delivery route remains unverified. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +15, Tests +63. Total +78 across 4 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (22 earlier review cycles; latest 8 shown)
Reviewed October 10, 2026, 7:55 AM ET / 11:55 UTC (Revision 23). |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
# Conflicts: # src/agents/cli-runner/types.ts
|
@clawsweeper re-review The PR is now narrowed to CLI-backed cron topic-route propagation (four changed files); durable source fencing, queue recovery, and downgrade have moved to #162034. Exact head: 5325d6c. The PR body and title describe the reduced scope and evidence. Targeted tests 32/32 plus format/lint passed; PR context/evidence check rerun succeeded: https://github.com/openclaw/openclaw/actions/runs/36758598354. Independent diff review found no changed-code defects; no live Telegram Test Server send is claimed. The exact-head CI gate currently fails two tests outside the four changed files: server-runtime-subscriptions.shutdown.test.ts:110 (defaultCompleteModel 0/1) and update-cli.windows-lifecycle.test.ts (ExitError during SIGINT). Logs: https://github.com/openclaw/openclaw/actions/runs/36757849444. A failed-jobs rerun was attempted but GitHub returned HTTP 403 (repository admin rights required). A maintainer with rerun access: please rerun those failed jobs or advise on any reproducible branch-specific failure. No merge requested. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Follow-up to the exact-head P1 finding: c9d7673 restores channel-plugin normalization for unthreaded targets while keeping no-channel/no-address paths from loading the plugin. Added regression tests for both paths; 33/33 targeted tests, format/lint/diff checks passed. The final PR diff is three cron files and the body was updated. No durable source-generation or queue changes were reintroduced; #162034 retains that work. No live Telegram transport proof is claimed. Please review the current SHA, not prior 5325d6c. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please re-review exact head Relevance and scopeCurrent main still omits the resolved recipient/thread from CLI cron runner context. This PR remains a focused repair: four cron files, +87/-9 against integrated main Verified checks
Remaining proof and access blockerWe acknowledge the current review requirements: configured delayed CLI completion reaches its intended Telegram account/chat/topic; wrong account/chat/topic is rejected before transport; source replacement/revocation is rejected by final-delivery owners. Mocked grant assertions and scoped code review are NOT substitutes for that proof. No live Telegram Test Server result or complete authority-chain validation is claimed. The repository Telegram E2E doctor currently returns PROJECT_ACCESS for the QA credential-broker project through the existing authenticated CLI. No broker environment credential pair is configured. A broker project owner needs to grant access or provide the approved private credential path before this proof can be produced. No production Telegram fallback was used. Please assess the focused patch and the CI baseline evidence separately from the missing live-proof gates, and identify any concrete introduced defect or exact additional evidence required. We are not requesting a rating increase without evidence, nor claiming this PR is merge-ready. A maintainer disposition/rerun of the UI lane remains external. |
|
🦞👀 Re-review progress:
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Fixes #138316. Builds on #138406 and retains contributor ancestry. Related: #162034 (durable source authority, outside this PR).
What Problem This Solves
Fixes CLI-backed isolated cron completions losing their Telegram recipient/topic and falling back to the owner DM.
User Impact
CLI cron runs receive the selected account and conversation/thread context, matching the embedded runner. Unthreaded targets still use the channel plugin's normalization. No new configuration or storage changes.
Why This Change Was Made
Fresh main (
db6449d3f6091740dbddcf02fdc0e34dc94ca424, fetched October 10) still populated only channel/account for CLI runs; recipient resolution remained embedded-only. The shared runner parameters now carry the channel-native target and normalized thread into the CLI loopback grant.Integrated main to resolve actual merge conflicts after cron runtime refactoring, then incorporated the maintainer-owned Kysely migration-witness fix
db6449d3f6after exact-head CI exposed that inherited architecture failure. Kept upstream's lifecycle/admission changes and removed tests intact; the PR remains limited to two cron production files and two focused test files. Shared conversation-context assembly lives in the existing channel-output-policy module so the executor does not grow beyond the line-cap ratchet.This is route propagation, not durable source-generation fencing or final transport authorization. Revocation, queue/recovery migration, and downgrade compatibility remain in #162034.
Evidence
run.message-tool-policy.test.tsandchannel-output-policy.test.ts, including CLI grant recipient/topic/account and plugin normalization for unthreaded targets.b3f2743: production/test types and lint passed; architecture Kysely and UI e2e failed. The real checker replayed the same 14 Kysely violations on main'scdebsource tree; the owning upstream fix is now integrated. Kysely verification: passed on the final integrated candidate (Kysely guardrails OK).session-dashboard.e2e.test.tsCanvas pin click failures are inherited: the same cases and Details pointer-event interception occur in main CI 38038570610, at02a2bd2. UI source/config is byte-identical between that main baseline andcdeb. This cron PR does not change UI files or suppress these failures.881b26f8524cd15bbafecd9a78fa255c19ec2bed: 33 jobs succeeded, 2 failed, 28 skipped. Production types, test types (including all five core stripes), lint, architecture/Kysely, selected Node tests, security-fast, and baseline ratchets passed. The only product-job failure is UI E2E shard 1;openclaw/ci-gatefails because that selected lane failed. Its two failing Canvas pin tests have the same 30-second click timeout and Detailschat-gutter-stackpointer interception as the cited main baseline; current direct job logs were compared against baseline job 114174218095. Upstream UI changes sincecdebare not attributed to this four-file cron patch. No unrelated UI patch, failure suppression, or rerun-for-green was made.PROJECT_ACCESSfrom both existing Convex and offline npx launchers; bunx is unavailable and no private broker environment pair is configured. The QA broker owner must grant existing CLI/project access or supply the private broker pair before Test Server proof can run.uvis also unavailable on this host. No installation, login, credential publication, live production Telegram probe, or Gateway restart was attempted.No live Telegram Test Server delivery is claimed. Tests use mocked channel integrations and validate the real grant assembly; final Telegram transport effects and stale-authority rejection are not proven by this PR.
Current head:
881b26f8524cd15bbafecd9a78fa255c19ec2bed. No merge or default-branch push.