Repository navigation
fix: plugin reload succeeds after handing off its turn - #182929
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. |
✅ Maintainer security changes approvedA maintainer approved this revision with an explicit security approval comment.
A later push requires a fresh approval comment for an external contributor's PR. |
|
Codex review: blocked before merge. What this changesThis PR authorizes one fixed plugin reload before yielding, then dispatches it after turn cleanup and resumes the conversation. Example: An admitted host-system conversation calls plugins with action reloadAndResume and pluginId reload-fixture.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a verified current-main authorization defect, and I found no actionable introduced bug. Current-head maintainer security approval remains required, and CI is still running. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe agent tool hands work to the session lifecycle owner; retained Gateway authority authorizes the reload, and a session event carries its result into the same conversation. flowchart TD
A[Plugins tool] --> B[Fixed request authorization]
B --> C[Turn yield and cleanup]
C --> D[One shot Gateway dispatch]
D --> E[Plugin lifecycle guards]
E --> F[Same session result event]
Technical reviewBest possible solution: Retain the immutable reload request through the existing handoff and reauthorize it through the normal dispatcher immediately before plugin effects. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically captures an unrelated write-only continuation before dispatching an admin-only reload, matching the canonical report and the supplied base regression; I ran no target code. Is this the best way to solve the issue? This repairs the authorization producer without widening generic callbacks, preserves the existing GitHub handoff, and keeps reload lifecycle and final-effect checks with their current owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6cb193f681c5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +148, Tests +55, Docs +5. Total +208 across 8 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
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 (4 earlier review cycles)
Reviewed October 25, 2026, 8:26 PM ET / October 26, 2026, 00:26 UTC (Revision 5). |
|
Exact-head shipped-Gateway canary evidence is now in the PR body: real allowed reload and same-session result, authenticated read/write-only personal refusal before yield, and post-capture role downgrade blocking replacement before plugin application. The targeted proof does not claim green CI or replace maintainer security approval. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Retain one fixed reload request through cleanup, preserving scope ceilings, revocation and final-effect checks. Reject missing authority before yielding. Keep generic GitHub handoffs on their existing path and prove one-shot dispatch. Co-authored-by: PollyBot13 <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/allow-security-sensitive-change |
|
Merged via squash.
|
…aw#182929) Authorize a fixed plugin reload before yielding, then dispatch it once through normal Gateway reauthorization after turn cleanup. Preserve personal scope ceilings, revocation, effect-time guards, and generic GitHub handoffs. Co-authored-by: PollyBot13 <[email protected]>
Authorize a fixed plugin reload before yielding, then dispatch it once through normal Gateway reauthorization after turn cleanup. Preserve personal scope ceilings, revocation, effect-time guards, and generic GitHub handoffs. Co-authored-by: PollyBot13 <[email protected]> (cherry picked from commit 7c9cb97) Co-authored-by: RomneyDa <[email protected]>
Related: #180662
What Problem This Solves
An authorized conversation can yield for a plugin reload and then receive a missing-admin error instead of reloading.
User Impact
The requested plugin reloads after turn cleanup, and the same conversation receives its result. Callers without administrator authority are rejected before the turn yields. Personal scope ceilings, revocation, and checks immediately before effects remain enforced.
Why This Change Was Made
The generic handoff captured authority for an agent request before knowing that it needed an administrator-only reload. The existing handoff now preauthorizes one fixed reload, retains its source through cleanup, and reauthorizes through the normal Gateway dispatcher. The capability cannot dispatch twice or run an arbitrary administrative callback. GitHub preparation keeps its generic continuation path.
The maintainer cleanup makes callback and fixed-request inputs mutually exclusive, shares the handoff-scope type, and adds independent proof that changing the original request cannot retarget the reload or permit a second dispatch. No configuration, protocol, schema, or plugin lifecycle changes are required.
Evidence
0f26254ccacd, with owner source identical to current main: the host-system case yielded without reaching reload; both write-only and personal nonadmin cases returnedstartedinstead of rejecting before yield. All three failed for those reasons (135.03 seconds wall).f7292780f214, all 36 tests passed across plugin reload, generic continuation, and GitHub handoff (180.01 seconds wall). Targeted lint, eight-file formatting, and diff checks passed again. Exact-head CI 40248902801 passed: 48 successful jobs, 30 skipped, no failures, including all three PostgreSQL conformance shards.4699a42489425bce225ee7b18b3d91a74e4521dc: a source-matched isolated Gateway received a real Discord message, the model calledplugins.reloadAndResumeonce, registration count rose 1→2 after cleanup, and the same session called the replacement plugin instance. Final Discord delivery was not independently read back. Earlier canaries also observed nonadmin refusal and a role downgrade stopping a queued replacement before registration. These are prior-head observations, not fresh final-head proof.Final-head live Gateway/channel round trips were not repeated: QA broker credentials are unavailable, and a fresh isolated Gateway build and canary would exceed the live-test budget. ClawSweeper completed the final-head review with zero findings. Security-owner clearance remains a separate required gate: the security-sensitive check is awaiting maintainer approval for this exact head.
Original contribution by @PollyBot13; contributor commit authorship is preserved.