Repository navigation
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. What this changesExtend private-store permission repair to managed GitHub identity profiles and enrolled Codex worker bundles after an fsGroup remount. Example: A PVC remount leaves codex-runtime at 2770 and its files at 0660.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete omission that remains on current main, with no discrete patch defect found; failed CI checks still need attribution before landing. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway startup and admitted Doctor repair normalize installation-owned private stores before their credential and worker readers enforce private permissions. flowchart TD
A[PVC remount widens modes] --> B[Gateway startup or admitted Doctor repair]
B --> C[Existing private store repair owner]
C --> D[SQLite stores]
C --> E[Managed GitHub profiles]
C --> F[Codex runtime bundle]
E --> G[Strict private store readers]
F --> G
Technical reviewBest possible solution: Extend the existing descriptor-bound repair owner to the omitted store families while preserving strict downstream admission and shared-root permissions. Do we have a high-confidence way to reproduce the issue? Current-main repair omits both store families, whose production readers explicitly reject the widened modes; the contributor also supplies stable-to-candidate CLI evidence, but no target code was executed during this review. Is this the best way to solve the issue? The change repairs the omission in the existing owner, retains its descriptor admission, and adds bounded discovery rather than a competing repair mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against efb5ee7e7e61. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +159, Tests +130, Docs +11, Other +13. Total +313 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label 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 HistoryReview history (9 earlier review cycles; latest 8 shown)
Reviewed November 10, 2026, 4:57 AM ET / 09:57 UTC (Revision 10). |
1930553 to
c2a89ef
Compare
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
c2a89ef to
87840c9
Compare
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
a66b709 to
23e572d
Compare
6bb52d9 to
23e572d
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
48258d1 to
6ff4b85
Compare
0bd2f21 to
c321c03
Compare
What Problem This Solves
After a Kubernetes PVC remount with
fsGroup,openclaw gateway runrepairs the SQLite credential store but a managed GitHub identity still failsgit push("Reconnect or change GitHub Identity") andcodex.app-serverreportsWorker Codex configuration directory is unsafe. The startup repair enumerated.update-captures,client/credentials.sqlite, andcontrol/services.sqliteonly — managed GitHub profiles at<stateDir>/credentials/github/<scope>/<profileId>and Codex runtime bundle at<stateDir>/codex-runtimewere never on the list, so after remount they stay2770/0660and their owners refuse to open them.Solution
Extend
restorePrivateStateStoreModesto enumerate both minted-store families through their owners' naming contracts:credentials/github/system,personal, and every 64-hex hashed agent key underagents/<key>, then generations matchingisManagedGitHubProfileId(ghp_[a-f0-9]{32})<stateDir>/codex-runtime(direct child, its own descriptor admission already refuses aliases)Each minted store is restored as a whole: directory first (descriptor-bound,
O_NOFOLLOW, uid-match), then every regular file directly inside. A newnamesPlainDirectoryChainSyncrefuses symlinked ancestors above the store so an alias atcredentialsorcredentials/githubcannot lend the repair to another tree.User Impact
Kubernetes/Podman installations whose PVC was remounted keep their managed GitHub identity and enrolled Codex worker — no reconnect, no re-enroll. Unaffected installations see no change.
Evidence
All runs use the shipped
openclaw doctor --non-interactive --repair, invokingensureOpenClawStatePermissionsviadoctor-config-preflight.ts:100andgateway-lock.ts:531. Fixture: isolatedOPENCLAW_STATE_DIRwith SQLite stores, one managed GitHub identity per scope (system/personal/agent-key), codex-runtime bundle, widened to2770dirs /0660files exactly as kubelet applies on remount.Driver-lane upgrade proof (GHA)
Run: oc-privatestore-upgrade-proof/actions/runs/42773528559 on
ubuntu-24.04(glibc 2.39). Driver =[email protected](latest-stable), candidate = tarball built from PR headfdd83603.state/openclaw.sqlite*(control)0600✅ repaired0600✅ repairedclient/credentials.sqlite(control)0600✅ repairedcontrol/services.sqlite(control)0600✅ repairedcredentials/github/system/<ghp_*>2770/0660❌ NOT repaired0700/0600✅ repairedcredentials/github/personal/<ghp_*>2770/0660❌ NOT repaired0700/0600✅ repairedcredentials/github/agents/<key>/<ghp_*>2770/0660❌ NOT repaired0700/0600✅ repairedcodex-runtimebundle2770/0660❌ NOT repaired0700/0600✅ repairedUpgrade output:
openclaw update --tag file:<candidate.tgz> --yes→ exit 0, package-install 27.8s, updater-runtime-retention 23.5s, candidate-doctor 11.2s, database snapshot 0.047s.Data retention after upgrade: All hosts.yml intact (
proof-system-user,proof-personal-user,proof-agent-user), all credential markers present (proof-credential-marker-*-20261110), codexconfig.json/bundle.marker/worker-0.pidunchanged.VERDICT: PASS — stable driver reproduces the exact omission (controls repaired, minted stores still widened); candidate restores every private store while retaining all credentials and runtime data.
Symlinked ancestor refusal
19305539fdd83603credentials→ external tree holdinggithub/system/<id>credentials/github→ external tree holdingsystem/<id>Regression tests
Extended
src/state/openclaw-state-db-permissions.test.tsin place (98 net lines):5d89656a2bd:expected 1528 to be 448(0o2770vs0o700)fdd83603:14 passed (14)config/test-lines-allocations/fsgroup-remount-minted-stores.txtCI attribution (pre-existing)
checks-fast-baseline-ratchets(test-lines over)checks-node-changed-compact-large-22-3sessions.forkAssertionError inserver-methods/sessions-rewind.storage.test.ts— imports no module fromsrc/state/. No changed path intersects this file.