Repository navigation
fix(agents): resolve built-in agents dir with fileURLToPath for Windows - #324
Merged
Merged
Conversation
getBuiltinAgentsDir() used new URL(import.meta.url).pathname, which on Windows yields a leading-slash path like /C:/.../dist that fs cannot resolve. pathExists(builtinDir) then returned false and deployBuiltinAgents() took the dev-environment early return, so the teamai-recall subagent was never deployed on Windows (skills worked because builtin-skills.ts already used fileURLToPath). Mirror builtin-skills.ts by using path.dirname(fileURLToPath(import.meta.url)). Refs #322
jeff-r2026
force-pushed
the
fix/issue-322-windows-agents-path
branch
from
August 25, 2026 09:41
1dde35d to
34689af
Compare
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
…ws (Tencent#324) getBuiltinAgentsDir() used new URL(import.meta.url).pathname, which on Windows yields a leading-slash path like /C:/.../dist that fs cannot resolve. pathExists(builtinDir) then returned false and deployBuiltinAgents() took the dev-environment early return, so the teamai-recall subagent was never deployed on Windows (skills worked because builtin-skills.ts already used fileURLToPath). Mirror builtin-skills.ts by using path.dirname(fileURLToPath(import.meta.url)). Refs Tencent#322
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.
Summary
Refs #322 (intentionally not auto-closing) — on Windows,
teamai pullsilently skipped deploying built-in subagents (teamai-recall), soteamai recall enablewould inject recall rules intoCLAUDE.mdpointing at a subagent that never got deployed.Root cause:
getBuiltinAgentsDir()usednew URL(import.meta.url).pathname, which on Windows produces a leading-slash path like/C:/.../distthatfscannot resolve.pathExists(builtinDir)then returnedfalse, anddeployBuiltinAgents()took the "dev environment without build step" early return.Skills were unaffected because the sibling
getBuiltinSkillsDir()insrc/builtin-skills.tsalready usesfileURLToPath. This PR makesbuiltin-agents.tsconsistent with it.Change
Plus the
import { fileURLToPath } from 'node:url'import.Test Plan
npx tsc --noEmit— passesnpx vitest run— full suite, 2187 tests pass (163 files)npx vitest run src/__tests__/builtin-agents.test.ts— 5/5 pass; thedeploys built-in agent files to every installed toolcase actually deploysteamai-recall.mdto.claude/agents/and.codebuddy/agents/and asserts the files landnpm run build— passes; verified the compileddist/index.jsemitspath.dirname(fileURLToPath(import.meta.url))and that../agents/teamai-recall.mdresolves from thedist/layout