Skip to content

fix: always send an absolute project path to the daemon - #92

Merged
tupe12334 merged 2 commits into
mainfrom
fix/absolute-project-path
Oct 19, 2026
Merged

tupe12334 merged 2 commits into
mainfrom
fix/absolute-project-path

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Problem

resolveProjectPath returns path-like input unchanged after tilde expansion. So --project ., --project ../foo and a relative CENTY_CWD reach the daemon as relative paths.

The daemon is about to reject relative paths (centy-io/centy-daemon#231, INVALID_PATH). Every command that takes --project routes through this function, so all of them would fail.

Fix

Return resolve(untildify(input)) so the CLI always sends an absolute path. resolve is imported from node:path. Nothing else changes.

Tests

Updated src/utils/resolve-project-path.spec.ts:

  • . resolves to process.cwd()
  • ../x resolves to resolve(process.cwd(), '../x')
  • some/path resolves against cwd
  • ~/x expands to an absolute home path (compared with normalize/join, so it is Windows-safe)
  • absolute paths stay absolute
  • a relative CENTY_CWD resolves to an absolute path

Related: centy-io/centy-daemon#231

🤖 Generated with Claude Code

tupe12334 and others added 2 commits October 19, 2026 23:43
resolveProjectPath returned path-like input unchanged after tilde
expansion. Inputs such as --project ., --project ../foo or a relative
CENTY_CWD reached the daemon as relative paths. The daemon is about to
reject relative paths (centy-io/centy-daemon#231, INVALID_PATH).

Return resolve(untildify(input)) so the CLI always sends an absolute path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CENTY_CWD test hard-coded /env/path, which resolves to D:\env\path on Windows CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tupe12334
tupe12334 merged commit e24773a into main Oct 19, 2026
10 checks passed
@tupe12334 tupe12334 mentioned this pull request Oct 19, 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.

1 participant