Skip to content

Accept either-platform absolute paths and fix v2 NewSession - #48

Merged
foundev merged 1 commit into
masterfrom
fix/45-46-either-platform-paths
Sep 30, 2026
Merged

foundev merged 1 commit into
masterfrom
fix/45-46-either-platform-paths

Conversation

@foundev

@foundev foundev commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes #45. Fixes #46. Refs #47.

Problem

Result

  • acpvalidate.AbsolutePath now accepts paths absolute on either platform: POSIX (/dir), Windows drive-absolute (C:\dir, C:/dir), and UNC (\\server\share). Drive-relative (C:dir) and root-relative (\dir) paths remain rejected. The v1 facade, the v2 facade, and v2/mcp use the shared check; host-local paths (clienthost, the v2 runner) keep host-native filepath.IsAbs checks.
  • v2.Connection.NewSession now uses the initialization from the most recent successful Initialize call and returns a clear error if called before initialization.

Validation

  • go vet ./...
  • go test -race for the root, internal/acpvalidate, v2, and v2/mcp packages
  • New regression tests: TestNewSessionAcceptsPOSIXAbsoluteAgentPath, TestV2NewSessionUsesStoredInitialization, TestValidatePathsAcceptsAbsolutePathsFromEitherPlatform, plus the expanded TestAbsolutePath table.

Limits

Session paths are resolved by the agent, which may run on a different platform than the client. Client-side validation now accepts POSIX-absolute, drive-absolute, and UNC forms on any host while still rejecting drive-relative and root-relative paths. Host-local paths in clienthost and the v2 runner keep host-native filepath.IsAbs checks.

v2 Connection.NewSession now uses the initialization from the most recent successful Initialize call instead of an empty one, which made the convenience wrapper fail before sending session/new.

Fixes #45

Fixes #46

Refs #47
@foundev
foundev merged commit d70187f into master Sep 30, 2026
10 checks passed
@foundev
foundev deleted the fix/45-46-either-platform-paths branch September 30, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant