Repository navigation
fix: let owners ask the agent to maintain its own gateway - #182762
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. What this changesThis PR adds owner-requested restart and recovery cleanup actions to the Gateway tool using existing lifecycle and retirement owners. Example: An owner asks, “Preview cleanup of old update recovery copies.”
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: the maintainer-approved maintenance capability is useful, and inspection found no actionable code defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe agent-facing Gateway tool translates trusted owner or scheduled requests into local Gateway handlers, which coordinate restart signals or worker-owned recovery retirement. flowchart TD
A[Owner or operator schedule] --> B[Gateway agent tool]
B --> C[Local Gateway dispatcher]
C --> D[Restart coordinator]
C --> E[Recovery cleanup worker]
D --> F[Restart signal and session notice]
E --> G[Existing retirement owner]
Technical reviewBest possible solution: Keep maintenance in the existing lifecycle and retirement owners, preserving live authorization and existing recovery eligibility. Do we have a high-confidence way to reproduce the issue? Current-main schemas establish that direct restart and cleanup actions are absent; no target code was executed during this read-only review. Is this the best way to solve the issue? The smallest complete implementation extends the existing tool and delegates scheduling, authorization, eligibility, and deletion to their established owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9198552c7a50. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +219, Tests +307, Docs +17. Total +543 across 31 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 24, 2026, 2:51 PM ET / 18:51 UTC. |
|
Merged via squash.
|
…82762) * fix: let owners request supervised gateway maintenance * docs: clarify gateway maintenance in limited tool profiles
What Problem This Solves
An agent refuses an owner's request to maintain its own Gateway because the prompt forbids self-maintenance and the tool lacks restart and cleanup actions.
User Impact
Owners can ask the agent to update, safely restart, or clean up eligible update recovery copies. The agent uses runtime-owned actions instead of sending the owner to slash commands or a terminal. Cleanup runs while the Gateway remains available and permanently removes only eligible rollback copies; a preview is available.
Non-owner requests, explicit tool restrictions, current owner revocation, and chat restart policy remain enforced. No live deployment is part of this change.
Why This Change Was Made
restartandupdate.cleanupalongsideupdate.run, including limited profiles without configuration reads.dryRun.Evidence
f009dd878a0ebd1921fe21115b049c058339a32e, plus 30 unaffected sibling cases from earlier runs: prompt/config and tool-profile contracts, owner update admission, real restart scheduling/deferral, owner revocation and disabled chat restarts, automatic-cleanup siblings, and real serving-Gateway cleanup.Full touched-test audit retained distinct public contracts and replaced the obsolete removed-action test with observable scheduling. The cleanup integration takes about 43 seconds of test time (76 seconds including preparation) because it boots one real Gateway and exercises authenticated revocation plus real worker I/O; the tool behavior tests complete in milliseconds. CI timing will be attached by the normal checks.
The repository's declaration-containment guard rejected the global dependency graph. Only this task's graph was changed to pnpm's supported project layout, retaining the canonical content store and
packageImportMethod=auto; no guard was bypassed. Build output includes existing advisory CSS-size warnings. Live model-driven maintenance and a production deployment were not run.Follow-up review corrections also prove deferred owner/policy revocation, a fixed non-update restart reason, real persisted post-restart notice, handler-level revocation before effects, and manual cleanup stopping after owner revocation. The first independent API review identified these gaps and stale consumers; they were fixed together. The final independent API-only review is P0–P2 clean on exact head
f009dd878a0ebd1921fe21115b049c058339a32e, including test quality. The current-main merge only adopted the upstream pairing fixture; the reviewer verified unchanged production patch IDs. Nativescripts/prreview and preparation records are validated; required CI remains its own gate.Post-merge focused command: 242 passed / 11 files / 4 shards, 227.97 seconds. The real cleanup integration took 58.5 seconds on that run. Post-merge production/gateway type graphs passed; 15,905 internal documentation links checked, zero broken, and all six prompt snapshots are current.