Skip to content

fix: the cron isolated agent in openclaw unconditiona (#383) - #63878

Merged
drobison00 merged 1 commit into
openclaw:mainfrom
drobison00:fix/the-cron-isolated-agent-in-openclaw-unconditiona
Apr 10, 2026
Merged

drobison00 merged 1 commit into
openclaw:mainfrom
drobison00:fix/the-cron-isolated-agent-in-openclaw-unconditiona

Conversation

@drobison00

Copy link
Copy Markdown
Contributor

Summary

  • Problem: isolated cron agent runs always passed senderIsOwner: true into runEmbeddedPiAgent(), so scheduled turns inherited owner-only tool access by default.
  • Why it matters: cron jobs can process externally sourced content, and owner-only tools should not unlock automatically for those runs.
  • What changed: the cron isolated executor now runs embedded agent turns with senderIsOwner: false, and the closest regression test now locks in the non-owner behavior.
  • What did NOT change (scope boundary): this does not add a new cron payload capability, broaden tool policy, or change unrelated cron delivery/session behavior.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Root Cause / Regression History (if applicable)

  • Root cause: createCronPromptExecutor() hardcoded senderIsOwner: true for every isolated cron agent run instead of treating cron content as untrusted by default.
  • Missing detection / guardrail: the only direct regression coverage asserted the privileged behavior, so the owner-only tool boundary was locked to the wrong default.
  • Prior context (git blame, prior PR, issue, or refactor if known): issue [Bug]: Can't install "pnpm ui:install" #383 traced the behavior to src/cron/isolated-agent/run-executor.ts and the adjacent run.owner-auth.test.ts expectation.
  • Why this regressed now: cron isolated-agent execution kept owner semantics even after cron support expanded to process external hook content and other externally sourced inputs.
  • If unknown, what was ruled out: N/A

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/cron/isolated-agent/run.owner-auth.test.ts
  • Scenario the test should lock in: isolated cron agent runs pass senderIsOwner: false into runEmbeddedPiAgent().
  • Why this is the smallest reliable guardrail: the bug is a single privileged parameter at the executor boundary, and this test exercises that exact call site without pulling in unrelated runtime behavior.
  • Existing test that already covers this (if any): none; the prior test asserted the opposite behavior.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

  • Scheduled isolated cron agent runs no longer inherit owner-only tool access by default.

Security Impact (required)

  • New permissions/capabilities? (Yes/No): No
  • Secrets/tokens handling changed? (Yes/No): No
  • New/changed network calls? (Yes/No): No
  • Command/tool execution surface changed? (Yes/No): Yes
  • Data access scope changed? (Yes/No): Yes
  • If any Yes, explain risk + mitigation: cron turns now run with less privilege, which removes owner-only tool access from this path instead of expanding it.

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: local worktree
  • Model/provider: N/A
  • Integration/channel (if any): cron isolated agent
  • Relevant config (redacted): default test harness config

Steps

  1. Run an isolated cron agent turn through the existing cron test harness.
  2. Inspect the runEmbeddedPiAgent() call arguments.
  3. Confirm senderIsOwner stays false.

Expected

  • Isolated cron runs do not present as owner senders.

Actual

  • After the fix, the focused regression confirms senderIsOwner: false.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: inspected the executor boundary, updated the regression, and ran the focused cron owner-auth test locally.
  • Edge cases checked: confirmed the change is scoped to the isolated cron executor call and does not alter model fallback, delivery, or session wiring.
  • What you did not verify: full repo build; the service-managed pnpm build post-turn validation is expected to cover that.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No): No
  • Config/env changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, exact upgrade steps: N/A

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert the senderIsOwner change in src/cron/isolated-agent/run-executor.ts.
  • Files/config to restore: src/cron/isolated-agent/run-executor.ts, src/cron/isolated-agent/run.owner-auth.test.ts, CHANGELOG.md
  • Known bad symptoms reviewers should watch for: cron jobs that previously depended on owner-only tools will stop seeing those tools until a separate explicit capability is introduced.

Risks and Mitigations

  • Risk: existing cron jobs that implicitly depended on owner-only tools may lose access.
    • Mitigation: keep the change narrowly scoped to isolated cron runs, document the behavior change in the changelog, and defer any future explicit opt-in design to a separate follow-up.

@greptile-apps

greptile-apps Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a security issue where createCronPromptExecutor() unconditionally passed senderIsOwner: true into runEmbeddedPiAgent(), granting owner-level tool access to every isolated cron agent run regardless of whether the content was externally sourced. The fix is a single-line change to senderIsOwner: false, accompanied by a regression test that locks in the non-owner behavior and a changelog entry placed correctly at the end of the Unreleased ### Fixes section.

Confidence Score: 5/5

Safe to merge — targeted single-line security fix with a regression test that locks in the correct non-owner behavior.

The change is a one-line privilege reduction (senderIsOwner: true → false) with no collateral impact on other paths. The test harness correctly routes through runEmbeddedPiAgent and verifies the new value. Changelog placement follows repo conventions. No P0/P1 findings.

No files require special attention.

Vulnerabilities

  • Privilege reduction (positive): run-executor.ts now passes senderIsOwner: false to runEmbeddedPiAgent() for all isolated cron runs, removing the path by which owner-only tools could be invoked on externally sourced cron content. No new permissions or trust boundaries are introduced.

Reviews (1): Last reviewed commit: "fix: the cron isolated agent in openclaw..." | Re-trigger Greptile

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Apr 9, 2026
@drobison00
drobison00 force-pushed the fix/the-cron-isolated-agent-in-openclaw-unconditiona branch from 7beee4d to d0401b8 Compare April 10, 2026 16:36
@drobison00
drobison00 force-pushed the fix/the-cron-isolated-agent-in-openclaw-unconditiona branch from d0401b8 to 2ae8eb3 Compare April 10, 2026 16:42
@drobison00
drobison00 merged commit 54ae138 into openclaw:main Apr 10, 2026
8 checks passed
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Can't install "pnpm ui:install"

1 participant