Repository navigation
feat: edit personal instructions on multi-user gateways - #155256
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 22, 2026, 11:24 PM ET / September 23, 2026, 03:24 UTC (Revision 16). ClawSweeper reviewWhat this changesAdds Profile and chat-based editing of personal instructions on multi-user Gateways, while keeping single-user Gateways on the workspace-root USER.md. Merge readiness✅ Ready for maintainer review This remains useful work: current main lacks authenticated self-service editing, and the earlier bootstrap PR does not replace it. No blocking correctness or security finding remains in the reviewed head. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway resolves authenticated users and controls access to their agent-workspace instructions. Profile settings and an agent tool share a guarded file API; subsequent eligible turns load the saved instructions through the existing bootstrap loader. flowchart TD
A[Profile settings] --> C[Personal instructions API]
B[Authenticated chat tool] --> C
C --> D[Check current requester and multi-user policy]
D --> E[Check file version and safe path]
E --> F[Requester's personal USER file]
F --> G[Existing prompt bootstrap]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +956, Tests +1271, Docs +44, Other +6. Total +2277 across 53 files. 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. Technical reviewBest possible solution: Keep one authenticated-self file API shared by Profile and chat, preserving live requester checks, conflict detection, and the existing bootstrap format. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this adds a capability that the inspected main Profile page and tool catalog do not provide. Is this the best way to solve the issue? Yes. Sharing a requester-bound API avoids widening administrator-only shared-file editing or general filesystem access. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ff2736533bed. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (15 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review Updated head: At the requester’s direction, the same PR now includes chat-based editing from any authenticated Gateway session. A dedicated tool reuses the existing file owner and the exact live original-requester authority; it does not derive identity from the session owner or grant generic filesystem access. Real tool → in-process Gateway → filesystem tests cover main/shared/worktree session identities and revoked/missing run authority. 374 tests across 8 suites, production/core-test/UI typechecks, scoped type-aware lint, import-cycle and dead-export checks pass. The PR body records scope, initial CI failures/replay limits, and preserved visual evidence. Please review the expanded boundary on this exact head. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated head:
167 targeted authority/handshake/sandbox tests pass, plus the owner-reconnect test after extracting its full assertions to respect the line cap. Production/core-test typechecks, scoped lint, line-cap guard, and tool-display generation/check pass. Both previous-head CI defects (display metadata and sandbox group expectation) are fixed. PR body retains the scope limits and evidence. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Hide the dormant personal editor host without losing reconnect drafts. Load editor-only English with the Profile component so startup stays within the unchanged bundle budget. Co-authored-by: VACInc <[email protected]>
|
@clawsweeper re-review Please review exact head This also fixes the prior head's Control UI performance failure: editor-only English now loads with the Profile component; search title/description remain eager. Full composed English catalog JSON is byte-for-byte unchanged. The same base comparison passes at 371,031 B startup JS gzip, down from 371,425 B, against the unchanged 371,332 B limit. No budget, allowance, or baseline was raised. 122 focused Profile/search/i18n tests pass (44.86 s command wall), as do UI types, i18n verification, scoped lint/format, and fresh P0–P2 local review. Current-head CI is pending; earlier checks/reviews are not attributed to this head. Captures are matching crops of the real production Profile UI with synthetic data, light theme, and a 1280×1000 viewport. No Gateway deployment or PR merge. Before After |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
) Enable authenticated users to edit their personal instructions from Profile or chat on multi-user Gateways. Keep single-user Gateways on the workspace-root USER.md. Preserve requester-bound authority, safe local writes, conflict checks, reconnect drafts, normal Profile spacing, and the startup performance budget. Co-authored-by: VACInc <[email protected]>


Closes #155255
What Problem This Solves
Signed-in users can have a personal
USER.mdbut cannot edit it themselves through Profile settings or reliably ask an agent to update it from a project session. Follow-up to #153966.User Impact
On multi-user Gateways, users can open Settings → Profile → Personal instructions or ask an agent from any authenticated Gateway chat session to create/edit their personal instructions. The chat path works independently of the session owner and project worktree. Both paths use the requesting person’s file with
operator.read; shared bootstrap files and other people’s files remain outside that authority.Single-user Gateways use only the existing workspace-root
USER.md(Agents → Files). They get no personal-instructions editor, Settings-search entry, chat tool or catalog entry, personal-file API access, or per-profile prompt overlay. Previously created personal files remain untouched on disk; they are not loaded, deleted, or silently merged into the root file.Personal files are enabled only by the existing multi-user policy: at least two distinct, unmerged person profiles, excluding the shared Owner from the count. The server rechecks this policy before reads and immediately before writes; Control UI picks up a changed roster policy on reconnect. Within multi-user Gateways, requester binding, session-selected prompt context, local-workspace restrictions, the 4,000-character budget, provenance checks, and normal tool/agent permissions remain. No new configuration option or storage migration is introduced.
Why This Change Was Made
The existing Agents file editor is intentionally admin-only and limited to shared bootstrap filenames. A Profile editor that follows the existing Settings-sidebar agent selection and the
personal_instructionschat tool share the same narrow authenticated-self API rather than widening general file-tool access. The canonical profile and path come from the live connection or the exact host-issued original-requester authority of an admitted chat turn—not session ownership, tool arguments, or a copied profile on a synthetic client. Safe filesystem operations reject aliases and recheck the source, run, scope, role, Gateway, and workspace before mutation. Other personal APIs retain their existing synthetic-caller restrictions.Saves require the loaded content hash and use the existing workspace save queue. Conflicts with independent host editors remain best effort, matching the shared editor: avoid simultaneous UI and host-process edits. Failed requests and transient reconnects retain the draft without exposing it under a different profile or Gateway. Changing the Settings agent retains unsaved drafts separately for each agent; it never retargets an in-flight save.
Evidence
Current follow-up: Profile spacing and startup budget (
35636541ffe6bd8e1e252637953c68f5abd7a585)35636541ffe6bd8e1e252637953c68f5abd7a585, including the repaired performance gate and iOS/Android lanes. ClawSweeper: Revision 15 is ready on that same head, with no findings, no security issues, and nothing listed before merge. Older receipts below belong to their named earlier heads. Deployment is not part of this change.Final landing audit (September 23; unchanged head
35636541ffe6)5706a0626359b52daa5feb12fe98c260153525c3; the Profile heading and shell callback changes remain intact. Live rules do not require strict up-to-date status; required CI is green, with no pending/failed check.Measured cost of all changed test suites
All 17 suites passed again with
pnpm test <file> --maxWorkers=1(172.99 s total sequential command wall). Local wall includes wrapper/compiler/import/setup cost and mixed cold/warm compiler generations. Hosted numbers below sum the rounded per-case durations reported by the completed exact-head CI run; they exclude job setup/import/teardown and are not directly comparable to local wall time. The extracted reconnect helper runs within the existing handshake suite and adds no separate CI invocation.src/agents/bootstrap-files.memory-core.test.tssrc/agents/bootstrap-files.personal.test.tssrc/agents/openclaw-tools.registration.test.tssrc/agents/sandbox-explain.test.tssrc/agents/subagents/requester-cron-authority.test.tssrc/agents/tool-catalog.test.tssrc/gateway/method-scopes.test.tssrc/gateway/server-methods-list.test.tssrc/gateway/server-methods/tools-catalog.test.tssrc/gateway/server-methods/users-personal-file.test.tssrc/gateway/server/ws-connection/message-handler.post-connect-health.test.tssrc/state/user-profile-list.test.tsui/src/lib/agents/tool-catalog.test.tsui/src/pages/config/settings-search.test.tsui/src/pages/config/settings-targets.test.tsui/src/pages/profile/personal-instructions.test.tsui/src/pages/profile/profile-page.test.tsThe real in-process dispatch and safe-filesystem suite justifies integration cost by exercising requester forwarding and the actual filesystem mutation guard; mocking that boundary would not prove it. UI races use deferred promises rather than timers. Existing handshake cases reuse their existing harness; the PR adds authentication assertions rather than extra Gateway boots. Cold bootstrap compilation accounts for 93% of the 30.28 s Vitest duration in the Memory Core proof, versus approximately 2% test-body time; no runner tuning is proposed.
Test-performance check: Same-host, same-command handshake-suite baseline on current main passed 59/59 in 40.23 s wall; the PR passed the same 59 cases in 23.41 s wall. Compiler generations/cache warmth differ, so the 16.82 s wall difference is not claimed as a product speedup. The changed owner-reconnect case remains in the existing suite (0.805 s on the PR); no new server lifecycle or recurring test invocation was introduced. No source or runner changes were made during this diagnostic.
Earlier single-user correction (head: 3b50236)
The branch is synchronized with main
1dd82fa0d398e24f6885baae7e0b437e3cbb0ea0. Main's profile-reader extraction and binding/catalog lifetime changes are preserved; the multi-user facade uses the resident catalog and the SQL selector lives with the new read owner. All 15 focused suites passed on the combined candidate (103.55 s command wall), including main's resident-profile regressions. The final extraction also passed 27 focused identity/bootstrap tests and the two-case count test. Core/UI production and affected test types, scoped lint, import cycles, formatting and the file-size ratchet pass. The captured Profile component andprofile.cssare unchanged by this synchronization.The full-candidate review raised an empty-scope shared-owner P2; source tracing disproved its premise. The dispatcher still requires explicit method scopes, and device-less shared authentication deliberately clears unbound scopes. System-role attribution bypasses named-role policy, not method scopes. Granted owner flows and rejected zero-scope callers are covered; no permission check was loosened to satisfy that finding.
USER.md, API rejection before creating any personal file, revocation at the filesystem mutation boundary, resident-catalog/merge parity, conditional tool registration, hidden single-user UI/search, and retained multi-user editing.users.personalFile.*requests. The same production UI with the multi-user policy enabled completed the read/edit/save flow. Matched single-user before/after.tools.cataloghandler, explicit multi-user visibility, and capability-unknown UI fallback. The broader core/UI typechecks, all core-test type graphs, lint, format, dead-export, storage, and import-cycle checks passed for the first correction; production and affected test types/lint are checked again for this follow-up.3b50236877e; prior-head green checks are not attributed to this head. Earlier CI/review receipts below belong to their named historical heads, not this correction. This PR remains unmerged.Earlier implementation and UI verification (historical heads)
The latest UI correction
dbd6704fd4cremoves the duplicate selector and follows the existing Settings-sidebar agent selection. The inspected before/after correction shows the one-selector result. Fourteen focused editor tests pass (2.09 s command wall), including agent switches, separate unsaved drafts, identity clearing and stale responses. UI production/test types, localization, targeted lint and Control UI build pass; isolated autoreview found no P2+ issue. The full UI CI ondbd6704fd4cfound an older Profile test fixture missing the app-owned Settings selector. Commit75ce28e5cbbsupplies that fixture: the identical local suite failed before repair, then both focused Profile suites passed 33/33 in 3.07 s command wall. No product or authorization change followeddbd6704fd4c. ClawSweeper Revision 7 then identified an undo-and-switch draft-cache defect introduced by the UI correction. Commit9a9c4a83799fixes it by consuming restored cache entries and deleting clean outgoing entries. The new repeated A→B→A undo→B→A regression and both Profile suites pass 34/34 (3.09 s command wall), with UI production/test types, formatting, focused lint, and fresh isolated P2 autoreview clean. Current UI follow-upf0e9a97139fkeeps the seven-row Profile textarea at its existing 142 px default while 2,954 characters scroll inside it; a real Chromium drag of the native handle grows it to 237 px. The existing auto-load runs when Profile opens or the Settings agent changes, without an additional request. The routine Reload button is hidden; a recovery Reload remains after a read/save error and still asks before discarding a draft. The focused Profile suites pass 36/36; UI production/test types, scoped lint, stylelint, formatting, local scoped review and actual browser geometry proof pass. Exact-head CI run 35802229691 completed success (156 jobs, zero failed;openclaw/ci-gategreen), and the PR check rollup is clean. ClawSweeper Revision 11 reviewedf0e9a97139fcb20b943b935517bc1152df724e42as ready for maintainer review with no actionable findings. Previous green checks and reviews below remain attributed only to their own commits.Historical UI polish
bb5798db513removes the repeated visible heading inside the Profile editor card while retaining a translated accessible name and guidance for the textarea. The production component’s mocked read/edit/save flow and 35/35 focused Profile tests pass; production/test UI types and targeted lint pass. Exact-head CI run 35799432463 completed success, all 148 jobs andopenclaw/ci-gategreen. ClawSweeper Revision 9 reviewed exact headbb5798db5134015d3e44f0faa68f17f8039ec39cas ready for maintainer review, with no actionable findings. That previous head’s check rollup had no failures. Historical checks and reviews below are attributed only to their own heads.Historical evidence: ClawSweeper Revision 8 reviewed exact head
9a9c4a837996dfb81e1329ff140217c03f8a283f: the P2 is resolved and there are no actionable findings. Exact-head CI run 35796428474 completed failure (openclaw/ci-gateis red), so that prior head was not CI-green or ready to land. The three underlying failures are outside the changed paths: new-session GitHub-project E2E timed out waiting for a mocked Gateway request; local isolated replay stopped at the environment’s loopback HTTP 502 preflight, without reaching the test (proxy policy was not weakened). Plugin-state overlap failed two timing assertions, while an isolated single-worker replay passed 15/15; session-groups rename observed a competing state-lifecycle owner instead of the expected changed-state error, while an isolated single-worker replay passed 28/28. None of those isolated passes proves a fix; the test sources are unchanged by this PR. No unrelated implementation or guard was changed to manufacture green CI.The superseded
dbd6704fd4cCI run also saw two other failures outside this UI diff: plugin-state worker overlap assertions in a compact shard (job) passed all 15 tests in a single-worker local replay but are not claimed fixed; the macOS native suite (job) reported the unrelated “browser sign-in cookie is installed before the first dashboard navigation” failure in its retained Swift log, which was not runnable on this Linux host. Neither suite has changed in this PR. A later superseded head75ce28e5cbbhad an unrelated Discord durable-ingress duplicate-send assertion in an extensions shard (job); that unchanged suite passed both tests in a single-worker replay (26.14 s command wall). Neither isolated replay proves a fix; current-head CI will provide the next comparable result.The preceding head
d5cb33c922cpassed the full CI run and ClawSweeper Revision 4 found no actionable findings. The prior headc515323c9cfresolved subsequent main conflicts on2e07e9a5de86: existing method order is preserved, Kotlin is regenerated, and the owner-reconnect test retains upstream’s awaited attachment fixture plus the reviewed authority assertions. Range-diff confirms the chat implementation and requester-lifetime fix are patch-identical. All 132 focused personal-file, protocol-list, and handshake tests pass after this rebase (56.55 s command wall); full protocol generation/vintage checks and focused type-aware lint also pass. Prior-head verification (c515323c9cf) complete: CI run 35701457006 passed, including the iOS simulator checks;openclaw/ci-gateis green. ClawSweeper Revision 5 reviewedc515323c9cf02bf87fad0c002acd830c4c705636and reports no actionable correctness or security findings.The remaining Gateway failures were repaired at their owners: metadata-only internal handoffs no longer inspect transport fields before checking the authentication attestation; an explicitly yielded requester now retains its original operator restriction until its committed child cohort settles. Revocation, reset, failed persistence, and repeated denied retries release/fence that source rather than falling back to unrestricted dispatch. This does not grant Cron management permission.
The real
chat.reset-visible-yield.test.tsreproduced the expired-source failure, then passed both reset and completion cases in the same approved offline container. Source-only lifetime/revocation regressions pass (30 cases), including repeated denied retries and failed-persistence cleanup. Production/targeted test types, protocol generation/vintage/order, import-cycle checks, scoped lint, and a full frozen-sourcepnpm buildpass (3m 39.6s). The Matrix Doctor case also passed in that isolated refreshed candidate (44.57 s test execution); that is a bounded replay, not a claimed fix for the prior timeout.personal_instructionsallowed and general write/exec tools absent.operator.read, edits and saves through the production component, and checks that the wire request contains only agent, content, and expected hash. No live Gateway state was changed.c515323c9cf; the current exact-head results are linked above.operator.writescope attenuation and authenticated local-owner ingress. The repair binds verified source+subject across narrower grants, retains both liveness checks, and captures shared-owner identity only from authenticated real transport ingress. Read/write/admin callers, device-token reconnects, source retirement, and anonymous/synthetic/node rejection are covered.offline → connected/no profile → same profilenow restores the private draft, while a different confirmed profile replaces it. The regression failed before the fix and passed afterward.Measured single-worker cost (
pnpm test <file> --maxWorkers=1): backend suite 27.11 s wall with a cold compiler cache (22 tests, under 0.2 s test execution); editor suite 3.73 s wall (12 tests, under 0.2 s test execution). The combined 54-test UI run took 4.52 s wall. Expanded chat-boundary suite: 30 tests, 23.17 s command wall, including 3.13 s for the first real in-process dispatch and milliseconds for subsequent cases. That one-time dispatch cost verifies the actual authority-forwarding path rather than only a mocked handler.Initial-head CI exposed two separate failures:
chat-model-controls.e2e.test.ts(account-picker viewport bound) and Matrixdoctor-contract-api.account-state.test.ts(100-second child-exit guard). Logs were inspected. The Matrix failure did not reproduce on the unchanged base (1 test passed, 100.75 s command wall; child test 49.65 s), which does not prove a fix. The UI replay was blocked before execution by the host loopback proxy, then by the approved isolated launcher’s native-pnpm compatibility check; no proxy or isolation policy was weakened. Current-head CI status is noted above.Before
After
Follow-up: remove the repeated label inside the editor
Before
After
Follow-up: bounded editor and contextual reload
Before
After
Worked on by
Work sessions
Final recovery, verification, and publication continued directly in the original discussion after the implementation session was archived.
View the OpenClaw team session