Repository navigation
Strip apiKey fields from generated models.json - #84465
javi-codeworks wants to merge 1 commit into
Conversation
|
Codex review: found issues before merge. Reviewed June 30, 2026, 4:17 PM ET / 20:17 UTC. Summary PR surface: Source +26, Tests +40. Total +66 across 4 files. Reproducibility: yes. Source inspection shows current generated catalogs serialize provider records after marker preservation, while this PR removes every apiKey at serialization, including documented markers and merge-mode credentials. 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 fix that removes plaintext secrets from root and plugin generated catalogs while preserving or migrating supported auth markers and models.json-only credentials. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current generated catalogs serialize provider records after marker preservation, while this PR removes every apiKey at serialization, including documented markers and merge-mode credentials. Is this the best way to solve the issue? No. Serialization-boundary redaction is the right layer, but this implementation is too broad and misses current plugin-owned catalog sidecar behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 640258d7b31d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +26, Tests +40. Total +66 across 4 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
|
|
ClawSweeper PR egg 🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress. Hatch commandComment Hatchability rules:
What is this egg doing here?
|
|
Thanks for addressing the generated-catalog exposure. We’re consolidating this security work in maintainer-owned #87166. This branch’s recursive removal also strips supported non-secret auth markers, can make custom-provider model rows fail current catalog validation, and predates the root plus plugin-owned catalog split now on main. Closing as a superseded competing implementation; #11829 and #87166 remain open for the canonical auth and upgrade policy. |
Summary
models.jsoncould persistapiKeyfields from provider config rows.apiKeyrecursively from the finalmodels.jsonwrite payload.apiKeyfields are omitted; tests now assert this contract.Motivation
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
models.jsonno longer includes provider-level or nestedapiKeyfields that could be exposed to agent/runtime readers.ensureOpenClawModelsJsonpath against a temporary OpenClaw agent dir with a configured provider containing fake provider-level and model-levelapiKeyvalues, then read the generatedmodels.json.apiKeyis omitted frommodels.json.Root Cause (if applicable)
planOpenClawModelsJsonWithDepsserialized the fully merged provider config directly, including auth fields that were needed for discovery/runtime setup but not safe to persist inmodels.json.apiKeyremoval step.Regression Test Plan (if applicable)
src/agents/models-config.applies-config-env-vars.test.ts,src/agents/models-config.runtime-source-snapshot.test.ts,src/agents/models-config.skips-writing-models-json-no-env-token.test.tsmodels.jsonkeeps provider/model metadata but omits provider-level and nestedapiKeyfields.User-visible / Behavior Changes
Generated
models.jsonno longer containsapiKeyproperties.Diagram (if applicable)
N/A
Security Impact (required)
apiKeyfields are stripped from generatedmodels.json.Verification
C:\Users\CAMILO\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe scripts\run-vitest.mjs src/agents/models-config.applies-config-env-vars.test.ts src/agents/models-config.runtime-source-snapshot.test.ts src/agents/models-config.skips-writing-models-json-no-env-token.test.ts --runnode_modules\.bin\oxfmt.CMD --check --threads=1 src/agents/models-config.plan.ts src/agents/models-config.applies-config-env-vars.test.ts src/agents/models-config.runtime-source-snapshot.test.ts src/agents/models-config.skips-writing-models-json-no-env-token.test.tsOPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree C:\Users\CAMILO\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe scripts\run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfoOPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree C:\Users\CAMILO\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe scripts\run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfogit diff --check