Skip to content

fix(acp): strip provider API keys from ACP child process env#41615

Closed
rodrigouroz wants to merge 15 commits intoopenclaw:mainfrom
rodrigouroz:fix/acp-strip-provider-api-keys
Closed

fix(acp): strip provider API keys from ACP child process env#41615
rodrigouroz wants to merge 15 commits intoopenclaw:mainfrom
rodrigouroz:fix/acp-strip-provider-api-keys

Conversation

@rodrigouroz
Copy link
Copy Markdown
Contributor

@rodrigouroz rodrigouroz commented Mar 10, 2026

Summary

Describe the problem and fix in 2-5 bullets:

  • Problem: Provider API key env vars injected by OpenClaw auth were being inherited by ACP child processes.
  • Why it matters: Some ACP tools (for example Codex CLI) detect those env vars and switch auth mode, overwriting their own local OAuth-based credentials.
  • What changed: createAcpClient() now strips both skill-injected env vars and known provider auth env vars before spawning ACP child processes, and the acpx runtime now strips
    inherited *_API_KEY vars before spawning gateway-initiated ACP child processes.
  • What did NOT change (scope boundary): This does not change provider auth inside OpenClaw itself, ACP protocol behavior, or how child tools authenticate when configured
    explicitly on their own side.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

ACP child processes no longer inherit provider API key env vars from the parent OpenClaw process on the CLI ACP path, and gateway-initiated ACP sessions also strip inherited
*_API_KEY vars before spawning child processes.

This is primarily observable for ACP integrations/tools that manage their own auth (for example Codex CLI): they should now keep using their own configured credentials instead
of switching to inherited API-key auth unexpectedly.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (Yes)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:
  • This changes secret propagation to ACP child processes by removing provider auth env vars from the spawned environment.
    • Risk: a child process that previously relied implicitly on inherited provider env vars may stop authenticating that way.
    • Mitigation: the change is intentionally limited to auth-related env vars on the relevant spawn paths, and ACP tools should use their own explicit auth/config instead of
      inheriting parent credentials.

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local dev checkout
  • Model/provider: OpenAI auth env present (OPENAI_API_KEY) + Codex CLI OAuth login
  • Integration/channel (if any): ACP child process / Codex CLI
  • Relevant config (redacted): parent process had provider API key env var set; ACP child process expected to use its own local auth config

Steps

  1. Export a provider API key in the parent environment (for example OPENAI_API_KEY=...).
  2. Launch OpenClaw so it spawns an ACP child process that uses Codex CLI (or another ACP tool with its own auth).
  3. Observe child-process auth behavior before and after this change on both the CLI ACP path and the gateway/acpx path.

Expected

  • ACP child process should not receive provider API key env vars from the parent process.
  • The child tool should continue using its own configured authentication.

Actual

  • Before this change, the child process inherited provider API key env vars.
  • In the Codex CLI case, that caused the tool to detect API-key auth and overwrite ~/.codex/auth.json, replacing OAuth credentials with apikey mode.

Evidence

Attach at least one:

  • Manual repro before/after using a parent env with OPENAI_API_KEY set and an ACP child process using Codex CLI auth.
  • Before: Codex CLI detected inherited API key env and switched auth mode.
  • After: provider API key env vars were absent from the ACP child process environment on the covered spawn paths and Codex CLI kept using its own configured auth.

Human Verification (required)

  • Verified scenarios:
    • Confirmed that skill env vars are still stripped on the CLI ACP path.
    • Confirmed that known provider auth env vars are now stripped from the CLI ACP child process env.
    • Confirmed that the gateway/acpx spawn path now strips inherited *_API_KEY vars before launching ACP child processes.
    • Reproduced the Codex CLI auth-mode issue before the change and confirmed it no longer occurs after this change on the covered path.
  • Edge cases checked:
    • Normal ACP client spawn path still works.
    • Normal gateway/acpx spawn path still works.
    • Non-provider env vars remain untouched outside the explicit filtering logic.
  • What you did not verify:
    • I did not verify every ACP integration/tool individually.
    • I did not add automated test coverage in this PR.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert commits ebc3ab8 and 4dcff35
  • Files/config to restore: src/acp/client.ts, extensions/acpx/src/runtime-internals/process.ts
  • Known bad symptoms reviewers should watch for:
    • ACP child tools that were accidentally relying on inherited provider API key env vars may fail to authenticate after this change.

Risks and Mitigations

  • Risk: An ACP child process may have been implicitly depending on inherited provider auth env vars and could stop authenticating after this change.
    • Mitigation: the change only strips auth-related env vars on the affected spawn paths, and ACP tools should use their own explicit auth/config rather than inheriting
      parent secrets.
  • Risk: The known-provider env var list or the acpx filtering logic could be incomplete, leaving some secret names still propagated.

Provider API keys (e.g. OPENAI_API_KEY) injected by the auth system were
leaking into ACP child processes. This caused Codex CLI to detect the env
var and overwrite ~/.codex/auth.json, replacing OAuth credentials with
apikey mode.

The existing stripKeys mechanism only removed skill-injected env vars
(getActiveSkillEnvKeys). This change also strips all known provider API
key env vars (listKnownProviderEnvApiKeyNames) so ACP agents use their
own configured authentication instead of inheriting leaked credentials.

Fixes the same class of issue described in openclaw#36280.
The acpx runtime plugin passes process.env directly to spawned ACP
child processes. Provider API keys (e.g. OPENAI_API_KEY) loaded by the
OpenClaw auth system leak into ACP agents, causing Codex CLI to detect
the env var and overwrite ~/.codex/auth.json, replacing OAuth with
apikey mode.

Strip all env vars ending in _API_KEY (except OPENCLAW_API_KEY) from
the child process environment. This is applied in the acpx plugin's
spawnWithResolvedCommand, which is the actual spawn path used for
gateway-initiated ACP sessions (sessions_spawn).

The companion fix in src/acp/client.ts (previous commit) covers the
CLI path (openclaw acp). Together they ensure no API key leakage
regardless of how ACP sessions are created.
@rodrigouroz rodrigouroz marked this pull request as ready for review March 10, 2026 02:40
@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot bot commented Mar 10, 2026

🔒 Aisle Security Analysis

We found 2 potential security issue(s) in this PR:

# Severity Title
1 🔵 Low Incomplete secret env var enumeration leaves new provider auth tokens unsanitized in .env audit/scrub flows
2 🔵 Low Provider API keys not stripped when default ACP server command is provided explicitly

1. 🔵 Incomplete secret env var enumeration leaves new provider auth tokens unsanitized in .env audit/scrub flows

Property Value
Severity Low
CWE CWE-200
Location src/secrets/provider-env-vars.ts:56-57

Description

src/secrets/provider-env-vars.ts introduces EXTRA_PROVIDER_AUTH_ENV_VARS and listKnownProviderAuthEnvVarNames(), but does not update listKnownSecretEnvVarNames() to include these additional secret-bearing environment variables.

Impact (grounded call sites):

  • src/secrets/audit.ts uses listKnownSecretEnvVarNames() to detect plaintext secrets in a user's .env file. New auth env vars like GITHUB_TOKEN, GH_TOKEN, COPILOT_GITHUB_TOKEN, ANTHROPIC_OAUTH_TOKEN, etc. are not flagged, reducing the effectiveness of secrets auditing.
  • src/secrets/apply.ts uses listKnownSecretEnvVarNames() as the allowlist for scrubEnvRaw(...) when attempting to remove migrated secret values from the .env file. Lines for any env var present only in EXTRA_PROVIDER_AUTH_ENV_VARS will be skipped and retained, leaving credentials on disk even after a migration/apply flow intended to scrub them.

Vulnerable code (root cause):

export function listKnownSecretEnvVarNames(): string[] {
  return [...new Set(Object.values(PROVIDER_ENV_VARS).flatMap((keys) => keys))];
}

This divergence between “provider auth env vars” and “secret env vars” is a concrete gap introduced by the new enumeration: some provider auth secrets are now recognized for spawn-time stripping, but still omitted from secret audit/scrub mechanisms.

Recommendation

Unify the two lists so all known provider auth secrets are treated as “known secret env vars” for auditing/scrubbing.

Option A (simple): make listKnownSecretEnvVarNames() delegate to the new function:

export function listKnownSecretEnvVarNames(): string[] {
  return listKnownProviderAuthEnvVarNames();
}

Option B (explicit): include EXTRA_PROVIDER_AUTH_ENV_VARS in listKnownSecretEnvVarNames().

Also update any secret-audit/scrub call sites (src/secrets/audit.ts, src/secrets/apply.ts) to use the unified function, ensuring .env detection/removal covers GITHUB_TOKEN, GH_TOKEN, COPILOT_GITHUB_TOKEN, ANTHROPIC_OAUTH_TOKEN, and other extras.


2. 🔵 Provider API keys not stripped when default ACP server command is provided explicitly

Property Value
Severity Low
CWE CWE-200
Location src/acp/client.ts:484-487

Description

The new env-stripping logic decides whether to remove provider auth environment variables based solely on whether serverCommand is present (truthy), not whether the spawned server is the trusted/default OpenClaw bridge.

As a result:

  • If a caller explicitly sets serverCommand to the default bridge command (e.g., "openclaw"), shouldStripProviderAuthEnvVarsForAcpServer() returns false.
  • buildAcpClientStripKeys() will therefore not add known provider auth env vars (e.g., OPENAI_API_KEY, GITHUB_TOKEN, etc.) to stripKeys.
  • The spawned child process will inherit these secrets via env: spawnEnv.

This can lead to unexpected secret exposure, especially because "openclaw" is resolved via PATH and could be a different binary than intended (e.g., PATH hijacking), defeating the goal of default-bridge env stripping.

Vulnerable code:

export function shouldStripProviderAuthEnvVarsForAcpServer(serverCommand?: string): boolean {
  return !serverCommand;
}// ...
const stripKeys = buildAcpClientStripKeys({
  serverCommand: opts.serverCommand,
  activeSkillEnvKeys: getActiveSkillEnvKeys(),
});

Recommendation

Treat the default OpenClaw bridge as the boundary to strip provider auth env vars, regardless of whether the caller specified the default command explicitly.

Suggested approach:

  1. Normalize/trim serverCommand.
  2. Consider openclaw (and the self-hosted Node entrypoint path when applicable) as default bridge and strip provider auth env vars for those values.
  3. If you still need to allow opting into passing provider auth env vars to custom servers, introduce an explicit option (opt-in) rather than inferring trust from presence.

Example fix (conceptual):

function isDefaultBridgeCommand(resolvedServerCommand: string, entryPath: string | null): boolean {
  const cmd = resolvedServerCommand.trim();
  if (!cmd) return true;
  if (cmd === "openclaw") return true;// When using the bundled entrypoint, default bridge uses node + entry.js
  if (entryPath && cmd === process.execPath) return true;
  return false;
}// in createAcpClient
const isDefaultBridge = isDefaultBridgeCommand(serverCommand, entryPath);
const stripKeys = buildAcpClientStripKeys({// pass a boolean instead of raw user input, or pass the resolved command
  serverCommand: isDefaultBridge ? undefined : serverCommand,
  activeSkillEnvKeys: getActiveSkillEnvKeys(),
});

This prevents accidental leaks when callers pass serverCommand: "openclaw" and makes the trust boundary explicit.


Analyzed PR: #41615 at commit 9131150

Last updated on: 2026-03-10T15:46:53Z

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 10, 2026

Greptile Summary

This PR strips provider API key env vars from ACP child process environments on both CLI and gateway/acpx spawn paths, which correctly addresses the root cause of tools like Codex CLI switching auth modes when inheriting parent process credentials. The core env-var stripping logic in client.ts and process.ts is correct and well-tested.

However, the PR introduces two significant data-loss regressions in extensions/acpx/src/runtime.ts:

Additionally, the env-var stripping intent is obscured by reusing allowPluginLocalInstall (a flag about binary selection) as the proxy for stripping behavior, creating implicit semantic coupling that could be broken by future changes.

Not safe to merge as-is without either restoring these features or removing the now-unused input fields from the API contracts.

Confidence Score: 2/5

  • Not safe to merge — the PR silently drops session resumption and image attachment support, creating data-loss regressions for live callers.
  • The core API key stripping logic is correct and well-tested. However, two intentional features (resumeSessionId from feat(acp): add resumeSessionId to sessions_spawn for ACP session resume #41847 and attachments from acp: forward attachments into ACP runtime sessions #41427) are silently removed without documentation or cleanup of their input fields. This creates subtle data-loss bugs: session resumption attempts will silently create new sessions, and image content will silently be discarded. Additionally, the env-var stripping uses a semantically unclear proxy flag.
  • extensions/acpx/src/runtime.ts — must resolve resumeSessionId and attachments regressions, and clarify the env-var stripping intent.

Comments Outside Diff (1)

  1. extensions/acpx/src/runtime.ts, line 191-210 (link)

    resumeSessionId silently dropped — session resumption broken

    The resumeSessionId parameter is no longer passed to the acpx CLI even though the caller still supplies it. AcpRuntimeEnsureInput retains the resumeSessionId? field, and this feature was added in feat(acp): add resumeSessionId to sessions_spawn for ACP session resume #41847 to support session resumption.

    The original code was:

    const resumeSessionId = asTrimmedString(input.resumeSessionId);
    const ensureSubcommand = resumeSessionId
      ? ["sessions", "new", "--name", sessionName, "--resume-session", resumeSessionId]
      : ["sessions", "ensure", "--name", sessionName];

    This PR replaces it with:

    command: [agent, "sessions", "ensure", "--name", sessionName],

    This means any attempt to resume a prior ACP session will now create a new session instead, silently ignoring the resumeSessionId. If this removal is intentional, the resumeSessionId field should be removed from AcpRuntimeEnsureInput and all callers updated, otherwise the silent no-op creates a subtle data-loss bug.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: extensions/acpx/src/runtime.ts
    Line: 191-210
    
    Comment:
    **`resumeSessionId` silently dropped — session resumption broken**
    
    The `resumeSessionId` parameter is no longer passed to the acpx CLI even though the caller still supplies it. `AcpRuntimeEnsureInput` retains the `resumeSessionId?` field, and this feature was added in #41847 to support session resumption. 
    
    The original code was:
    ```ts
    const resumeSessionId = asTrimmedString(input.resumeSessionId);
    const ensureSubcommand = resumeSessionId
      ? ["sessions", "new", "--name", sessionName, "--resume-session", resumeSessionId]
      : ["sessions", "ensure", "--name", sessionName];
    ```
    
    This PR replaces it with:
    ```ts
    command: [agent, "sessions", "ensure", "--name", sessionName],
    ```
    
    This means any attempt to resume a prior ACP session will now create a new session instead, silently ignoring the resumeSessionId. If this removal is intentional, the `resumeSessionId` field should be removed from `AcpRuntimeEnsureInput` and all callers updated, otherwise the silent no-op creates a subtle data-loss bug.
    
    How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: 992a770

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4781d699e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Use a shared provider auth env-var list for ACP child process scrubbing so
both the CLI ACP path and the acpx runtime strip the same credentials,
including non-_API_KEY tokens like GITHUB_TOKEN and HF_TOKEN.

Only apply provider auth env stripping on the default OpenClaw bridge path.
Explicit custom ACP servers keep their env-based auth contract.
@rodrigouroz
Copy link
Copy Markdown
Contributor Author

Addressed the remaining bot comments in d24f695.

What changed:

  • The acpx runtime now uses a shared listKnownProviderAuthEnvVarNames() helper, so it strips the same non-_API_KEY auth vars as the CLI ACP path, including token-style env vars such as GITHUB_TOKEN and HF_TOKEN.
  • The CLI ACP path now only strips provider auth env vars for the default OpenClaw bridge path. Explicit custom ACP servers passed via --server keep their env-based auth contract.
  • Added focused coverage in src/acp/client.test.ts, extensions/acpx/src/runtime-internals/process.test.ts, and src/plugin-sdk/subpaths.test.ts.

Verification:

  • pnpm test -- src/acp/client.test.ts extensions/acpx/src/runtime-internals/process.test.ts src/plugin-sdk/subpaths.test.ts
  • pnpm build

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4d98275b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Restore the existing resolveAcpClientSpawnEnv assertions, including
ELEVENLABS_API_KEY coverage, and keep the helper behavior that always
forces OPENCLAW_SHELL after stripping requested env keys.
Restore active skill env tracking so skill-injected secrets remain stripped
from ACP child process environments, alongside the shared provider auth
env filtering.
@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: M and removed size: S labels Mar 10, 2026
Restore the skills env override test that verifies tracked env keys stay
active until all overlapping overrides are released.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 097a99b54a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Remove the unnecessary skills.js barrel export for getActiveSkillEnvKeys
and keep the test importing the helper from its canonical env-overrides
module.
Only strip provider auth env vars on the bundled acpx path. Custom
acpx commands should keep inherited provider credentials, matching the
CLI ACP behavior.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c98c35879

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Apply oxfmt import ordering in src/acp/client.ts and mark test-only
provider credential literals in src/acp/client.test.ts as allowlisted
false positives for detect-secrets.
Add the required mcpServers field to ResolvedAcpxPluginConfig test
fixtures and mark the remaining test-only provider credential literals as
allowlisted false positives for detect-secrets.
@rodrigouroz
Copy link
Copy Markdown
Contributor Author

@greptileai please review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 992a770a90

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Restore the ACPX runtime behaviors regressed during the env-strip follow-up:
- preserve resumeSessionId when ensuring sessions
- serialize image attachments into ACP prompt blocks
- route agent verbs through the MCP proxy when mcpServers are configured
- make provider-auth stripping use an explicit config flag
Add detect-secrets pragmas to the new ACPX runtime regression tests so the CI secrets job does not flag the intentional fixture values.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b85c4edf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +145 to +149
if (params.stripProviderAuthEnvVars !== false) {
for (const key of listKnownProviderAuthEnvVarNames()) {
if (key !== "OPENCLAW_API_KEY") {
delete childEnv[key];
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve custom-command env during acpx preflight probes

spawnWithResolvedCommand now strips provider auth variables by default unless callers explicitly pass stripProviderAuthEnvVars: false. I traced the startup path in extensions/acpx/src/service.ts (ensureAcpxcheckAcpxVersion) and those probes still call spawnAndCollect without that override, so custom config.command wrappers can lose required env-based credentials during --help/--version preflight and be marked unavailable before any turn runs. This only manifests for custom acpx commands that enforce auth env even on probe commands, but in that setup it is a functional regression from previous behavior.

Useful? React with 👍 / 👎.

Remove the extra ACPX config flag and duplicated runtime test fixture, keep the runtime-level custom-command auth-env regression test on the existing fixture path, and restore the preserved plugin-sdk contract coverage.
@openclaw-barnacle openclaw-barnacle bot added size: M and removed agents Agent runtime and tooling size: L labels Mar 10, 2026
@rodrigouroz
Copy link
Copy Markdown
Contributor Author

Closing this in favor of #42250.

That replacement PR rewrites the fix as a minimal patch on top of current main, keeping only the original provider-auth env stripping changes and their targeted tests.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9131150479

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

...process.env,
OPENCLAW_SHELL: "acp",
};
if (params.stripProviderAuthEnvVars !== false) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope default provider-env stripping to bundled acpx only

This default branch (params.stripProviderAuthEnvVars !== false) now strips provider auth env vars for every spawnAndCollect call unless each caller opts out, and the startup preflight path still does not opt out (extensions/acpx/src/service.ts calls ensureAcpx, which calls checkAcpxVersion, which calls spawnAndCollect without stripProviderAuthEnvVars). In deployments using a custom config.command wrapper that requires inherited auth env even for --help/--version, this causes the probe to fail and marks ACPX unavailable before any session starts; please make stripping opt-in only on the bundled runtime spawn paths rather than the global default.

Useful? React with 👍 / 👎.

@rodrigouroz rodrigouroz deleted the fix/acp-strip-provider-api-keys branch March 11, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant