Repository navigation
fix: retain the native requester for scheduled Discord edits - #150308
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: blocked before merge. Reviewed September 17, 2026, 5:26 AM ET / 09:26 UTC (Revision 8). ClawSweeper reviewWhat this changesThe PR retains the authenticated Discord requester on account-bound automations so scheduled channel edits use that person's current permissions and executable edits refresh or clear their authority. Merge readiness⛔ Blocked before merge - 5 items remain This remains distinct, useful work beyond the merged scheduled-message prerequisites. No actionable introduced code defect was found; the maintainer-authored PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's scheduler runs saved agent instructions after the creating conversation has ended. Private job provenance carries requester identity through Gateway admission to the Discord plugin, which checks permissions before channel changes. flowchart TD
A[Authenticated Discord turn] --> B[Creator grant]
B --> C[Saved automation]
D[Executable job edit] --> C
C --> E[Live scheduled occurrence]
E --> F[Account and requester checks]
F --> G[Discord permission checks]
G --> H[Channel edit or rejection]
Decision needed
Why: The implementation and boundary proof support the design, but accepting this persisted permission contract requires owner intent; available metadata does not establish that involvement. Before merge
Agent review detailsSecurityNone. PR surfaceSource +607, Tests +1090, Docs +33. Total +1730 across 37 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep requester provenance with the canonical scheduler owner and obtain security-owner acceptance of its executable-edit revocation and documented downgrade recovery contract. Do we have a high-confidence way to reproduce the issue? Not applicable as a new account-authorized execution mode: main explicitly limits scheduled channel administration to operators. The retained production-path harness demonstrates the proposed account mode. Is this the best way to solve the issue? Yes. Extending existing creator grants, canonical job mutation, and Discord permission checks avoids a parallel authority owner or fabricated inbound conversation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9ab47386778b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
102787f to
60b6a15
Compare
ce6cc1f to
bf1b37f
Compare
60b6a15 to
5a5115e
Compare
bf1b37f to
ceefa83
Compare
5a5115e to
a9b9f5f
Compare
ceefa83 to
c4bb6a4
Compare
|
Fixed: scheduled Discord channel edits retain their authenticated requester and check that person's current permissions. |
…w#150308) Retain the native requester for account-scheduled Discord channel edits, reauthorize executable changes, and stop later actions from revoked runs. Refs openclaw#140978.
What Problem This Solves
A scheduled job created from Discord has no inbound Discord message when it later runs. It cannot safely use the original session creator or an OpenClaw owner flag as the human authority for
channel-edit. A later editor also needs to authorize the executable definition they save. Related: #140978.This contribution retains the authenticated native requester through creation, edits, and scheduled execution. It uses the shared scheduled-message path landed in #150191, alongside the operator/account-read and SDK contributions in #150166, #150278, and #150182.
User Impact
An authorized user in Discord can create a finite-cap automation that edits channels or threads under that person's current Discord permissions. The job's owning session and account remain its boundary, and the existing tool policy, configured action restrictions, and plugin checks still apply. OpenClaw's owner designation does not replace Discord's permission check.
Changing the prompt, model, name, schedule, delivery, or another executable input binds the job to the current qualified editor, or clears native edit authority when that editor cannot be established. Description and display-label changes, and equivalent resaves, preserve the saved requester and running occurrence. An explicit tool-cap refresh or a complete authored declaration can reauthorize an unchanged definition. Executable changes retire further actions from the old occurrence; a provider edit already accepted still settles normally.
Discovery uses the saved native account even when the job delivers its result through another account. Read access keeps its separate recorded-origin checks. Jobs without a usable native requester need a fresh edit from their owning Discord session/account with an explicit finite
toolsAllowcap containingmessage. Recreate the job there if its execution authorization is also missing. The automation and SDK documentation explain this recovery.Why This Change Was Made
Creation records the actual authenticated sender in the existing private provenance envelope. A requester-only capture remains distinct from a genuine capture of the complete executable tool surface. Generated MCP requests retain the original private issuer and bind it to the actual admitted run and current MCP capture. The signed caller carries an opaque, one-use grant that remains subject to source validity at commit. Tool arguments and session attribution cannot supply requester authority, and native capture does not take over harness-owned runtime authority.
The existing mutation owner reconciles requester facts after the full edit is known, including declarations and authored trigger state. At execution, the scheduler binds the validated tuple to the live occurrence. The registered Discord adapter receives that requester with
senderIsOwner: falseand no fabricated inbound conversation, then checks current permissions before provider work.Requester facts remain absent from public job results. There is no configuration or storage schema migration. A released-reader round trip confirms older readers can list and edit these jobs; older writers discard the unsupported requester fact, requiring fresh authorization afterward.
Evidence
Retained Blacksmith Testbox proof covers 566 selected runtime cases: 53 CLI/MCP, 29 discovery, nine scheduler journeys, 164 private-provenance/service/receipt cases, and 311 Gateway/token/creator-context cases. The native journey uses real reply ingress, generated MCP automation creation, persisted requester B on a non-default account, and cron.run. One edit succeeds; removing B's permission prevents a second PATCH. Model decisions and provider responses are synthetic. Runtime proof.
The full nine-row prerequisite integration passes with the scheduled 120-second gap. A shared fixture clock hook was limited to scheduled execution after reproducing a recursive Date.now spy during the separate creation phase; all creation, permission, cancellation, and settlement assertions remain. Three MCP listener lifetime cases also pass. Integration proof.
The latest integration run uses the landed dashboard permission contract and the new MCP lifecycle code with the native requester contribution. The one selected requester-B case passed; eight already-proven common scenarios were intentionally skipped. The actual tested source is a067e61de021731408cae8aa47b54171e3b5f956. The final main replay preserves all three native patches; the only later change within a native file passes the existing execution session into the embedded path, outside this Claude CLI case. Its source and caller contracts were inspected. Native integration proof.
The earlier current-model run and typing retain their original execution identities. Both cycle checks, all 20 core test-type graphs, extension production/test types, and the strict runtime build with all 154 public SDK subpaths have passed in the retained qualification. The final affected formatting, lint, and ratchets are checked against the replay. Full contribution review and scoped correction/fixture autoreviews through P2 have no actionable findings; a fresh focused review confirmed that dashboard reads remain separate from native scheduled write authority. Type/build proof, earlier model-path proof.
The required read, write, and SDK contracts are on main. The final composition retains #150309’s dashboard read-only contract, #150216’s thread-permission correction, and documented older-writer recovery. Exact-head ClawSweeper review is Platinum with Diamond proof and no code or security findings. Review.
Final-head CI completed with three shared tooling failures: the planner clone lint rule, a Doctor fallback fixture, and the Labeler routing expectation. All three are repaired on main in #150655. Its executed CI passes the exact affected cases and lint; the tested repair files and relevant tooling/dependency inputs match the final combined result. The native change and the complete intervening main changes were inspected for compatibility. Failed CI retains its actual status; these results qualify the repaired merge result. Final-head CI, repair CI.