Repository navigation
fix: restrict thread archiving to creators and admins - #160932
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 maintainer review before merge. Reviewed September 30, 2026, 3:23 PM ET / 19:23 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch restricts session archive and restore to creators and admins across Gateway requests, agent tools, and the Control UI, with updated tests and documentation. Merge readiness✅ Ready for maintainer review Current main still permits assigned-owner archiving. This PR remains useful, and its maintain-level author explicitly accepted the documented upgrade change. The pinned patch has no actionable finding. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway receives session changes from the Control UI and agent tools. It checks the caller against the session’s creator record before changing archived state in the session store. flowchart LR
UI[Control UI action] --> Gateway[Gateway request]
Tool[Agent session tool] --> Gateway
Gateway --> Role[Current creator or admin check]
Role --> Guard[Commit-time authority check]
Guard --> Store[Session store]
Store --> Result[Archive or restore result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +36, Tests +209, Docs +2. Total +247 across 20 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the Gateway’s creator/admin decision authoritative through the final archive write, with agent and UI controls reflecting it and admin recovery available for unattributed sessions. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main documents and permits assigned-owner archiving, and the inspected before screenshot shows the enabled UI action. I did not execute current main. Is this the best way to solve the issue? Yes. The patch checks current creator/admin authority at the Gateway boundary and before the stored write, while aligning the agent and UI controls with that decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 26c0e2693d38. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
1012b41 to
4486458
Compare
|
Codex: The requested policy is creator/admin-only archive and restore; assigned ownership does not grant these actions. This intentionally changes the prior assigned-owner behavior. The multi-user guide now states the upgrade impact and that an admin can archive or restore when the creator is unavailable or lacks usable profile attribution. Assigned-owner stop remains unchanged. The current head also corrects the remaining deferred self-archive fixtures to use the authenticated creator. All 39 tests in the two shared-fixture consumer files and the required changed-file checks pass locally. Current-head CI is running. |
* fix: restrict thread archiving to creators and admins * test: align MCP archive fixtures with creator authority * test: preserve deferred archive creator authority
What Problem This Solves
Fixes members being able to archive threads created by someone else when they have general write access.
User Impact
Members can archive and restore only threads they created; admins retain access across creators. Assigned ownership alone no longer grants archive or restore access, including for existing sessions after an upgrade. This is the requested policy change; the multi-user guide documents admin recovery when the creator is unavailable or lacks usable profile attribution. Other collaboration actions, assigned-owner stop controls, and solo gateways retain their existing behavior. No configuration or migration is required.
Why This Change Was Made
Enforce creator/admin authority at the shared Gateway authorization boundary for single and batch patches, including checks after asynchronous work. Align the UI and agent controls so an unauthorized self-archive cannot report success before being rejected. The conflict resolution preserves main's newer session-assignment support.
Evidence
c8704d67e8f1c49c85b98115cf37aa19f3a100bb;openclaw/ci-gate, dependency review, and security-sensitive review are green.node scripts/check-changed.mjs --base origin/mainand the follow-up--stagedchecks passed: formatting, production and test types, i18n, lint, dead-export scans, and the selected repository guards.Before: a member can archive another creator's thread.
After: the same action is disabled with a creator/admin explanation.