Repository navigation
fix(models): avoid persisting prompt-visible provider secrets - #83592
1507819106zxzx-crypto wants to merge 4 commits into
Conversation
|
Codex review: found issues before merge. Reviewed July 1, 2026, 2:22 AM ET / 06:22 UTC. Summary PR surface: Source +194, Tests +192. Total +386 across 7 files. Reproducibility: yes. Source inspection shows current main writes root and plugin-owned generated model catalogs, and the PR body supplies after-fix terminal output for the planner path that strips plaintext apiKey and sensitive headers. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one maintainer-selected Layer 1 implementation that sanitizes both root and plugin-owned generated catalogs while preserving a non-secret runtime-auth/loadability contract for custom providers. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main writes root and plugin-owned generated model catalogs, and the PR body supplies after-fix terminal output for the planner path that strips plaintext apiKey and sensitive headers. Is this the best way to solve the issue? No. The direction is useful, but this branch is stale against the current catalog writer split and must preserve or prove a safe runtime-auth path before it is the best fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0c7bac34ae68. Label changesLabel justifications:
Evidence reviewedPR surface: Source +194, Tests +192. Total +386 across 7 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
453bb51 to
c963d1f
Compare
c963d1f to
f0948f5
Compare
|
Updated per review:
Validation:
@clawsweeper re-review |
|
Follow-up for the new doctor shard failure after CI reran:\n\n- updated the doctor migration test plugin registry mock to include the current diagnostics field\n\nAdditional validation:\n- node scripts/run-vitest.mjs run --config test/vitest/vitest.commands.config.ts src/commands/doctor-legacy-config.migrations.test.ts\n- node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-core.config.ts src/agents/models-config.runtime-source-snapshot.test.ts src/agents/models-config.applies-config-env-vars.test.ts src/agents/models-config.providers.normalize-keys.test.ts src/agents/models-config.merge.test.ts\n- node_modules\.bin\oxlint.CMD src/agents/models-config.plan.ts src/agents/models-config.runtime-source-snapshot.test.ts src/commands/doctor-legacy-config.migrations.test.ts\n- git diff --check |
|
All latest head checks are green after the follow-up fixes on f879e13. The branch now includes the provider-runtime mock export, source-managed env apiKey marker preservation, and the doctor registry diagnostics mock update.\n\nLatest validation already posted above:\n- doctor migration shard: 49 passed\n- models config shard: 38 passed\n- oxlint: 0 warnings/errors\n- git diff --check: clean\n\n@clawsweeper re-review |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
Real behavior proof
Behavior or issue addressed: Provider credentials that are needed for runtime auth should not be duplicated into the prompt-visible models.json catalog when they are new plaintext apiKey values or sensitive header values.
Real environment tested: Local OpenClaw checkout on Windows 11, Node v24.13.0, pnpm 11.1.0, running the patched source through tsx against a real config-shaped provider entry.
Exact steps or command run after this patch: Ran a tsx script that calls the patched models.json planner with a custom provider containing plaintext apiKey, Authorization, and X-Api-Key values plus an OpenAI provider using non-secret markers.
Evidence after fix: Copied terminal output from that local run:
Observed result after fix: The new plaintext provider apiKey was absent, the plaintext Authorization and X-Api-Key headers were removed, the safe X-Tenant header remained, and the non-secret env/SecretRef markers were preserved.
What was not tested: Full live provider request execution was not re-run; this PR only proves the persisted models.json planning path.
Validation
Refs #11829 (Layer 1 only; does not close the broader security roadmap).