Repository navigation
feat(cron): enable automation triggers by default - #125025
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 17, 2026, 4:08 AM ET / 08:08 UTC. ClawSweeper reviewWhat this changesThe branch changes omitted Merge readinessKeep this PR open. Its cron-default change needs an explicit security-boundary decision, and the two prior security-documentation blockers remain unresolved: the new hierarchy puts model choice ahead of host-enforced controls, and its benchmark claims are uncited. Priority: P2 Review scores
Verification
How this fits togetherThe Automations tool sends jobs to the Gateway scheduler. The scheduler validates jobs, builds a headless Code Mode runtime for scripts, and starts stream watchers; those paths then run with the owning agent’s configured tool and sandbox policy. flowchart LR
A[Agent or MCP automation request] --> B[Automations tool]
B --> C[Gateway scheduler]
C --> D{Trigger setting}
D --> E[Headless script runtime]
D --> F[Stream watcher]
E --> G[Scheduled job outcome]
F --> G
Decision needed
Why: This is a deliberate change to the current safe-default posture, not a mechanical correction; repository policy requires a human decision on the resulting execution boundary. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch broadens an unattended execution default and introduces security guidance that conflicts with the repository’s boundary-first model and lacks sources. PR surfaceSource +3, Tests +94, Docs +4. Total +101 across 27 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Restore boundary-first security guidance, cite or remove the benchmark statistics, and land a default-on posture only after its upgrade and unattended-execution tradeoff is explicitly approved. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR intentionally changes a default rather than repairing a reportable failing path; source establishes the old and proposed behaviors. Is this the best way to solve the issue? No. The runtime change may be a valid product direction, but the security docs must restore hard controls as the primary boundary and substantiate or remove the benchmark claims first. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8e44c90f53c8. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
013ccbf to
abb1a3b
Compare
Condition watchers, script payloads, and stream schedules were gated behind cron.triggers.enabled=false, so the capability shipped dark and the automations tool told the model to call it unsupported. The gate did not buy what its warning implied. cronJobUsesToolRuntime treats agentTurn, script, and trigger.script identically for tool policy, and jobs are capped to the creating agent's allowlist via creatorToolAllowlist -- but an agentTurn cron job was never gated, so unattended recurring exec with that same creator-capped authority was already reachable. The gated paths are strictly tighter: a condition gate gets 30s, 5 tool calls, 16KB state and a 30s minimum interval, where an agentTurn has no such budget. Sandboxing already applies to trigger scripts, which resolve sandbox context and redirect the workspace when access is not rw. Absent config now means enabled; an explicit cron.triggers.enabled: false still disables every surface it disabled before, and the error text names the opt-out instead of telling operators to turn something on. No new config key, no migration. Docs: reword the trigger warning for default-on while keeping the unattended execution note, and record the new default in the configuration reference.
Trigger, stream-schedule, and script-payload surfaces are now advertised in the automations tool description by default, so the committed fixtures drift. This also records the cost: dynamicToolsJson grows 49,477 -> 52,541 chars and the snapshot total 76,861 -> 79,925 (~766 rough tokens per prompt). That is the price of no longer dark-shipping the capability.
The MCP tools bridge mirrors the scheduler gate, so an absent cron.triggers config now advertises the trigger surface. Explicit false still narrows it and explicit true still widens it; both assertions are unchanged.
75a231c to
5f23991
Compare
|
Merged via squash.
|
* feat(cron): enable automation triggers by default Condition watchers, script payloads, and stream schedules were gated behind cron.triggers.enabled=false, so the capability shipped dark and the automations tool told the model to call it unsupported. The gate did not buy what its warning implied. cronJobUsesToolRuntime treats agentTurn, script, and trigger.script identically for tool policy, and jobs are capped to the creating agent's allowlist via creatorToolAllowlist -- but an agentTurn cron job was never gated, so unattended recurring exec with that same creator-capped authority was already reachable. The gated paths are strictly tighter: a condition gate gets 30s, 5 tool calls, 16KB state and a 30s minimum interval, where an agentTurn has no such budget. Sandboxing already applies to trigger scripts, which resolve sandbox context and redirect the workspace when access is not rw. Absent config now means enabled; an explicit cron.triggers.enabled: false still disables every surface it disabled before, and the error text names the opt-out instead of telling operators to turn something on. No new config key, no migration. Docs: reword the trigger warning for default-on while keeping the unattended execution note, and record the new default in the configuration reference. * test(cron): refresh prompt snapshots for default-on triggers Trigger, stream-schedule, and script-payload surfaces are now advertised in the automations tool description by default, so the committed fixtures drift. This also records the cost: dynamicToolsJson grows 49,477 -> 52,541 chars and the snapshot total 76,861 -> 79,925 (~766 rough tokens per prompt). That is the price of no longer dark-shipping the capability. * test(mcp): expect trigger surfaces by default in the tools bridge The MCP tools bridge mirrors the scheduler gate, so an absent cron.triggers config now advertises the trigger surface. Explicit false still narrows it and explicit true still widens it; both assertions are unchanged.
What Problem This Solves
cron.triggers.enableddefaulted tofalse, so condition watchers, script payloads, and stream schedules were dark-shipped: the capability existed, and theautomationstool description actively told the model to say it was unsupported and to never poll in its place. Operators asking for "watch X and tell me when it changes" got a refusal for a feature that ships in the box.Why This Change Was Made
An audit of the actual authority boundary found the gate was not buying what its warning implied:
cronJobUsesToolRuntime(src/cron/tools-allow.ts) treatsagentTurn,script, andtrigger.scriptidentically for tool policy, and jobs are capped to the creating agent's allowlist viacreatorToolAllowlist(src/agents/tools/cron-tool-creator-cap.ts). AnagentTurncron job was never gated — it already runs unattended, recurring, with that same creator-capped authority includingexec.agentTurnhas no such budget.src/cron/trigger-script.tsresolves sandbox context and redirects the workspace when access is notrw, passingsandboxinto tool construction — so a sandboxed deployment sandboxes its triggers.So the gate blocked the bounded paths while leaving the broader one open. Absent config now means enabled; an explicit
cron.triggers.enabled: falsestill disables everything it disabled before, and the error text now says so.User Impact
Condition watchers, script payloads, and stream schedules work out of the box. Operators who want a hard stop set
cron.triggers.enabled: false. No new config surface, no migration.Docs updated alongside: the trigger warning no longer advises leaving the feature off, and the configuration reference records the new default.
Security doc accuracy pass
Two claims in the security docs had drifted from measured reality:
contextVisibilityfor scoping attention, reserving extra caution for genuinely public rooms.The ATLAS threat-model entries (T-EXEC-001/002) keep their structure; residual risk is restated as model-tier dependent with the measured numbers rather than a flat severity label, since those rows are used for report triage.
Evidence
See the commit for full test output.
node scripts/run-vitest.mjs run src/cron/service src/cron/service.jobs.test.ts src/cron/service.stream-validation.test.ts src/cron/trigger-script.test.ts— 41 files, 692 tests passednode scripts/run-vitest.mjs run src/agents/tools/cron-tool.test.ts src/agents/tools/cron-tool.schema.test.ts src/gateway/cron-stream-watchers.test.ts src/gateway/server.cron.test.ts src/gateway/server-methods/cron-error-classification.test.ts— 3 shards passed (202 tests in the agents-tools shard)src/cron/service/jobs-validation.test.tsproves both directions: omittedcron.triggersallows a trigger job, and an explicitenabled: falsestill rejects it with the new message.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.jsonclean. The roottsconfig.jsonlane fails only on two pre-existingtsdown.config.tserrors that reproduce identically on unmodifiedmain.Note on a suite stall:
node scripts/run-vitest.mjs run src/cron(raw path filter) stalls with no output and is killed at 120s. I verified this reproduces on cleanmainwith zero changes — it is pre-existing and unrelated, caused by the path filter pulling in the three*.e2e.test.tsfiles that need live resources. The unit slice above covers the same code and passes.