Skip to content

fix(cron): scheduled scripts reject configured creator accounts - #176158

Merged
vincentkoc merged 1 commit into
mainfrom
fix/scheduler-account-context-20261018
Oct 18, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/scheduler-account-context-20261018

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Fixes #176157

What Problem This Solves

Fixes configured named accounts being reported unavailable when an account-scoped scheduled trigger or script prepares its tools, even though the job already records the creator's channel.

User Impact

Scheduled scripts can run with their existing account-scoped tool grant. Missing accounts and unknown creator origins still fail closed; delivery settings do not supply authorization. This does not infer missing origins for legacy jobs or change message-send account selection. No configuration or migration is required.

Why This Change Was Made

Pass the recorded caller origin to the existing scheduled-policy resolver, matching the agent-turn path. Include that origin in runtime preparation's cache key so a changed or missing origin cannot reuse an earlier account context. Both script entry points use the same runner.

The necessary production growth is seven net lines: the typed handoff and its cache identity. There is no new policy owner, fallback, configuration, or compatibility layer.

Evidence

  • Before: the real scheduler preparation boundary fails on a configured work account with Scheduled account "work" is unavailable, before reaching the script's message transport.
  • After: 57 tests across eight files pass through the native Vitest runner. The regression uses real runtime preparation and headless script execution for trigger and payload paths, with only the external Telegram transport stubbed. It covers a valid named account, changed/missing creator origin, a missing account, an explicitly selected disabled account, and a deliberately different delivery channel/account.
  • Existing script lifecycle, message-fence, admission, agent-turn account-policy, shared scheduled-policy, and prompt-prefix tests pass.
  • Targeted formatter/lint, core production types, and the canonical cron test type graph pass.
  • An additional graph-boundary check fails identically on the untouched base: gateway-root has 730 test roots and infra has 740 against its 720-root budget. This change adds no roots to either graph and does not suppress that failure.
  • Fresh isolated autoreview reports no accepted/actionable findings at its default P0 threshold. The author also completed the scoped simplification and boundary/test audit.
  • No production Gateway restart, real-channel send, live scheduler mutation, or provider/model request is part of this proof. Hosted PR CI supplies the broader exact-head gate.

Preserve the recorded creator origin during shared trigger/script tool preparation and bind the preparation cache to it. Keep missing-origin and unavailable-account behavior fail-closed without using delivery settings as authority.

Add real headless scheduler-boundary coverage for named Telegram accounts, invalid origin changes, missing/disabled accounts, and delivery/owner separation.

Fixes #176157
@vincentkoc vincentkoc self-assigned this Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review October 18, 2026 09:08
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 18, 2026
@vincentkoc
vincentkoc merged commit 685fb5f into main Oct 18, 2026
191 checks passed
@vincentkoc
vincentkoc deleted the fix/scheduler-account-context-20261018 branch October 18, 2026 09:23
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
openclaw#176158)

Preserve the recorded creator origin during shared trigger/script tool preparation and bind the preparation cache to it. Keep missing-origin and unavailable-account behavior fail-closed without using delivery settings as authority.

Add real headless scheduler-boundary coverage for named Telegram accounts, invalid origin changes, missing/disabled accounts, and delivery/owner separation.

Fixes openclaw#176157

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduled scripts reject configured named accounts despite recorded creator origin

1 participant