Skip to content

fix: resolve YAML env placeholders for API keys and remote shell env#12884

Open
Manpreet2298 wants to merge 2 commits into
continuedev:mainfrom
Manpreet2298:fix/12842-yaml-env-remote-ssh
Open

fix: resolve YAML env placeholders for API keys and remote shell env#12884
Manpreet2298 wants to merge 2 commits into
continuedev:mainfrom
Manpreet2298:fix/12842-yaml-env-remote-ssh

Conversation

@Manpreet2298

@Manpreet2298 Manpreet2298 commented Jun 23, 2026

Copy link
Copy Markdown

Fixes #12842

Description

Fixes config YAML env placeholder resolution for API keys such as ${env:OPENROUTER_API_KEY}.

Previously, hardcoding an API key in YAML worked, but using ${env:VAR} could fail to resolve in some environments, leading to missing API keys and 401 errors.

This PR makes two focused fixes:

  • resolves ${env:VAR} placeholders while converting YAML config into runtime config
  • adds the same shell-environment fallback for LocalPlatformClient secret resolution, which helps in Remote-SSH / remote shell scenarios where process.env may not contain the expected variable

This is a minimal fix scoped to config/env resolution behavior.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

Not included, since this change affects config/env resolution rather than a visible UI flow.

If helpful for review, I can add a short repro note instead:

  • hardcoded apiKey in YAML works
  • ${env:OPENROUTER_API_KEY} now also works
  • Remote-SSH/remote shell resolution is covered by the same fallback path

Tests

No automated tests were added in this change.

Manual validation suggested:

  • confirm hardcoded apiKey in YAML works
  • confirm ${env:OPENROUTER_API_KEY} works in local setup
  • confirm ${env:OPENROUTER_API_KEY} works in Remote-SSH / remote shell setup where the variable is available from the user shell

Summary by cubic

Fixes YAML ${env:VAR} resolution across the config (including request options) and adds a shell-environment fallback that preserves multiline values to prevent missing API keys and 401s in local and Remote-SSH setups. Fixes #12842.

  • Bug Fixes
    • Resolve env placeholders during YAML-to-runtime conversion across all fields, including requestOptions.
    • Fallback to the user's login shell when process.env is missing vars, preserving multiline values and working in Remote-SSH.

Written for commit 1bcea86. Summary will update on new commits.

Review in cubic

@Manpreet2298 Manpreet2298 requested a review from a team as a code owner June 23, 2026 12:08
@Manpreet2298 Manpreet2298 requested review from sestinj and removed request for a team June 23, 2026 12:08
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread core/config/yaml/loadYaml.ts
Comment thread core/util/shellPath.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

401 Missing Authentication header" for OpenRouter on Remote-SSH

1 participant