Skip to content

fix(vd): honor VD_CODEX_HOME in vd install codex - #101

Merged
vanducng merged 1 commit into
mainfrom
cursor/codex-vd-home-a94f
Aug 27, 2026
Merged

fix(vd): honor VD_CODEX_HOME in vd install codex#101
vanducng merged 1 commit into
mainfrom
cursor/codex-vd-home-a94f

Conversation

@vanducng

Copy link
Copy Markdown
Owner

Follow-up to #99 (merged). The review on that PR found a P2: auto-detect treated $VD_CODEX_HOME as the Codex home, but vd install still always wrote ~/.agents/skills.

Which side moved

Install dest now honors $VD_CODEX_HOME, matching Cursor (cursorHome / VD_CURSOR_HOME) and inventory (Service.platformRoots). Detection stays as it is.

The review suggestion to detect ~/.agents only would have left inventory and auto-detect disagreeing whenever $VD_CODEX_HOME is set. Skills would still land where inventory never scans.

Behavior

$VD_CODEX_HOME User-scope dest
unset $HOME/.agents/skills (unchanged default)
set $VD_CODEX_HOME/skills

Repo scope is still <repo>/.agents/skills. Explicit --dest is unchanged.

Tests

  • TestCodex_UserScopeUsesAgentsSkills
  • TestCodex_UserScopeHonorsVDCodexHome
  • TestRunInstall_AutoCodexHonorsVDCodexHome
  • go test ./internal/install/ ./internal/cli/ ./internal/inventory/
Open in Web Open in Cursor 

Auto-detect already treated $VD_CODEX_HOME as the Codex home, but
user-scope install always wrote ~/.agents/skills. Match Cursor:
codexDest now writes $VD_CODEX_HOME/skills when that inventory
override is set. Default remains ~/.agents/skills.

Co-authored-by: Duc Nguyen <me@vanducng.dev>
@vanducng
vanducng marked this pull request as ready for review August 22, 2026 02:16
@munmiu

munmiu Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

@munmiu

munmiu Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Result: P3 | low | 2

What changed:

  • vd install codex user scope now resolves its destination root via codexHome(): $VD_CODEX_HOME when set, else ~/.agents, then appends skills — exactly mirroring the existing cursorHome()/cursorDest() pattern for VD_CURSOR_HOME.
  • Auto-detect (inventory.DetectInstallAgents) already used the same env override for presence detection, so detection and destination are now consistent for Codex.
  • README, docs/content/commands.md, and the vd install help text document the new env var; tests cover both the internal/install dest resolution and the CLI auto path, including a negative assertion that ~/.agents/skills is not used when the override is set.

⚠️ Open (2)

Priority Issue Location Opened
🔵 P3 --pick list omits the VD_CODEX_HOME override (off-diff) docs/content/commands.md:392 02d4d8f
🔵 P3 obs skill registry misses $VD_CODEX_HOME installs internal/install/codex.go:125 02d4d8f
Review reference

Run again

  • Run locally: miucr review --pr https://github.com/vanducng/vd-cli/pull/101 -o pretty

Priority

  • P0 · immediate blocker: security, data loss, outage, or auth bypass
  • P1 · fix before merge: major breakage or no safe workaround
  • P2 · should fix soon: real defect with limited impact or workaround
  • P3 · can wait: minor defect, edge case, or maintainability risk
  • P4 · optional FYI: non-blocking suggestion or observation

Review context

  • M · estimated review size
  • full · the model saw the complete diff

Last reviewed commit 02d4d8f · Review attempts: 2 · Posted by miu-cr v0.89.8

Comment thread internal/install/codex.go
Comment on lines +125 to +129
// codexHome matches inventory discovery: $VD_CODEX_HOME if set, else ~/.agents.
func codexHome() (string, error) {
if home := os.Getenv("VD_CODEX_HOME"); home != "" {
return home, nil
}

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.

P3 · reliability

obs skill registry misses $VD_CODEX_HOME installs

codexDest now writes user-scope Codex skills to $VD_CODEX_HOME/skills, but DefaultSkillRoots in internal/obs/ingest/skillnames.go still scans only ~/.agents/skills and ~/.codex/skills, and its comment calls those "the Codex-side install locations vd writes to".

For users with VD_CODEX_HOME set, vd install codex now lands skills in a directory obs never reads, so vd obs attributes those skills' invocations to (none) with no warning.

Should DefaultSkillRoots (or its caller) also honor VD_CODEX_HOME so install and attribution stay in sync?

@vanducng
vanducng merged commit 2d2149c into main Aug 27, 2026
3 checks passed
@munmiu munmiu Bot mentioned this pull request Aug 27, 2026
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.

2 participants