Skip to content

fix(devcontainer-cli): resolve a ${localEnv:...} remoteUser; say why the unlock status failed (devcontainer-cli 1.22.1) - #191

Merged
nabil-becker merged 2 commits into
mainfrom
fix/launcher-remote-user-localenv/1
Nov 9, 2026
Merged

nabil-becker merged 2 commits into
mainfrom
fix/launcher-remote-user-localenv/1

Conversation

@nabil-becker

Copy link
Copy Markdown
Owner

What

The launcher (bootstrap/host/DevcontainerCli.psm1, devcontainer-cli 1.22.1):

  • Get-DevcontainerRemoteUser now resolves ${localEnv:NAME} / ${localEnv:NAME:default} (and ${env:…}) from the label, the way the CLI does at up. If the value doesn't resolve, it falls back to containerUser, then Config.User, then no -u. It never passes a ${ to docker exec -u.
  • Get-OpenBaoUnlockStatus now tells a failed exec apart from "no openbao-setup that knows the key file". On a failure the launcher prints <engine> exec as user 'X' failed (exit N): <stderr's first line>, after up as well, and keyfile:create exits 1. Exit 4, exit 2 and a missing binary behave as before.

Why

devcontainer up writes the devcontainer.metadata label unresolved, so a variable remoteUser broke task dc:openbao:keyfile:create (exit 4, wrong message) and the automatic unlock after up (it failed silently and OpenBao stayed sealed). The AOF host agent reported it and worked around it in their PR #316. Backlog: launcher-remote-user-localenv, unlock-status-masks-errors.

Open choice for the Operator: the module has no .env reader. Import-DotEnv exists only in bootstrap.ps1. Under task, dotenv: already loads .devcontainer/.env. When the launcher is run directly, a ${localEnv:NAME:default} resolves to its default.

Checklist

  • Every commit is signed off (Signed-off-by:, DCO)
  • version bumped (1.22.0 → 1.22.1) and ## [1.22.1] added to the CHANGELOG
  • Downloads remain checksum-verified (none touched)
  • install.sh untouched
  • Tests updated: 14 new Pester tests in test/bootstrap/OpenBaoKeyFile.Tests.ps1 (81 passed, 2 skipped Windows-only); the whole bootstrap Pester suite passes (355)
  • task lint: PSScriptAnalyzer, yamllint, shellcheck, changelog and versions checks pass. In the devhost, bash unit suites this change doesn't touch fail because they read the devhost's own HOST_TYPE / SSH_AGENT_MODE. CI is the check.
  • NOTES.md updated, task docs run

https://claude.ai/code/session_01DPsHU3AJNa3yD4E84h5gfH

devhost agent and others added 2 commits November 9, 2026 19:30
…hy the unlock status failed (launcher-remote-user-localenv, unlock-status-masks-errors, devcontainer-cli 1.22.1)

devcontainer up writes the devcontainer.metadata label with devcontainer.json's
text unresolved, so a "remoteUser": "${localEnv:NAME:default}" reached
docker exec -u literally and every openbao-setup call failed. The launcher now
resolves ${localEnv:...} (and ${env:...}) as the CLI does, falls back to
containerUser and then Config.User, and never passes a "${" to -u.

Get-OpenBaoUnlockStatus no longer reports every non-zero exit as "no
openbao-setup that knows the key file": a failing exec gives one line with the
exit code and stderr's first line, after up too; keyfile:create exits 1 on it.

Reported by the AOF host agent (their PR #316 worked around it).

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Claude-Session: https://claude.ai/code/session_01DPsHU3AJNa3yD4E84h5gfH
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
…remoteUser and the unlock-status failure line (launcher-remote-user-localenv)

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Claude-Session: https://claude.ai/code/session_01DPsHU3AJNa3yD4E84h5gfH
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
@nabil-becker
nabil-becker merged commit 4e30ac5 into main Nov 9, 2026
85 checks passed
@nabil-becker
nabil-becker deleted the fix/launcher-remote-user-localenv/1 branch November 9, 2026 20:53
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.

1 participant