Repository navigation
fix(auth): honor shared-store ownership in temp-state exec and agent deletion - #130437
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
…deletion Two follow-ups from #130264: agent exec temporary state now preserves the original shared auth root, so temp-state runs read-through portable static profiles (local precedence and cooldowns preserved, no inherited-secret copies); and agent deletion safety consults resolveSharedAuthStoreOwnership, so the implicit legacy main owner is protected only while the legacy store owns credentials — post-relocation main is deletable and shared credentials provably survive. Explicitly bound inheritance owners stay protected.
7e0c6a4 to
8a8ea8d
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 6:11 PM ET / 22:11 UTC. ClawSweeper reviewWhat this changesThe PR lets temporary Merge readinessThis maintainer-owned PR remains necessary: current main repoints temporary exec state before preserving the original shared-store root, while the branch adds the bounded read-through and aligns both deletion entry points with the ownership fact. No blocking correctness defect was found in the reviewed patch. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTemporary flowchart LR
A[Operator configuration and shared state] --> B[Agent exec request]
B --> C[Capture original credential-store root]
C --> D[Bounded portable credential read-through]
D --> E[Temporary agent run]
A --> F[Agent deletion request]
F --> G[Shared-store ownership decision]
G --> H[Delete agent or return protection error]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +60, Tests +213, Docs +2. Total +275 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one scoped shared-store view for temporary execution and one ownership predicate for CLI and Gateway deletion, with regression coverage for legacy ownership, relocated ownership, explicit bindings, local precedence, and OAuth exclusion. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: current main changes the temporary state root before retaining it for auth, while its scoped auth mode contains no shared-store view. The branch’s focused tests encode the state-DB reproduction, though this read-only review did not execute them. Is this the best way to solve the issue? Yes. The patch reuses the established ownership fact, scopes static-profile read-through to the temporary operation, and keeps explicit inheritance protection intact rather than adding a persisted copy or fallback reader. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3fe6e5821ba7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (26 commits) fix(plugins): preserve registry epoch on activation rollback (#129232) refactor(plugins): make discovery invocation-owned (#130486) feat(ui): save appearance preferences per user profile (#130340) fix: Buzz bots recover relay stalls and reject revoked senders (#130467) fix(code-mode): serialize catalog handles nested in final values (#130276) fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427) fix(agents): read the published model catalog owner from session_status (#130277) fix(channels): preserve long presentation text (#130368) fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325) refactor(plugins): unify setup registration and artifact selection (#130474) fix(memory): prevent forgotten session content from returning (#130451) refactor(outbound): consolidate transport completion (#130460) fix(workers): protect in-flight workspace manifests from concurrent retention (#130449) fix(portals): keep worker previews reachable and owned by the active environment (#130434) fix(config): keep core channels keys in the generated config schema (#120736) chore(deps): refresh dependencies after seven-day cooldown (#130296) fix(agents): remind exec models to quote shell metacharacters (#125485) fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437) fix(openshell): preserve file writes during concurrent mirror commands (#130447) fix(workers): report full nodes as at capacity, not offline (#130445) ...
…deletion (openclaw#130437) Two follow-ups from openclaw#130264: agent exec temporary state now preserves the original shared auth root, so temp-state runs read-through portable static profiles (local precedence and cooldowns preserved, no inherited-secret copies); and agent deletion safety consults resolveSharedAuthStoreOwnership, so the implicit legacy main owner is protected only while the legacy store owns credentials — post-relocation main is deletable and shared credentials provably survive. Explicitly bound inheritance owners stay protected.
What Problem This Solves
Two ownership gaps recorded on #130264 after the shared-auth-store read-through fix landed:
agent execwith temporary state dropped the original shared-store root, so temp-state runs could not read-through shared credentials — a temp exec silently lost model auth the normal runtime resolves.agents/main) as an undeletable credential owner even afteropenclaw doctor --fixrelocated credentials to the shared store — contradicting the documented contract that the agent is undeletable only until relocation.Why This Change Was Made
docs/auth-credential-semantics.md), local precedence and cooldowns preserved, no inherited-secret copies into temp state.resolveSharedAuthStoreOwnershipfact the runtime inheritance uses: legacy ownership keeps the protection; post-relocation the implicitmainis deletable like any agent, and shared credentials provably survive its deletion. Explicitly bound inheritance owners (agents.defaults.authInheritance.agentId) remain protected regardless.Both fixes reuse the landed ownership fact — no new probes, no fallback readers. Net-negative overall diff.
User Impact
Temporary-state execs resolve shared API keys like normal runs; after doctor's relocation, operators can delete the retired implicit main agent without a misleading "owns the shared auth store" refusal — and deletion can never orphan live credentials.
Evidence
Both regressions verified failing pre-fix (temp-state exec resolving a shared api_key profile; post-relocation main deletable / pre-relocation protected / credentials survive). 303 tests across 11 focused files green;
pnpm check:changedgreen; Codex autoreview clean (0.97). Full validation report retained in the branch workspace.Context: #130264