Skip to content

fix exec env undefined removals#107248

Closed
pgondhi987 wants to merge 1 commit into
mainfrom
agent/fix-exec-env-undefined
Closed

fix exec env undefined removals#107248
pgondhi987 wants to merge 1 commit into
mainfrom
agent/fix-exec-env-undefined

Conversation

@pgondhi987

Copy link
Copy Markdown
Contributor

Summary

Fix resolveCommandEnv so child env entries set to undefined remove inherited/base values instead of being ignored.

Root cause

The active env merge implementation in src/process/exec-spawn.ts returned early for undefined values. That left inherited values in place, including case-insensitive Windows duplicates such as Path when PATH was set to undefined.

Validation

  • pnpm exec vitest run src/process/exec.test.ts

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 14, 2026
@pgondhi987
pgondhi987 marked this pull request as ready for review July 14, 2026 07:21

@steipete steipete 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.

Current head does not fix the full regression. The new undefined-value behavior belongs in exec-spawn.ts, but #103918 also added duplicate assignChildEnvValue / mergeChildEnv helpers to exec.ts; they are unused because runExec delegates to exec-runner.ts.

That leaves check-prod-types and check-lint failing at src/process/exec.ts:41 (mergeChildEnv is declared but never read), while the process test shard still fails the two undefined-env assertions until this PR's exec-spawn.ts change is applied. Please also delete the duplicate helpers from exec.ts; then this remains one canonical env merge path.

@steipete

Copy link
Copy Markdown
Contributor

Landed the complete fix in #107258 / 489690f. Your exec-spawn.ts correction is preserved with Co-authored-by credit; the replacement also removes the duplicate unused helpers from exec.ts, which repaired the type and lint failures.

Closing this PR because the branch was not maintainer-writable. Thank you, @pgondhi987. For future PRs, enabling Allow edits by maintainers lets us apply small fixups directly.

@steipete steipete closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants