Skip to content

Fix watch mode with absolute input paths - #358

Open
Companion wants to merge 1 commit into
seaofvoices:mainfrom
Companion:fix/watch-absolute-input-path
Open

Companion wants to merge 1 commit into
seaofvoices:mainfrom
Companion:fix/watch-absolute-input-path

Conversation

@Companion

Copy link
Copy Markdown

Closes #309

Problem

Watch mode silently ignores file changes when the configured input is an absolute path inside the current working directory.

File watcher events use absolute paths, while the worker tree stores paths using the same representation as the configured input. The watcher previously made event paths relative to the current directory unconditionally, causing them to no longer match the absolute worker tree paths.

The initial build still succeeded, making the watcher appear operational despite subsequent changes being ignored.

Change

Only make watcher event paths relative when the configured input path is also relative.

The mapping remains lexical, allowing removed files to be handled without requiring them to exist. Existing symlink remapping continues to take precedence.

Testing

Added focused tests covering:

  • Relative and absolute input paths
  • Events inside and outside the current directory
  • Missing current directory information
  • Symlink remapping precedence
  • Removed or nonexistent paths

Also verified watch mode using relative and absolute inputs with automatically discovered, explicitly relative and explicitly absolute configuration paths. Changes to primary files, external dependencies and configuration files were detected in every configuration.

Verified with:

  • cargo test -q
  • cargo fmt --check
  • cargo clippy --lib --bins --tests --all-features -- -D warnings
  • lua ./scripts/test-commands.lua
  • git diff --check

@Companion
Companion force-pushed the fix/watch-absolute-input-path branch from a9eb8a7 to f70e5b2 Compare August 31, 2026 20:57
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.

Absolute paths passed into input breaks watch mode

1 participant