Repository navigation
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
On macOS, exporting NODE_USE_SYSTEM_CA=1 in the OpenClaw Gateway/runtime environment makes openai-codex keychain-backed auth reads fail with SecItemCopyMatching failed -50, while forcing bundled CA restores the same auth call.
Steps to reproduce
- Ensure the Gateway/runtime environment exports
NODE_USE_SYSTEM_CA=1. - Run
openclaw models auth list --agent main --provider openai-codex --json. - Observe immediate failure:
SecItemCopyMatching failed -50. - Run
NODE_USE_SYSTEM_CA=0 NODE_OPTIONS=--use-bundled-ca openclaw models auth list --agent main --provider openai-codex --json. - Observe that the command succeeds and returns the expected
openai-codexOAuth profiles.
Expected behavior
Enabling system CA should not break openai-codex auth/keychain access or fresh runtime launch paths on macOS; openclaw models auth list --agent main --provider openai-codex --json should succeed under the same environment.
Actual behavior
With NODE_USE_SYSTEM_CA=1, macOS keychain-backed auth access fails with SecItemCopyMatching failed -50, and fresh runtime launch paths that depend on that auth surface become unreliable.
OpenClaw version
2026.5.28 (e932160)
Operating system
macOS 26.4.1 (Darwin 25.4.0, arm64)
Install method
local gateway service
Model
openai-codex
Provider / routing chain
openclaw -> openai-codex OAuth/keychain auth lookup on macOS
Additional provider/model setup details
Gateway/service environment includes NODE_USE_SYSTEM_CA=1.
Forcing bundled CA behavior with NODE_USE_SYSTEM_CA=0 NODE_OPTIONS=--use-bundled-ca openclaw models auth list --agent main --provider openai-codex --json restores the same auth lookup immediately.
This can appear intermittent because already-warm sessions or code paths with explicit bundled-CA overrides may still work while fresh auth reads or fresh child launches fail.
Logs, screenshots, and evidence
Observed failing command:
`openclaw models auth list --agent main --provider openai-codex --json`
Observed error:
`SecItemCopyMatching failed -50`
Observed successful workaround command:
`NODE_USE_SYSTEM_CA=0 NODE_OPTIONS=--use-bundled-ca openclaw models auth list --agent main --provider openai-codex --json`
The workaround returns the expected `openai-codex` OAuth profiles immediately.Impact and severity
Affected: macOS OpenClaw runtimes using openai-codex auth/keychain access with NODE_USE_SYSTEM_CA=1
Severity: High (breaks auth reads and can block fresh runtime launches)
Frequency: Observed immediately on fresh auth reads in this setup; warm or overridden paths may appear intermittent
Consequence: openclaw models auth list, openclaw models status, agent launches, ACP/subagent spawns, and background launches that need fresh auth access can fail
Additional information
This appears related to the broader macOS + openai-codex + auth/keychain/runtime-launch issue cluster, but this repro isolates NODE_USE_SYSTEM_CA=1 as the trigger and bundled CA as the immediate workaround.
Workaround observed in this environment:
NODE_USE_SYSTEM_CA=0
NODE_OPTIONS=--use-bundled-ca
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 3, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 5:04 AM ET / 09:04 UTC.
Summary
Keep open: current main and the latest release still contain the macOS
NODE_USE_SYSTEM_CA=1service default plus reachable Codex keychain/auth paths, and no merged same-repo fix or canonical duplicate proves the reported macOSSecItemCopyMatching failed -50failure is resolved. The external credential-delegation comment is useful context, but it is not a current OpenClaw implementation or proven in-repo workaround.Reproducibility: no. high-confidence live reproduction was run in this review. The reporter provides concrete macOS commands, and current source still has the relevant service CA default plus keychain-capable Codex auth paths, so the source path remains credible.
Ways to help us reproduce this
Next step
A maintainer needs to choose and validate the macOS TLS/auth boundary with live macOS proof before any automated fix PR is safe.
Review details
Best possible solution:
Reproduce the failure on macOS, then fix the narrow auth/startup boundary so Codex keychain/status/runtime launch reads do not inherit the problematic CA mode while preserving launchd TLS reliability.
Do we have a high-confidence way to reproduce the issue?
No high-confidence live reproduction was run in this review. The reporter provides concrete macOS commands, and current source still has the relevant service CA default plus keychain-capable Codex auth paths, so the source path remains credible.
Is this the best way to solve the issue?
Unclear: forcing bundled CA globally is a useful workaround signal but not clearly the best product fix because the macOS system-CA default protects launchd TLS. A scoped auth/startup boundary fix needs maintainer choice and macOS proof.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
SecItemCopyMatching failed -50symptom was not live-reproduced in this review, so the failure remains source-supported plus reporter-provided rather than independently proven on current main.NODE_USE_SYSTEM_CAkeychain failure or fresh runtime launch path is fixed.Codex review notes: model internal, reasoning high; reviewed against 3b332fd0a485.
Label changes
Label justifications:
P1: The report describes an auth-provider regression that can block fresh macOS runtime launches for affected users.impact:auth-provider: The affected surface is OpenAI/Codex OAuth, keychain credential resolution, and provider auth status/runtime startup behavior.Evidence reviewed
What I checked:
AGENTS.md:1, 3b332fd0a485)VISION.md:17, 3b332fd0a485)resolveNodeStartupTlsEnvironmentstill defaultsNODE_USE_SYSTEM_CAto1on Darwin when Darwin defaults are included. (src/bootstrap/node-startup-env.ts:35, 3b332fd0a485)NODE_USE_SYSTEM_CAdefault. (src/daemon/service-env.ts:480, 3b332fd0a485)security find-generic-passwordon Darwin unlessallowKeychainPromptis explicitly false. (src/agents/cli-credentials.ts:257, 3b332fd0a485)models auth list --provider ...now scopes external CLI discovery throughexternalCliDiscoveryForProviderAuth, whose default disables keychain prompting, but that does not prove all status or fresh launch paths are fixed. (src/commands/models/auth-list.ts:120, 3b332fd0a485)Likely related people:
NODE_USE_SYSTEM_CA=1on macOS service environments for managed daemon launches. (role: introduced behavior; confidence: high; commits: 350ac0d82448; files:src/daemon/service-env.ts,src/daemon/service-env.test.ts)src/agents/cli-credentials.ts,src/bootstrap/node-startup-env.ts,src/daemon/service-env.ts)src/agents/cli-credentials.ts,src/agents/auth-profiles/external-cli-sync.ts,src/commands/models/list.status-command.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.openclaw-barnacle commentedon Jul 6, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Jul 14, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.