Commit Graph

877 Commits

Author SHA1 Message Date
Peter Steinberger 9f62c73893 fix(cron): verify delivery before clearing message warnings 2026-04-27 11:02:09 +01:00
Peter Steinberger d33eebd050 fix(cron): ignore delivered presentation warnings 2026-04-27 10:53:35 +01:00
Peter Steinberger 7d74c29dcc fix: isolate cron nested lane concurrency 2026-04-27 09:39:10 +01:00
Peter Steinberger 729147dcb5 fix(cron): start isolated timeout after execution begins 2026-04-27 08:15:59 +01:00
Peter Steinberger 37d37d3779 fix(cron): tolerate legacy flat schedule identity 2026-04-27 07:56:26 +01:00
Peter Steinberger 9ced682a9d fix(cron): omit disabled delivery trace errors 2026-04-27 07:50:50 +01:00
Peter Steinberger ddcd9d62c4 fix(cron): invalidate stale external schedule slots 2026-04-27 07:46:08 +01:00
Peter Steinberger 4bca42d933 fix(cron): alert on persistent skipped runs 2026-04-27 07:31:04 +01:00
Peter Steinberger 85148f3b20 refactor(cron): split notification routing 2026-04-27 06:44:53 +01:00
Peter Steinberger 332cdd7aca fix(cron): route failure alerts via target session 2026-04-27 06:34:38 +01:00
Peter Steinberger 382e03a2d8 fix(cron): fail isolated runs on run-level errors 2026-04-27 05:42:59 +01:00
Peter Steinberger b0c70786fd fix(cron): preserve structured denial failures 2026-04-27 04:34:38 +01:00
Peter Steinberger fc3abc139b fix(cron): classify denied isolated runs 2026-04-27 03:01:55 +01:00
Josh Lehman a3c51f91c5 fix: isolate cron context-engine session keys (#72292) 2026-04-26 14:21:01 -07:00
Josh Lehman 8ba82534e6 fix: preserve cron telegram topic delivery after timeout (#72317) 2026-04-26 13:30:54 -07:00
Peter Steinberger c5bbf83904 fix: skip unresolved delivery targets for no-deliver cron 2026-04-26 08:17:28 +01:00
Peter Steinberger 1fae716a04 fix: recover stale cron task records 2026-04-26 07:23:39 +01:00
likewen-tech 86328585fa fix(tasks): terminalize gateway agent run ledger
Terminalize Gateway-backed async task records from the run result while preserving aborted, failed, cancelled, and lost outcomes.\n\nThanks @likewen-tech.
2026-04-26 05:06:33 +01:00
Peter Steinberger 566d2d73a3 fix: keep system events from extending session resets (#71845) 2026-04-26 02:29:44 +01:00
Scott Glover 371b69b3e2 Expose cron jobId in plugin hook context 2026-04-26 02:06:48 +01:00
Vincent Koc 924271385b fix(cron): record interrupted startup runs
* fix(cron): record interrupted startup runs

* test(cron): update interrupted startup expectations
2026-04-25 04:28:11 -07:00
Vincent Koc e0546edd98 fix(cron): normalize flat legacy job rows 2026-04-25 03:29:30 -07:00
Vincent Koc 2896107153 fix(cron): tolerate malformed legacy jobs 2026-04-25 02:39:06 -07:00
Peter Steinberger 36eae5a2c7 fix: tighten silent cron exec notifications 2026-04-25 07:15:08 +01:00
Mark Goldenstein bd60df3e53 fix: silence cron exec completion noise 2026-04-25 07:15:08 +01:00
Peter Steinberger f2745aa03a refactor(cron): clarify ambient session context rollover 2026-04-25 06:37:18 +01:00
Peter Steinberger 576c6c240f fix(discord): collapse cron announce text 2026-04-25 06:22:30 +01:00
Vincent Koc f0ceb4b68f fix(cron): isolate fresh cron session state
* fix(cron): isolate fresh cron session state

* fix(cron): deep-copy isolated session state

* fix(cron): reset isolated session context

* test(providers): avoid shared mock races

* test(providers): type injected stream fakes

* ci: refresh package boundary on reply runtime changes

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-04-24 22:15:19 -07:00
Matt Van Horn b33eb93aac fix(cron): default missing sessionTarget on load and guard assertSupportedJobSpec (#70367)
* fix(cron): default missing sessionTarget on load and guard assertSupportedJobSpec

* fix(cron): use Object.hasOwn for payload.kind check and log the backfill

Address review feedback on #70367:
- Switch the new payload.kind lookup from `in` to `Object.hasOwn` so
  prototype pollution cannot drive the defaulter (Aisle Low finding).
- Log a warning when a job is auto-defaulted at load time, matching the
  adjacent legacyJobIdIssue pattern so operators can run `openclaw
  doctor --fix` to persist the canonical shape (Greptile P2).

* fix(cron): dedupe sessionTarget backfill warn per jobId and sharpen crash site reference

Address deep-review feedback on #70367:

- The code comment referenced assertSupportedJobSpec as the tick-time
  crash site, but that function is only called from create/patch
  (jobs.ts:607, 686) and manual-run preflight (ops.ts:516). The actual
  on-tick TypeError surfaces in runIsolatedAgentJob (server-cron.ts).
  Update the comment to say so.

- ensureLoaded runs with forceReload:true on every onTimer tick (~60s).
  Before this change, a persistent legacy job missing sessionTarget
  produced one warn line per tick, forever. Add a per-jobId dedupe set
  on CronServiceState (mirroring the existing warnedDisabled flag) so
  the warn fires once per job per process.

- Drop the 'run openclaw doctor --fix' remediation from the warn
  message. Doctor's cron-store migration has no trackIssue entry for
  missing sessionTarget (doctor-cron-store-migration.ts CronStoreIssueKey),
  so doctor --fix on a store whose only defect is missing sessionTarget
  silently returns without writing anything. Point operators at
  jobs.json directly until that gap is closed.

* docs(changelog): note cron session target repair

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-24 17:57:39 -07:00
Peter Steinberger 7ac35b4f69 perf: merge cron direct delivery tests 2026-04-24 06:54:36 +01:00
Peter Steinberger 1630607463 test: dedupe cron and channel fixtures 2026-04-23 18:29:32 +01:00
Mariano 3e956a4982 fix: align claude-cli prompt hooks (#70625)
Merged via squash.

Prepared head SHA: 3de89da38f
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-23 16:34:16 +02:00
Peter Steinberger 596b88986d chore: apply core lint cleanups 2026-04-23 05:30:49 +01:00
Peter Steinberger cb16d22780 fix(cron): retire bundled mcp runtimes 2026-04-22 22:30:47 +01:00
Peter Steinberger 80f4c931e8 test: align telegram cron test doubles 2026-04-22 06:19:20 +01:00
Peter Steinberger 40719bcb74 refactor: move cron output policy to channel plugins 2026-04-22 06:11:49 +01:00
Ayaan Zaidi 2da1406b29 test(cron): trim message trace comments 2026-04-22 08:12:20 +05:30
davehappyminion 9db67e79a5 fix(cron): narrow accountId spoof guard to explicit mismatch only
Addresses codex P1 review on PR #69940: the previous guard rejected
targets that simply omitted accountId, but message-tool fills accountId
from the agent's bound account at exec time (message-tool.ts:730-733),
so account-bound cron jobs legitimately start with target.accountId
undefined. Rejecting that case lost skipMessagingToolDelivery, causing
dispatchCronDelivery to double-send.

Now we only reject when the tool explicitly names a *different*
accountId — which is the real CWE-284 spoof vector. Omission matches.

Tests updated accordingly:
- matcher unit test: flipped "omit accountId" case from false to true;
  "accountIds differ" case preserved as the real spoof guard
- integration tests: one legitimate-default case (rewrite happens),
  one explicit-mismatch case (rewrite suppressed)

658 cron tests pass.
2026-04-22 08:12:20 +05:30
davehappyminion 851bef9c25 fix(cron): rewrite generic message provider in trace + guard accountId spoof
When a cron job sends via the generic `message` tool, the delivery trace
previously recorded `messageToolSentTo[i].channel = "message"` even
though the send was resolved to a specific channel (e.g. telegram). This
made `jq` diffing intended-vs-actual awkward for the happy path.

Fix:
- `normalizeMessagingToolTarget` now rewrites `channel: "message"`
  to the resolved channel when `matchesMessagingToolDeliveryTarget`
  confirms the tool send matches the resolved cron delivery target.
  Genuinely unmatched generic sends keep the literal "message" so
  audits can still flag them.

- `matchesMessagingToolDeliveryTarget` now requires strict accountId
  equality whenever the resolved delivery carries an `accountId`. An
  omitted `target.accountId` previously short-circuited the guard and
  was treated as a wildcard, letting a generic send spoof attribution to
  any bot identity in the cron delivery trace (CWE-284). This was
  flagged by Aisle on #69771.

Tests:
- Unit: `matchesMessagingToolDeliveryTarget` rejects omitted-accountId
  against account-tied delivery; still matches same-accountId.
- Integration: cron run trace rewrites generic "message" to the
  resolved channel, preserves accountId on both sides, and leaves the
  literal "message" provider in place when the tool send omits
  accountId against an account-tied delivery.
2026-04-22 08:12:20 +05:30
Peter Steinberger f1805ab54d fix: centralize provider thinking profiles 2026-04-21 09:13:35 +01:00
Ayaan Zaidi b9d2e0f86d fix(cron): gate delivery prompt on message tool availability 2026-04-21 12:01:06 +05:30
Ayaan Zaidi 5579fef673 fix(cron): align dry-run delivery previews with target policy 2026-04-21 12:01:06 +05:30
Ayaan Zaidi 0b25a73288 fix(cron): resolve delivery preview server-side 2026-04-21 12:01:06 +05:30
Ayaan Zaidi 4f0a978fc2 fix(cron): track implicit message sends 2026-04-21 12:01:06 +05:30
Ayaan Zaidi 9e160d5c0f fix(cron): make delivery previews dry-run safe 2026-04-21 12:01:06 +05:30
Ayaan Zaidi c18b6fc9da feat(cron): preview resolved delivery targets 2026-04-21 12:01:06 +05:30
Ayaan Zaidi 4c8299ca3d fix(cron): log delivery target trace 2026-04-21 12:01:06 +05:30
Ayaan Zaidi d083702a7b fix(cron): require verified message delivery target 2026-04-21 12:01:06 +05:30
Ayaan Zaidi 4c1f187da0 fix(cron): keep message tool for chat delivery 2026-04-21 12:01:06 +05:30
Peter Steinberger 6ce17db11a fix: gate max thinking by model support 2026-04-21 07:02:43 +01:00