Repository navigation
fix(cron): keep channel-only continuations in their originating thread - #138185
roboclaw-bot wants to merge 11 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
88d3334 to
7afb3ae
Compare
|
Codex review: needs changes before merge. What this changesThe PR captures the originating recipient, account, and thread for same-channel current-session automations and adds routing regressions and a Telegram QA scenario. Review scores
Merge readiness⛔ Needs changes before merge - 1 item remains The repair remains necessary: current main still skips origin capture for channel-only delivery. No blocking code defect remains, but the required Telegram Test Server evidence has not been produced. Priority: P1 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe Automations tool turns an agent's scheduling request and conversation context into a saved job. Later, the scheduler resolves that job's delivery route and sends its continuation through the selected channel. flowchart TD
A[Agent scheduling request] --> C[Automation creation]
B[Originating conversation route] --> C
C --> D{Same-channel current job?}
D -->|Yes| E[Capture originating destination]
D -->|Explicit retarget or isolated| F[Preserve requested routing]
E --> G[Saved job and scheduled delivery]
F --> G
Technical reviewBest possible solution: Keep origin capture in the existing creation owner, preserve explicit retargeting, and validate the saved route and visible continuation through Telegram's Test Server. Do we have a high-confidence way to reproduce the issue? Yes, from source: create a current-session agent-turn job with only the originating channel selected, then change the shared session's route before delivery. Main skips capture at creation; the linked issue records the resulting wrong-thread loopback send. This review did not execute target code. Is this the best way to solve the issue? Yes. Repairing destination capture at creation is narrower than adding dispatch fallbacks, and the matching predicate preserves deliberate retargeting and isolated-job behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 96ccec4a1385. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. 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:
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 (8 earlier review cycles)
Reviewed October 7, 2026, 9:53 AM ET / 13:53 UTC (Revision 9). |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Capturing the originating route only for current-session jobs when the explicitly selected channel still matches the source is a good boundary. A bare channel name is not a complete destination once the same session can span recipients/threads, but explicit recipient/account/thread choices must still override the captured origin. The cross-channel/account controls are therefore the important regressions here. I’d keep the rule entirely in creation, as this PR does, rather than adding a dispatch-time fallback that could reinterpret already-persisted jobs.
7afb3ae to
2647f4d
Compare
4e88c3f to
200df7e
Compare
69b6d94 to
80906bd
Compare
|
Rebased exact head Conflict repair scope:
Local validation:
GitHub exact-head CI/security checks are now running for |
* fix(cli): keep concurrent Gateway calls authenticated Read existing device identities and tokens without full database snapshots, and fail before connecting when identity storage is unavailable. Prepare all device-auth commands through the narrow worker adapter while retaining the existing actor and transaction/commit admission checks. * test(gateway): align authentication failure expectations * fix(gateway): preserve plugin registry in HTTP tool requests
Carry prepared caller/source authority and captured session lifecycle through cold-history restoration, and revalidate them before writes and commit. Preserve native SDK commit guards and reader/writer ordering. Reuse entry-reader preflight facts and isolate shared source predicates from write-owner imports. Denied or rebound requests leave cold history unchanged.
Run discovery-only subprocesses under CI scheduling so independent probes do not compare changing host resource limits. Preserve the complete inventory, ownership, lease, and worker-budget assertions. The original suite reproduced a one-worker versus two-worker mismatch. All 41 cases now pass with one Vitest worker in 136.26s wall time; the scheduled baseline took 22.85s. Changed checks and lint-suppression tests pass.
|
CI rerun classification for exact head
I do not see a cron-origin regression in this rerun. The remaining red CI appears to be the unrelated gateway owner-continuation/subagent restart failure family reproduced by the rerun. |
Inspect recorded qualification inputs once per CI preflight attempt and report stale entries in one advisory notice and job summary. Preserve runtime selection, fallback coverage, historical-target compatibility, and job outcomes. Add focused drift, deduplication, escaping, and non-blocking failure regressions.
Distinguish revoked or replaced publication receipts from malformed receipts at the database admission owner. Preserve the boolean transfer contract for settled callers and classify only the transient owner error for worker transcript replay. A real stale-receipt regression failed before the fix with terminal UNAVAILABLE and now completes with identical replay requests, one provider call, and two persisted messages. Malformed receipts remain terminal after one commit request. Schema and stored-data contracts are unchanged. Validation: 45 focused tests passed on refreshed main. The broader sibling run passed 206 tests, with two timing-sensitive startup-inspection fixture failures recorded separately; both passed on an unchanged standalone baseline. No assertions, retries, timeouts, skips, or suppressions were weakened.
…166236) * fix(worktrees): fence CLI listing with state ownership Use the existing read-only worker when another Gateway owns the selected state. Report missing-checkout retirement candidates without changing rows or sending an unfenced reconciliation RPC. Offline reconciliation holds the existing state owner and checkout mutation lease, then rereads the row and path before retirement. Preserve a checkout that reappears while listing waits for custody. * refactor(worktrees): move row guards and retirement to worker owner Use worker-backed exact-row predicates and snapshot retirement while retaining SQL-free generation guards through synchronous filesystem and Git effects. Serialize rebinding under the existing mutation lease and invalidate authority on row, owner-selection, and lease changes, including uncertain settlement. Join accepted removals and run-lease cleanup before closing worker transports. Fence native Doctor migration writes with existing maintenance ownership and route plugin runtime mutations through the existing local-state owner. Remove native runtime row facades and migrate all bundled consumers. Preserve the five lock and process-exit primitives, FIFO writes, and public SDK signatures. * test(worktrees): exercise recovery races through the owner * test(worktrees): align lease fixtures with worker ownership Exercise allocation loss through the real heartbeat worker and publish expiry through owner-bound test admissions. Preserve unknown-outcome causes, restore synthetic source repositories before releasing leases, and wait for child publication before HTTP assertions. Fix the Gateway test inventory order. * perf(gateway): skip worktree lookup for unbound sessions * perf(gateway): reuse admitted store for publication discovery
|
Current-main refresh for exact head
Exact-head GitHub CI/security checks are now running for |
|
|
Exact-head status update for
Could maintainers accept this clean/green exact head, or run the Telegram Test Server userbot proof through a trusted exact-SHA path for |
|
Current-main refresh note for this existing origin-capture repair, not a new implementation or proof claim. At A refresh needs to preserve the newer native owner behavior as well as this PR's explicit-target and matching-origin tests:
The old head's 80 successful checks are historical, not refreshed-base proof. The existing trusted exact-SHA Telegram evidence/disposition request in 6042212811 also remains unresolved; the review's conflicting proof-waiver/checklist wording is not a waiver. After a reviewed refresh, CI and the applicable channel-proof gate must be evaluated against the new head. No branch change, workflow dispatch or live-channel execution was performed for this source check. |
Closes #138181
What Problem This Solves
Fixes an issue where users asking an agent to continue later could receive the result in a different thread when the model specified only the current delivery channel and the source session was shared across conversations.
Why This Change Was Made
The automation creation owner treated a channel name alone as a complete explicit destination, suppressing capture of the originating recipient, account, and thread. Current-session jobs now capture that route when the selected channel matches the origin and no different account or recipient was requested.
Explicit recipients, different channels/accounts, channel=last, isolated jobs, and explicit thread overrides retain their existing behavior. No schema, configuration, Discord sender, or persistence format changes.
Production LOC: +8/-4 (net +4). Owner tests: +76/-0. Telegram QA scenario: +129/-0. The production growth expresses the same-channel/current-session/account ownership predicate in the existing creation path; it adds no fallback or parallel dispatch path.
User Impact
Channel-only current-session self-wakeups keep their originating delivery destination even if later activity changes a shared session's last route. The generic owner covers Discord, Telegram, Matrix, and other channel plugins.
This does not claim every reported new Discord thread has the same cause. Explicit forum-parent delivery and intentionally thread-bound child spawning remain valid separate behaviors. Already-persisted incomplete jobs are not migrated.
Evidence
Exact head:
200df7e283d5f2aa59b2dbb1a546739137638b7c.node scripts/run-vitest.mjs src/agents/tools/cron-tool.test.ts src/cron/delivery-context.test.ts— 212 tests passed.Codex contract checked directly at sibling Codex
f6805328c434eebb032bced0da29e39ba6dc3aee:codex-rs/protocol/src/dynamic_tools.rsowns host-provided dynamic tool schemas, andcodex-rs/core/src/tools/spec_plan.rsregisters those function/namespace tools. The repair changes OpenClaw tool execution after that host contract, not Codex protocol semantics.Provenance: introduction unknown; the defect was reproduced against current source. Repair owner:
src/agents/tools/cron-tool.ts; source context comes fromsrc/agents/openclaw-tools.tsandsrc/cron/delivery-context.ts; downstream resolution and dispatch are unchanged.View the OpenClaw team session