Repository navigation
fix(secrets): fail closed for configured references - #127669
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 8:45 PM ET / August 22, 2026, 00:45 UTC. ClawSweeper reviewWhat this changesThis PR makes configured SecretRefs authoritative across Gateway, provider, and selected channel credential paths so an unavailable reference cannot silently use an unrelated ambient credential. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo blocking correctness finding at the current head. The PR repairs the prior reviewer’s slow-progress stream coverage and consistently makes unavailable configured SecretRefs stop rather than borrow ambient credentials; it remains open because it is maintainer-labeled and exact-head CI/Testbox preparation is still pending. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGateway, provider, and channel credential resolvers turn configuration and environment inputs into credentials for startup, probes, discovery, and outbound actions. The changed boundary records an unavailable configured reference and prevents the affected action before authentication or network I/O. flowchart LR
A[Config and environment] --> B[Credential resolver]
B --> C{Configured reference available?}
C -->|Yes| D[Use configured credential]
C -->|No| E[Record unavailable owner]
E --> F[Stop probe startup or send]
D --> G[Gateway provider or channel action]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -95, Tests +1035. Total +940 across 50 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: Land the single fail-closed ownership rule after exact-head CI and Testbox confirm both configured-reference failure and no-reference legacy precedence across the affected Gateway and plugin paths. Do we have a high-confidence way to reproduce the issue? Yes: current-main source shows the fallback after an unresolved configured reference, while the PR’s focused Gateway and plugin tests encode the competing ambient-credential scenario. Is this the best way to solve the issue? Yes: centralizing the fail-closed result at the configured-secret resolver and enforcing it at owner boundaries is preferable to scattered downstream fallback guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0a704810e411. 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
HistoryReview history (3 earlier review cycles)
|
Keep explicit SecretRefs authoritative across Gateway auth, onboarding, probes, channel credentials, outbound sends, and GitHub Copilot discovery/embeddings. Ambient credentials remain available only when no reference owns the surface.
17c2f8d to
77646b4
Compare
|
Land-ready proof for
Proof gap: no authenticated third-party channel/provider account was used; the deterministic owner-selection invariant is covered by boundary tests, exact-head CI, and the isolated Gateway process proof. |
|
Merged via squash.
|
* fix(secrets): fail closed for configured references Keep explicit SecretRefs authoritative across Gateway auth, onboarding, probes, channel credentials, outbound sends, and GitHub Copilot discovery/embeddings. Ambient credentials remain available only when no reference owns the surface. * test(secrets): align gateway fallback expectations * test(providers): remove load-sensitive stream timing * test(xai): normalize stream capture failures * fix(copilot): preserve direct auth precedence * test(ollama): keep progressing streams alive * test(models): mark resolved config fixtures * fix(models): drop stale probe import
What Problem This Solves
Fixes an issue where an explicitly configured SecretRef that was unavailable could be discarded and replaced by unrelated ambient credentials. This affected Gateway password onboarding and probes, Buzz credentials, the default IRC password, the default Nextcloud Talk bot secret, and GitHub Copilot discovery and embeddings.
Why This Change Was Made
Explicit SecretRefs now remain authoritative across the shared Gateway, probe, provider, channel-account, and outbound-selection boundaries. Historical environment, plaintext, and credential-file precedence remains unchanged when no SecretRef owns the exact credential surface. The repair absorbs duplicated policy into the owning boundaries and is net-negative production code.
AI-assisted: yes.
User Impact
When a configured secret backend is unavailable, OpenClaw no longer authenticates, probes, discovers, embeds, or sends as an unintended account using an ambient fallback. The affected owner instead reports a redacted unavailable state and performs no outbound action. Existing configurations without SecretRefs retain their shipped precedence.
Evidence
OPENCLAW_GATEWAY_PASSWORDexited before listening, did not log the ambient credential, and reported the SecretRef failure.34b28a30ae5c55eb233c0654fbaf73753038290e: https://github.com/openclaw/openclaw/actions/runs/32541049227OPENCLAW_TESTBOX=1 scripts/pr prepare-run 127669passed withhosted_exact_or_recent_parentgates and verified the remote PR tree matches the prepared head.