fix(config,cli,skillsource): honor a relocated harness config home - #234
Open
NiklasEi wants to merge 3 commits into
Open
fix(config,cli,skillsource): honor a relocated harness config home#234NiklasEi wants to merge 3 commits into
NiklasEi wants to merge 3 commits into
Conversation
…eEnv 🤖 Generated with Claude Opus 5 Signed-off-by: Niklas Eicker <niklas.eicker@tngtech.com>
🤖 Generated with Claude Opus 5 Signed-off-by: Niklas Eicker <niklas.eicker@tngtech.com>
🤖 Generated with Claude Opus 5 Signed-off-by: Niklas Eicker <niklas.eicker@tngtech.com>
NiklasEi
force-pushed
the
fix/harness-config-home-redirect
branch
from
August 14, 2026 12:58
5af6366 to
b5d2a45
Compare
NiklasEi
marked this pull request as draft
August 14, 2026 12:58
NiklasEi
marked this pull request as ready for review
August 14, 2026 13:11
nhuelstng
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: Closes #233
What
HomeEnvwas declared asCLAUDE_HOME, a name nothing reads (CLAUDE_CONFIG_DIRis the real one).HomeEnvis forwarded into the sandbox, and the sandbox grantsfollow the resolved config home instead of the default one.
pi's and codewhale's config-home skills dirs, which it never scanned.
HomeEnvis removed:OPENCODE_HOMEwas omac's invention too,and OpenCode has no config-home override to honor.
Why
Users relocate a harness's config home to keep separate logins side by side
(
~/.claudepersonal,~/.work-claudework). omac claimed to model this buthonored it nowhere the harness could see, so the redirect was silently
ignored: omac resolved every path from the default home, and the sandboxed
harness was never told the redirect existed. With both homes present the user
gets the wrong login; with only the redirect populated,
claudefinds nocredentials in
~/.claudeand prompts a fresh login.The one profile shape where the var survived — the sanctioned
allow_vars: ["*"]— broke the other way: the harness read the relocated home,which was never granted, so the sandbox denied it.
How
5010e06— config + launch path.ConfigHome()normalizes the value, so adifferent spelling of the default home is not read as a redirect.
ResolvedSandboxDirs()swaps theSandboxDirsentry naming the default confighome — appending instead when no entry names it (pi declares
~/.pi, its homeis
~/.pi/agent).ForwardedEnvVars()addsHomeEnvgenerically(
internal/cli/serve.go:713); that forwarding is what makes the swap sound,since granting the relocated home while the harness reads the default one is
worse than not swapping at all.
fc94e08— discovery.withConfigHomeRootsubstitutes the redirectedskills root for the default one in place, so a redirect moves which config
home is scanned without reordering the rest of the ladder. It also makes
GlobalSkillsDir()always a candidate, closing a pre-existing gap: pi andcodewhale are
omac setuptargets discovery never looked in.b5d2a45— opencode.OPENCODE_CONFIG_DIRonly adds a config-search dir(docs) and credentials live
outside it, so it is no
HomeEnv: declaring it would swap~/.config/opencodeout of the grants while OpenCode kept reading it. The field doc now carries the
general rule — no upstream variable ⇒ leave
HomeEnvempty.Test isolation came along by necessity: tests fake
$HOME, but an override namesan absolute path and survives that, so an ambient
CLAUDE_CONFIG_DIRpointed themat the developer's real config home — 9 failures locally, 0 in CI. A
TestMainper package clears them via the new
config.HomeEnvNames().Verification
Linux,
go1.26.6. Every CI lint gate, run locally:go test ./...fails the same 51 tests asmain—pre-existing loopback/network artifacts of the local sandbox in
cli,facade,intent,netprompt/origin,netproxy,sandboxrun,updater— confirmed bydiffing both failure lists.
CLAUDE_CONFIG_DIRset reuses that home's logininstead of prompting — which also confirms it is the name Claude Code reads.
go mod verify(blocked onproxy.golang.orglocally) and thee2e matrix. This touches launch argv and macOS/Seatbelt is untested, so
e2e.ymlis the gate.Every
HomeEnvname auditedCLAUDE_CONFIG_DIRCLAUDE_HOME: 0)OPENCODE_HOME: 0 occurrences;OPENCODE_CONFIG_DIRis additive onlyPI_CODING_AGENT_DIRpi-coding-agent/dist/cli.jsCODEX_HOMEopenai/codex,codex-rs/utils/home-dir/src/lib.rs:find_codex_home()— "the Codex configuration directory, which can be specified by theCODEX_HOMEenvironment variable […] defaults to~/.codex"COPILOT_HOMEgithub/copilot-clichangelog: "--config-diris deprecated in favor ofCOPILOT_HOME"CODEWHALE_HOMEHmbown/CodeWhale,crates/paths/src/lib.rs:codewhale_home_override();codewhale_home_is_explicit()documents it as an "explicit isolation boundary"Three upstream divergences surfaced by the audit — all narrow, none blocking:
CODEX_HOME(resolves symlinks) and errors if it doesnot exist;
normalizeHomePathonly cleans and absolutizes. A symlinked valuemeans omac grants the link path while codex uses the target.
CODEWHALE_HOME; omac absolutizes it againstits own working directory instead.
~/.agents/skillswhenCOPILOT_HOMEis set, but omackeeps the shared
agentsroot in copilot's scope — the same discovery/harnessmismatch this PR fixes for claude, in a spot it does not reach.
Follow-up
docs/CONFIGURATION.mdhas no harness-config-home section —CLAUDE_CONFIG_DIRand the per-harness overrides belong there, together withthe behavior change that a redirect hides skills installed under the
default home. Worth a
docs/commit on this branch or a separate PR.normalizeHomePathcleans andabsolutizes but does not resolve symlinks, so it can disagree with codex
(canonicalizes) and codewhale (rejects relative values). Worth a follow-up issue
rather than widening this PR.
agentsskills root.COPILOT_HOMEmakes copilot stopreading
~/.agents/skillswhile omac still treats it as in scope for copilot.🤖 Generated with Claude Opus 5