Commit Graph

65 Commits

Author SHA1 Message Date
Peter Steinberger f6fff4f7fd refactor: canonicalize aliases and classify test suites (#122407)
* refactor: use canonical re-export names

* fix(test): classify suite support as test source

* fix(agents): retarget gateway stub session-entry import

* test(gateway): retarget session-utils mock keys after alias removal
2026-08-11 21:18:34 -07:00
joshavant acb61d365e fix(cron): preserve authority during validated updates 2026-08-11 04:47:10 -05:00
joshavant 9827ec2a94 fix(cron): preserve combined authority 2026-08-11 04:47:10 -05:00
Josh Avant 73a9eed95b refactor(audit): add canonical admitted-run context (#120534)
* feat(audit): carry canonical admitted execution context

* fix(agents): preserve admitted context across retries

* fix(worker): fence legacy launch dialect

* test(gateway): track approval temp dirs

* fix(plugin-sdk): preserve harness attempt compatibility

* fix: close delegated run authority at owner boundaries

* fix: internalize delegated authority validators

* refactor: split delegated authority proof surfaces

* refactor: centralize command admission identity

* test: claim runtime tool authority

* fix(gateway): keep lifecycle cleanup within static budgets

* fix(agents): revalidate harness policy authority

* fix(agents): fence awaited approval capability results

* test(copilot): supply required harness capability fixtures

* fix(agent): preserve scoped embedded run admission

* fix(agent): preserve keyless and worker authority

* test(agent): bind incomplete-turn authority

* docs: preserve execution authority invariants

* chore(plugin-sdk): regenerate API baseline

* fix(gateway): notify pending claim closure

* fix(gateway): revalidate delegated tool authority

* fix(plugin-sdk): keep source guard internal

* fix: close delegated authority races

* fix: revalidate delegated side effects

* fix: close harness authority projection gaps

* fix: align authority integration types

* fix: isolate settled harness finalization

* fix: fence recovery identity finalization

* fix: preserve committed session worktrees

* fix: preserve worker placement agent identity

* fix: fence active harness tool work

* fix(plugins): restore embedded run admission owner

* chore(plugin-sdk): compose integrated surface budgets

* fix(copilot): keep finalization attempt type internal

* fix(plugins): complete admission owner type imports

* test(harness): use settled finalization attempt shape

* fix(security): retain exact side-run and approval authority

* fix(security): preserve protected authority through terminal sweep

* fix(agents): follow moved recovery store owner

* fix(ci): align integrated authority owners with gates

* fix(plugins): distinguish embedded agent adapter export

* chore(plugin-sdk): regenerate API baseline after rolling integration

* refactor(gateway): keep session authority within owner budgets

* fix(gateway): keep session helpers private

* docs(plugin-sdk): name the V2 parameter subpath

* chore(integration): reconcile worker and SDK surfaces

* docs(plugin-sdk): require the V2 host API floor

* chore(plugin-sdk): regenerate after proxy-auth integration
2026-08-10 23:15:20 -05:00
Josh Avant a345ede685 fix(codex): preserve configured MCP tools in scheduled turns (#120366) 2026-08-08 19:25:39 -05:00
Peter Steinberger b4a26783f7 refactor(test): consolidate duplicated requireRecord and provider HTTP mock helpers (#119982)
* refactor(test): consolidate duplicated test helpers

* test: remove stale record guard import

* fix(test): remove orphaned record guards

* refactor(test): keep record requirement messages exhaustively typed

* fix(test): keep packages/ai record guard package-local
2026-08-06 14:48:01 -07:00
Peter Steinberger 57d8b1fc73 test(gateway): consolidate cron failure alert validation fixtures (#118539) 2026-08-02 23:42:20 -07:00
Peter Steinberger 181da6f69c fix(cron): reject ambiguous multi-channel announce jobs (#118272)
* fix(cron): reject ambiguous announce delivery (#118236)

* test(cron): move implicit announce ambiguity coverage to the service owner
2026-08-02 16:25:30 -07:00
Peter Steinberger 0745a7e012 fix(cron): failure alerts reject valid routes and lose account ownership (#117765)
* fix(cron): unify failure alert routing and account ownership

* fix(cron): preserve alert ownership across provider aliases
2026-08-01 21:26:48 -07:00
Masato Hoshino a7b4a47356 fix(cron): reject disabled delivery accounts when scheduling (#116899)
Scheduling an automation against a channel account the operator has turned
off succeeded. The job was stored and scheduled against a route its owner had
already disabled, and nothing reported that until it fired.

`assertValidCronFailureAlert` in this file already applies the rule to the
channel on the same route: an explicit unknown channel must not be "stored and
only fails later as `channel_not_found`". The account had no equivalent check.

Reject a `delivery.accountId` whose `accounts.<id>.enabled` is `false`, beside
the existing channel checks.

The check is scoped to that account entry and nothing else, because the wider
signals all have false positives here:

- Cron delivery ids are not always operator-typed - `delivery-context.ts`
  copies the current context account into inferred jobs.
- Channel `isEnabled` adapters report unlisted or credential-suppressed
  accounts as not enabled (twitch resolves any unlisted id to `enabled: false`).
- A top-level `channels.<id>.enabled: false` is not uniformly channel-wide -
  twitch resolves named accounts from `accounts` alone.

Only the account entry itself is an unambiguous statement about this route, so
only that blocks a mutation. No channel plugin is resolved on this path.

Both cron mutation paths share this validator and the update caller is already
gated on `"delivery" in patch`, so edits that do not touch routing stay
unblocked by an id stored before this validation existed.
`cron-error-classification.ts` learns the field name so the precondition
recheck inside `updateWithPrecondition` still classifies it as
`INVALID_REQUEST`.

`delivery.failureDestination.accountId` is intentionally out of scope: its
effective route layers over the global failure-destination config, so it needs
route resolution before validation rather than a raw check on the partial
override.
2026-08-01 08:57:35 +08:00
Peter Steinberger 383363e362 fix(cron): preserve lazy ownership and bounded notification lifetimes (#117018)
* fix(cron): preserve lazy ownership and bound notification lifetimes

* fix(cron): respect fs-safe policy boundary

---------

Co-authored-by: Peter Steinberger <steipete@macos.shared>
2026-07-31 14:38:21 -07:00
Omar Shahine b82a59a798 feat(cli): add openclaw automations alias and reword cron display prose (#114854)
* feat(cli): add openclaw automations alias and reword cron display prose

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WhJ8EiMXue6ADLmHfb7FL6

* test(doctor): update cron doctor prose assertions for automations wording

* fix(plugins): include command aliases in plugin CLI collision detection

Codex review finding on the automations alias: plugin CLI registration
seeded existingCommands from command names only, so a plugin exposing a
top-level command matching an alias-only root name (automations, terminal,
chat) would crash Commander at startup instead of being skipped. Seed from
names plus aliases; regression test covers the alias path.

* fix(cli): rename residual cron prose in CLI and gateway RPC errors

Found in combined dev-gateway E2E: automation not found / unknown automation
id errors, add/edit prose, docs tip, skills-cli mention, and the gateway RPC
not-found message. The CLI missing-get matcher accepts both message forms so
older gateways keep resolving name lookups.

* fix(gateway): keep cron.get missing wording as a wire contract for older CLI matchers

ClawSweeper rank-up: shipped CLI matchers parse 'cron job not found: <id>'
before the name-lookup fallback; the rename stays CLI-display only. Adds a
regression pinning the exact wire form.

* fix(cli): rename doctor and task-summary cron prose flagged in review

Repair-plan advisories, session-registry task summary, and the heartbeat
migration health check now say automations; recreate hints use the
openclaw automations CLI form.

---------

Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-30 07:16:57 -07:00
Peter Steinberger af0a1c0dfe fix(cron): bound alerts and complete heartbeat cleanup (#114920)
* fix(cron): bound failure notification delivery

* fix(cron): isolate heartbeat monitor cleanup failures

* perf(cron): read one job for scoped run history

* fix(cron): reject alert deadlines with explicit errors

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-28 00:37:28 -04:00
nocodet888-arch 4c126fd844 fix(gateway): trim cron job ids before exact lookup (#110849)
* fix(gateway): trim cron job ids before exact lookup

* test(gateway): cover padded legacy cron update ids

Co-authored-by: NIO <0668000903@xydigit.com>

* fix(gateway): preserve blank cron run selector scope

Co-authored-by: NIO <0668000903@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-27 12:38:57 -04:00
joshavant 30ef341c54 fix(cron): preserve scheduled self-management 2026-07-24 01:24:03 -05:00
joshavant 90b53ec2d9 fix(cron): bind scheduled authority to creator session 2026-07-24 01:24:03 -05:00
joshavant bd559a98ed fix(cron): migrate scheduled authority provenance 2026-07-24 01:24:03 -05:00
joshavant f24361a32a fix(cron): scope declarations by owner account 2026-07-24 01:24:03 -05:00
joshavant 5d21ba0a2a fix(cron): bind scheduled authority to creator accounts 2026-07-24 01:24:03 -05:00
Peter Steinberger 6f29fc88e9 refactor(sessions): migrate pure readers to read-only session accessors (#112568)
* refactor(sessions): migrate pure readers to read-only session accessors

* test(sessions): teach mocks and declarations the read-only accessors

* test(sessions): align remaining harnesses with read-only accessors
2026-07-22 01:16:35 -07:00
Josh Avant 3acc168c4f fix(cron): persist explicit scheduled tool authority (#112483)
* fix(cron): persist explicit scheduled tool authority

* test(cron): cover explicit scheduled authority

* fix(cron): preserve legacy authority on routine edits

* test(cron): add explicit authority e2e matrix

* test(cron): harden explicit authority live proof
2026-07-22 02:28:49 -05:00
Nikhil Patel 13716ad4f4 fix(cron): validate failureAlert channel at the gateway boundary (#103866)
* fix(cron): validate failureAlert channel at the gateway boundary

`--failure-alert-channel` writes patch.failureAlert.channel, a field distinct from
delivery (own store columns, own delivery path in service/failure-alerts.ts). The
gateway validator only ran channel checks for delivery patches, so a
failure-alert-only patch stored an unknown channel unvalidated and only failed
later at delivery time with channel_not_found.

Add assertValidCronFailureAlert (reusing the announce-channel validation), wired
into create + update. It mirrors resolveFailureAlert() runtime resolution:
resolves the effective mode (job or global cron failure-alert mode; webhook alerts
skip channel-type validation), inherits the job delivery channel/target when the
alert names none (rejecting a routing-changing edit that would activate a
legacy-invalid inherited channel, while unrelated/threshold edits and already-
active alerts are not blocked), resolves a provider-prefixed target like the
delivery/failureDestination paths, and honors the channel:null last-fallback. Maps
failureAlert.channel errors to INVALID_REQUEST. Regression tests included.

Closes #103864

* fix(cron): align failure alert route validation

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-21 22:24:41 -07:00
Peter Steinberger 68771ebdfe feat(cron): script payloads behind the trigger gate (#111112)
Run script payloads through the shared headless code-mode executor with payload-grade budgets and success-only trigger.state persistence.

Reuse cron delivery, wake, pacing, and dangerous trigger-gate contracts for notify, wake, and nextCheck results.
2026-07-18 19:24:12 -07:00
zhanxingxin1998 4bc84db398 fix(cron): allow clearing failure alert routing fields (#108578)
* fix(cron): clear failure alert routing fields

Send explicit nulls for cleared Control UI failure-alert overrides and accept those clears only in cron update patches.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* test(cron): satisfy serialized alert patch types

Narrow the serialized failure-alert fixture before asserting its cleared fields.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix(cron): clear failure alert overrides

Co-authored-by: 詹幸心0668001037 <zhan.xingxin@xydigit.com>

---------

Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-16 02:52:19 -07:00
ToToKr 29475988da fix(cron): keep valid command env vars when a sibling value is non-string (#105433) (#106100)
* fix(cron): keep valid command env vars when a sibling value is non-string (#105433)

normalizeTrimmedStringRecord returned undefined whenever any env value was non-string, so payload normalization deleted the entire env map before gateway schema validation, silently dropping valid siblings (e.g. env {DEBUG:true, PATH:'/bin'} lost PATH). It now filters invalid entries and only normalizes the map away when no valid entries remain, matching the sibling normalizeTrimmedStringArray behavior in the same file.

* fix(cron): reject malformed command env maps

Co-authored-by: MoerAI <friendnt@g.skku.edu>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-15 23:20:24 -07:00
Peter Steinberger f81f9d8570 chore: enforce max-lines suppression ratchet (#107315)
* ci: enforce max-lines suppression ratchet

* chore: prune stale max-lines suppression

* fix: close max-lines ratchet enforcement gaps

* fix: harden max-lines ratchet checks

* fix(ci): satisfy max-lines ratchet checks

* style: format max-lines declarations

* fix(ci): match oxlint suppression grammar

* test: isolate max-lines git fixtures

* chore: prune resolved max-lines debt

* test: skip newline path fixture on Windows

* fix: harden max-lines suppression ratchet

* chore: refresh max-lines baseline

* fix: close max-lines ratchet bypasses

* fix: derive ratchet base from PR merge tree

* fix: support older Git in staged ratchet

* fix: align max-lines declarations and baseline

* chore: refresh max-lines baseline for current main

* fix: exclude generated wizard locales from max-lines

* chore: prune resolved max-lines debt
2026-07-14 09:27:02 -07:00
zengLingbiao 692cb8dd9b fix(cron): reject non-string values in delivery target validation (#106952)
* fix(cron): reject non-string values in delivery target validation

assertNonBlankStringField had inverted logic — non-string values
(number, boolean, object) were silently accepted because typeof !== 'string'
was grouped with the undefined/null early return. The function name says
'assert non-blank string field' but it was bypassing validation for any
non-string type, defeating the purpose of input validation.

* test(cron): cover invalid delivery fields at entrypoints

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-13 21:48:15 -07:00
Peter Steinberger 334e7f3f21 feat(apps): add native mobile Automations parity (#106355)
* fix(apps): address native Skills review feedback

* feat(apps): add native Automations parity

* fix(ios): preserve automation editor selection

* fix(android): page automation discovery

* chore(apps): refresh native source inventory

* fix(ios): refresh invalid automation diagnostics

* chore(apps): sync native localization

* fix(cron): stabilize paginated snapshots

* refactor(cron): split pagination helpers

* fix(apps): address final native review feedback

* chore(apps): refresh native source inventory

* fix(ios): dedupe automation list actions

* chore: keep release note in PR context

* fix(ci): repair current main architecture gates

* fix(ios): default new skill requirement fields

* fix(ios): retain queued automation reservations
2026-07-13 15:35:32 -07:00
Pavan Kumar Gondhi 0d177c9b4d fix: keep command cron jobs operator-scoped [AI] (#106057)
* fix: scope agent cron command access

* test: avoid secret-like cron fixture text
2026-07-13 14:08:04 +05:30
Peter Steinberger 1b313dc4d4 chore(tooling): enforce indexed access in core tests (#105375)
* test(tooling): enforce indexed access in core tests

* test(tui): constrain theme environment overrides

* test(doctor): enforce indexed access in migration fixtures
2026-07-12 14:29:52 +01:00
Peter Steinberger f94a7dc183 feat(codex): supervise native Codex sessions (#104045)
* feat(codex): add native session supervision

* fix(codex): harden supervision integration

* fix(codex): preserve locked harness ownership

* fix(codex): fence native session archive

* fix(codex): revalidate archive binding ownership

* feat(codex): integrate supervision runtime

* feat(sessions): preserve harness-owned execution

* feat(sessions): persist harness ownership invariants

* feat(gateway): enforce harness-owned sessions

* feat(setup): enable detected Codex supervision

* feat(mac): expose supervised Codex sessions

* feat(ui): make Codex sessions actionable

* docs(codex): document session supervision

* test(codex): cover integration ownership

* chore(i18n): refresh supervision inventories

* fix(setup): finalize Codex activation atomically

* test(codex): narrow binding store update

* fix(sessions): preserve legacy model locks

* test(macos): serialize Codex catalog fixtures

* fix(sessions): preserve legacy lock admission

* chore(i18n): reconcile supervision metadata

* test(sessions): mark legacy lock fixture

* fix(macos): drain final Codex catalog frame

* docs: leave supervision note to release

* style(macos): satisfy Codex catalog type length

* chore: record session accessor seam owners

* fix(macos): honor configured Codex supervision

* fix(codex): preserve harness-owned model locks

* fix(codex): satisfy supervision lint gates

* chore(i18n): refresh native supervision inventory

* fix(codex): align supervision validation contracts

* fix(codex): close supervision boundary gaps

* fix(codex): preserve supervision activation contracts

* fix(codex): dispose standalone supervision runtime

* fix(codex): pin supervised source connection

* fix(plugins): bind delegated runs to exact session target

* fix(codex): scope supervised sessions to configured agents

* fix(codex): fingerprint effective supervision home

* fix(codex): normalize supervision plugin policy

* fix(codex): keep supervised bindings stable across upgrades

* fix(codex): guard all supervised binding connections

* fix(codex): preserve catalog filters and pending CAS identity

* fix(codex): preserve supervision identity for diagnostics

* fix(codex): bind uncertain commits to supervision connection

* fix(codex): satisfy supervision type boundaries

* fix(macos): reconcile current main validation

* fix(codex): handle absent runtime config in supervision

* fix(doctor): own local audio acceleration check

* fix(codex): satisfy integration lint gates

* fix(codex): satisfy lifecycle safety guards
2026-07-11 00:12:08 -07:00
Peter Steinberger 1696366f88 feat(android): add safe cron job management (#102997)
* feat(android): add safe cron job management

Co-authored-by: snowzlmbot <293528334+snowzlmbot@users.noreply.github.com>

* fix(android): harden cron editor state

* fix(android): preserve cron state across lifecycle

* fix(android): satisfy cron release gates

* fix(android): retain cron drafts outside saved state

* fix(android): scope cron auto-delete to one-shot jobs

* fix(android): use Compose activity owner

* docs(changelog): note Android cron management

* fix(cron): harden Android job management

* chore(i18n): refresh Android cron inventory

* test(cron): cover enriched read views

* chore(changelog): defer Android cron note to release

---------

Co-authored-by: snowzlmbot <293528334+snowzlmbot@users.noreply.github.com>
2026-07-10 04:12:18 +01:00
Peter Steinberger fdc9aa82d7 feat(cron): declarative jobs with owner attribution and richer status (#100480)
Adds scope-local declaration-key convergence, immutable owner attribution, richer status projection, and delivery validation to canonical cron jobs.

Supersedes the #98727 routines registry approach; no parallel registry, RPC namespace, or CLI noun.
2026-07-06 03:35:26 +01:00
Agustin Rivera 4aa07513fe fix(cron): scope agent wake targets (#97949)
* fix(cron): scope agent wake targets

* fix(cron): refresh prompt snapshots
2026-06-29 17:43:43 -07:00
Josh Avant cee2aca409 Scope agent cron operations to the calling agent (#96883)
* Scope agent cron operations to caller

* Scope OpenClaw tools MCP cron by session

* Address cron scope review feedback

* Preserve unscoped cron update retargeting

* Move cron caller identity into gateway context

* Clarify Gateway restart guidance

* Add cron caller identity regression proof
2026-06-26 21:41:14 -05:00
Vincent Koc a641c0d560 fix(channels): keep ownerless config visible but undeliverable 2026-06-22 19:12:05 +08:00
ly-wang19 ca5c3e677a fix(cron): clear delivery routing fields from cron edit (#93495)
* fix(cron): clear delivery routing fields from cron edit

cron edit could set delivery channel/to/thread-id/account but could not unset them: an empty value (e.g. --to "") builds delivery.X = undefined, which is omitted from the JSON-RPC patch, so mergeCronDelivery never sees the key and the field is silently kept. The gateway RPC already accepts an explicit null to clear each field (CronDeliveryPatchSchema + mergeCronDelivery via normalizeOptionalString); the CLI just never sent it.

Add --clear-channel/--clear-to/--clear-thread-id/--clear-account, each emitting null (mirroring the existing --clear-model), with mutual-exclusion guards against the matching set flag and against --webhook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(cron): preserve delivery defaults when clearing routes

* fix(cron): validate cleared prefixed routes

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Vincent Koc <25068+vincentkoc@users.noreply.github.com>
2026-06-16 13:24:33 +08:00
anagnorisis2peripeteia f1f00cbf1d fix: capture cron wake origin session
Capture the originating sessionKey and agentId for cron wake tool calls so non-main session and multi-agent wakes return to the conversation lane that requested them.

Carry stored delivery context through queued wake events so topic/thread replies route correctly, while preserving the default no-origin wake behavior and explicit target:none opt-out.

Refs #46886.
Refs #64556.
Thanks @anagnorisis2peripeteia.

Co-authored-by: Cameron Beeley <cameron.beeley@gmail.com>
2026-06-10 20:52:40 +01:00
Peter Steinberger a84910be91 docs: document gateway diagnostics methods 2026-06-04 18:18:51 -04:00
兰之 2664f59519 fix(cron): reject blank delivery targets
Reject whitespace-only cron delivery target strings before cron input normalization can trim and drop them, so bad delivery targets return INVALID_REQUEST instead of behaving as omitted fields.

Keep explicit null update clears for delivery, failure destination, and completion destination fields.

Co-authored-by: gaozixiang1 <gaozixiang1@xiaomi.com>
Co-authored-by: Lanzhi <lizhan3@xiaomi.com>
2026-06-02 06:10:19 -04:00
Vincent Koc 793ab78ebb refactor: share cron validation test helpers 2026-06-02 04:08:21 +02:00
Vincent Koc abe2145153 refactor: share cron delivery test fixture 2026-06-01 06:52:52 +02:00
Peter Steinberger 45b5f876dd fix: reject blank cron payloads 2026-05-31 23:20:04 -04:00
Peter Steinberger d86b6da012 fix: allow cron delivery clears 2026-05-31 22:04:25 -04:00
Peter Steinberger 72bc9ae952 fix: keep cron update delivery validation scoped 2026-05-31 21:32:23 -04:00
Peter Steinberger d2f1c0eac8 fix: harden cron validation and restart state 2026-05-31 21:32:23 -04:00
Vincent Koc b029634bd6 refactor: share cron validation test helpers 2026-06-01 03:08:54 +02:00
Peter Steinberger a84819a639 refactor(cron): keep runtime on canonical sqlite rows 2026-05-31 16:02:06 +01:00
Peter Steinberger 2bd07eead7 Refactor cron SQLite runtime paths (#88582)
* refactor: clean cron sqlite runtime paths

* fix: preserve legacy cron sqlite delivery migration

* fix: keep legacy cron notify fallback for invalid webhooks

* test: handle packaged lint suppression files

* fix: keep invalid cron notify migrations retryable

* test: fix ui timer lint
2026-05-31 12:14:48 +01:00
Steven 6709f4efe5 fix(cron): respect isolated target and error on missing remove id (#86234) 2026-05-25 07:50:30 +01:00