Repository navigation
fix(cron): retain app access when owners replace allowed tools - #170498
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR lets matching owners capture fresh Codex app authority when replacing an automation’s allowed tools. Example: The original owner replaces an automation’s toolsAllow with ["calendar_search"] from a fresh authenticated Codex turn.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: it repairs a current, documented owner-reauthorization defect while preserving cross-owner management edits; no concrete introduced code bug was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Automations tool carries separate management and creator grants into Gateway validation, then CronService persists the authority ceiling consumed by scheduled Codex execution. flowchart TD
A[Authenticated owner turn] --> B[Automations tool]
B --> C[Gateway caller scope]
C --> D[Locked update validation]
D --> E[CronService authority storage]
E --> F[Scheduled Codex runtime]
F --> G[App policy and execution]
Technical reviewBest possible solution: Keep the focused same-owner capture repair and validate the combined authority path through persistence and scheduled app execution. Do we have a high-confidence way to reproduce the issue? Current main suppresses creator capture in both the tool adapter and Gateway management scope, establishing the reported missing-authority path; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch repairs both suppression points, reuses existing grant and persistence owners, and repeats owner-scope validation under the update lock. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd9ba9105b4a. Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete bypass was found; clearance depends on the authority-chain evidence specified below. EvidenceWhat I checked:
PR surfaceSource +22, Tests +169, Docs +5. Total +196 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 12, 2026, 10:02 PM ET / October 13, 2026, 02:02 UTC (Revision 2). |
|
Landing with a pinned admin merge on head |
…llow (openclaw#170498) An owner cron.update that replaced toolsAllow went through the management grant, which dropped creator-authority capture: the update reported success but the tool never appeared at run time. Exact-owner (session + account) updates now capture fresh authority like cron.add; if capture is unavailable for the owner the update refuses with a recreate hint. Non-owner manager edits keep the documented behavior (authority cleared, next run reports reauthorization). Fixes openclaw#170298.
Backport #170498 to the October branch. Explicit toolsAllow updates by the original session/account recapture scheduled Codex app authority while preserving separate management and creator grants and locked validation. Add owner, revocation, legacy persistence, and scheduled runtime coverage, including opt-in real native app-read proof from the persisted envelope with foreign-connection and revoked-policy rejection. Focused production regressions: 322 passed; follow-up Gateway 14 and runtime 6 passed; native capture, SQLite reopen, and scheduled GitHub read passed. Current hosted dependency audit remains red for unchanged baseline advisories, tracked separately in #172664; fail-fast cancellations are not passing coverage. No deployment or tenant activation. Upstream repair: 4513fcb.
Fixes #170298
What Problem This Solves
An owner replacing an automation's
toolsAllowcould receive a successful update while the selected Codex app tool remained unavailable at run time.User Impact
A fresh authenticated owner turn can replace the tool cap and capture the app authority needed by that automation. An owner whose capture is unavailable receives an error naming the requested tools and explaining how to recreate the automation. Non-owner managers retain their existing cap-edit workflow: replacing the cap clears captured app authority, and the next run reports that app access needs reauthorization. Ordinary edits preserve captured authority.
Why This Change Was Made
Management grants were suppressing creator capture in the tool adapter and discarding creator grants in the Gateway scope. Preserve those separate authorities, capture only for the job's original owner session/account, and validate owner capture against the same scope restrictions as
cron.add, including the locked update precondition. Non-owner management authority cannot lend creator authority. Runtime authority storage and reconciliation remain with the existing cron owner.Net change: +22 production lines, +169 test lines, +5 documentation lines. No config, schema, or dependency changes.
Evidence
06449419fdcb45c9e45f70e327b77e205452e823: 672 tests in 1,669.75 seconds, with source-fingerprint verification. All 28 affected test type graphs also passed then. The lead requested focused proof for this correction; the shared CronService authority/reconciliation owners remain unchanged.node scripts/check-changed.mjscompleted in 1,738.27 seconds and failed only at the inherited Knip unused-export findings listed below. The lead confirmed these are unrelated to this patch and may support in-flight work; they remain unchanged. No check was disabled and no baseline was changed.Inherited, unrelated Knip findings:
scripts/lib/postgres-schema-catalog.mts:literalsrc/agents/failover-error.ts:hasProviderRequestSizeCeilingsrc/tts/tts.ts:getResolvedSpeechProviderConfig(ttsRuntime)ui/src/app/app-root.tsx:OpenClawAppui/src/app/app-shell-view.tsx:ApplicationShellui/src/app/shell-layout-traits.ts:ShellLayoutControllerextensions/workboard/src/test/postgres-fixture-contract.ts:PostgresFixtureReply