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: blocked before merge. What this changesAccept generated API-key markers only when the matching canonical provider configuration owns the exact environment reference. Example: A custom provider references ${FACTCHAT_API_KEY}, and its generated models.json stores FACTCHAT_API_KEY.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a current audit false positive with a focused change and no actionable code findings; current-head maintainer security approval remains required. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe secrets audit reads configuration provenance and generated model catalogs, classifies credential residues, and returns findings and CLI exit status. flowchart TD
A[Provider configuration] --> B[Config loader and provenance]
A --> C[Model catalog writer]
C --> D[Generated model catalog]
B --> E[Secrets audit]
D --> E
E --> F[Findings and exit status]
Technical reviewBest possible solution: Preserve the catalog format and use existing provider ownership and loader provenance to classify exact env markers. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the false-positive path, and supplied CLI before/after results demonstrate it through secrets audit; no target code was executed during this review. Is this the best way to solve the issue? The patch is the smallest complete repair: it reuses canonical provider selection and recorded reference provenance without introducing a parser, state store, serialization change, or global marker heuristic. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 416f43f345c5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +18, Tests +46, Other +2. Total +66 across 3 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
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 HistoryReviewed November 1, 2026, 10:03 PM ET / November 2, 2026, 03:03 UTC (Revision 3). |
|
@clawsweeper re-review Head 49bcc58 adds complete runSecretsAudit regressions for populated include ownership and canonical/losing aliases. Base: 2 expected failures / 28 passes; candidate plus writer suites: 46 passes. The built production CLI now gives exit 0 / plaintextCount 0 for the owned include marker; losing-alias and cross-provider controls still give exit 1 with exactly two findings. Type, import-cycle, lint, formatting and ratchet checks passed. The body records the initial local review's missing unchanged-owner context and the supplemental helper's sensitive-path refusal before reviewer startup; that guard was not bypassed and no complete-context local review is claimed. This remains Draft while the hosted review reassesses the source and actual CLI evidence. |
|
🦞👀 Re-review progress:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
@clawsweeper re-review Please review current head |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Generated
models.jsonintentionally stores an env SecretRef variable name as its API-key marker.openclaw secrets audit --check --jsonincorrectly reports a custom marker such asFACTCHAT_API_KEYas plaintext even when the same configured provider owns that exact reference.Fixes #121543. Related to #87723.
User Impact
Source-owned custom env markers no longer produce misleading plaintext warnings. Other providers, sensitive headers, losing aliases, and literal credentials retain their findings.
Why This Change Was Made
The audit reuses the writer’s
normalizeSourceProviderLookupandresolveConfigSecretRef(..., includeResolved: true). It first selects the canonical source provider, then exempts only that provider’s API key when its exact value equals the owning env-reference ID. This preserves provenance through populated shorthand and$includeresolution without adding another parser or changing serialization.Credit to @cho2559 for the report, @SebTardif (#121578), @wangmiao0668000666 (#121594), @LiuwqGit (#121633), and @Alix-007 (#87873) for earlier work. All four earlier PRs are closed without merging; #121578’s closing discussion invites a fresh repair. This implementation addresses the populated-include, canonical-winner, and import-cycle concerns in those discussions. Merged #97622 covers known markers on the config audit surface and does not resolve this custom-provider case. The issue comments and related PR discussions were read in full; no active replacement was found.
Evidence
b703c84a84c947e198b6a683408a3ddaba9179c4gives 2 failed / 28 passed. Only the owned populated-include marker and canonical winning env marker fail. The PR passes 30/30 audit tests; cross-provider, header, losing-alias, and literal-winner controls remain covered.node scripts/run-vitest.mjs src/secrets/audit.test.ts src/agents/models-config.runtime-source-snapshot.test.ts src/agents/models-config.merge.test.ts --maxWorkers=1: 46 tests passed across 3 files, 189.1 s total including isolated worker preparation. The infra project took 107.7 s and the writer merge project 16.7 s. The four new audit cases took 7.6 s; they use the existing real config/SQLite audit fixture rather than a second mocked loader.pnpm --silent openclaw secrets audit --check --jsonon an isolated populated$includefixture goes from base exit 1 / plaintextCount 1 to PR exit 0 / plaintextCount 0. Running the builtnode openclaw.mjs secrets audit --check --jsonwith a losing alias and an unrelated provider still exits 1 and reports exactly those two paths (providers.openai.apiKey,providers.unrelated.apiKey). Both runs use the real config loader and audit command; the on-disk generated catalog is a synthetic fixture. The repository runtime build completed successfully.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo: passed. The test shardnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.agents-tools.json --incrementalalso passed.node --import ./scripts/tsx.mjs scripts/check-import-cycles.ts: passed. Format, focused lint,git diff --check, and the test-line ratchet passed. The prepared parent comparison uses--no-merge-basebecause this isolated checkout is shallow. The unique allocation grants exactly the 46 net new regression lines, without changing a baseline scalar.autoreview --mode local --base b703c84a84c947e198b6a683408a3ddaba9179c4 --max-priority P3: scoped-clean, no actionable findings in the selected patch and supplied provenance/provider-owner context. Its report explicitly states that unchanged audit and loader context was unavailable; it did not execute tests. A supplemental run attempted to supply the complete audit and snapshot owners, but the helper refused--dataset src/secrets/audit.tsas a sensitive path before starting a reviewer. That guard was not bypassed. No complete-context local review is claimed. The historical hosted review of head49bcc58fafbed6919682fc1d1cf6ed702cace91ainspected the audit, canonical provider, loader provenance and original security intent, accepted the CLI evidence, and recorded no findings / ready for maintainer review. Its durable review comment was marked stale after integration, then refreshed on November 2, 2026 at 03:03 UTC for current head612d5e981b45d6f01b5490fdd536fe0498c222d4. That current-head review reports no actionable findings, accepts the supplied production CLI proof, and remains blocked only on an authorized maintainer's required security-sensitive-change approval. It does not replace that approval; the older49bcc58fafbed6919682fc1d1cf6ed702cace91averdict remains historical evidence. All 116 checks observed on historical head49bcc58fafbed6919682fc1d1cf6ed702cace91awere complete without failure before marking Ready. The simplification pass retained the existing owners and the one-file +18/-0 production change.Validation uses Node 24.22.1, repository-pinned dependencies, isolated config/state, and synthetic values. No real provider request, external tenant, Windows-specific behavior, or full repository test-suite result is claimed. AI-assisted implementation, regression work, and independent review.
Prior-head CI limitation
The typecheck job for that prior head failed with
TS2353intest/scripts/full-release-validation-at-sha.candidate.test.ts:335:releaseRefis absent from the fixture options. Its synthetic merge8dfa309eused mainbe0d5c97b500a5762145a9b0ca4b073450ef6b37. Both failing test and fixture are byte-identical on that main and merge (Git blobs91fe9bfb50b720cf691cf5a0187547b05dd379b2/5dbec4d665cdd81a3d5c690bb188614165234d3e). Running the same root-scripts graph on unmodified mainadb3500df87603a849f1a965c6fc23ce269c25dbwithOPENCLAW_LOCAL_CHECK=0 node scripts/run-tsgo-core-test-shards.mjs --root-stripe 2/4reproduces the identical diagnostic (exit 2, 14.5s). This is inherited CI failure evidence; no check, fixture, or approval policy is bypassed. Other test checks on that recorded head completed without failures.Upstream baseline synchronization
Merged pinned upstream main
50c3ff63fcd42100dbf0bd0ff677c759ffee3178into this existing branch to include #187339, merged at230619948b35fedb88bf5dbc528c7fd3f2fb07df. That accepted upstream change removes the unsupportedreleaseReffixture option and makes the existing branch/tag resume cases select their intended CLI ref; no check rule or product behavior was weakened.The prior
check-test-types-core-3failure was the sametest-root-scriptsTS2353 reproduced on old main. The upstream PR's exact root scripts graph passed in 11.3 seconds; #184319's later run of the same graph also passed in 14.3 seconds after taking the corrected upstream base. The local canonical--root-stripe 2/4command additionally passed at main9a3bf9584db0d1f6be90e46d0224d228118fc3b6(3.15 seconds wall), with the affected fixture and graph-owner bytes unchanged.This is a real two-parent merge of original head
49bcc58fafbed6919682fc1d1cf6ed702cace91aand pinned main, previewed with Git's three-way merge and the verified historical merge baseb703c84a84c947e198b6a683408a3ddaba9179c4. All PR-owned file blobs are unchanged by this merge. The earlier product tests/runtime captures above remain evidence for those original owner bytes and their recorded base; they are not presented as tests of this entire new merged candidate. No additional local tests or builds were run for this synchronization. New-head hosted CI/review is pending.Hosted CI after upstream synchronization (2026-10-29T07:53:58.459Z)
Current head
612d5e981b45d6f01b5490fdd536fe0498c222d4passedcheck-test-types-core-3, so the formerreleaseRefTS2353 failure is cleared on this exact published head. The requiredopenclaw/ci-gatecompleted successfully. The independent security-maintainer approval is still required for this current SHA; this CI result is not that approval. No new product changes or local tests/builds were made for this status check. Prior runtime proof retains its recorded source scope, and existing hosted source-review comments are not relabeled as new-head reviews.