Skip to content

fix: forward runtime env vars to task execution (RR-655) - #1

Open
RakMan09 wants to merge 6 commits into
developfrom
fix/RR-655-runtime-env-injection
Open

RakMan09 wants to merge 6 commits into
developfrom
fix/RR-655-runtime-env-injection

Conversation

@RakMan09

Copy link
Copy Markdown
Owner

Problem

Issue rocketride-org#655: environment variables configured in the UI were not reliably available during pipeline execution.
As a result, nodes depending on runtime env values could fail or fall back to defaults.

Current vs Expected

  • Current: runtime env handoff was incomplete across launch/restart paths.
  • Expected: UI-configured runtime env vars should be available to the task runtime and downstream nodes on both launch and restart.

Root Cause

  • Missing env forwarding in some client/debug paths.
  • Restart path did not always receive an explicit env snapshot, which could leave stale values.
  • Runtime relied on process env for ${ROCKETRIDE_*} resolution instead of consistently using launch-provided env.

What Changed

  • Forward runtime env from client use() and restart() requests.
  • Forward env from VS Code debug launch requests.
  • Restrict forwarded env to ROCKETRIDE_* keys.
  • Always send explicit env snapshot on restart (including {}) so stale values are cleared.
  • Sanitize env in task runtime before use (key format + allowlist).
  • Use sanitized launch env for ${ROCKETRIDE_*} resolution.
  • Inject sanitized launch env into task subprocess env.
  • Wire server restart path to pass env through to task restart.

Safety / Compatibility

  • No breaking API changes.
  • Backward compatible with existing pipelines.
  • Security guardrails preserved: only allowlisted ROCKETRIDE_* env vars are forwarded/resolved.

Testing

  • CI=true PNPM_HOME=/tmp/pnpm ./builder client-typescript:test ✅
  • CI=true PNPM_HOME=/tmp/pnpm ./builder ai:test ✅
  • Added TS regression tests for env forwarding on launch/restart.
  • Extended Python tests for env allowlist, precedence, and exfiltration protection.
  • gitleaks scan on commit range: no leaks found ✅

Notes

  • ESLint output contains existing warnings in client.ts (no-explicit-any), no new errors.

Closes rocketride-org#655

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Runtime does not recognize .env variables during pipeline execution

1 participant