Skip to content

fix(scanner): scan --watch accepts an --appmap-dir that doesn't exist yet - #2432

Open
dividedmind wants to merge 1 commit into
mainfrom
fix/scanner-watch-missing-appmap-dir
Open

dividedmind wants to merge 1 commit into
mainfrom
fix/scanner-watch-missing-appmap-dir

Conversation

@dividedmind

Copy link
Copy Markdown
Collaborator

Watch mode already waits for a missing AppMap directory to appear, but only when the directory comes from appmap.yml: an explicit --appmap-dir was still checked up front and failed with "does not exist, or is not readable". The VS Code extension always passes --appmap-dir, so the scanner crashed and was retried until aborted whenever the directory hadn't been created yet.

Only check the directory for one-off scans.

Refs: getappmap/vscode-appland#1134
Assisted-by: Claude:claude-opus-5-5

… yet

Watch mode already waits for a missing AppMap directory to appear, but
only when the directory comes from appmap.yml: an explicit --appmap-dir
was still checked up front and failed with "does not exist, or is not
readable". The VS Code extension always passes --appmap-dir, so the
scanner crashed and was retried until aborted whenever the directory
hadn't been created yet.

Only check the directory for one-off scans.

Refs: getappmap/vscode-appland#1134
Assisted-by: Claude:claude-opus-5-5
@dividedmind
dividedmind requested review from kgilpin and a balanced review from Copilot November 11, 2026 21:53
@dividedmind dividedmind self-assigned this Nov 11, 2026

Copilot AI left a comment

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.

🟢 Approval recommended

No active review issues block the change allowing watch mode to start before an explicitly specified AppMap directory exists.

No open issues 🎉

What changed in this PR

This PR lets scanner watch mode accept an explicit --appmap-dir before the directory exists, preventing startup failures when invoked by the VS Code extension.

Changes:

  • Skip upfront AppMap directory validation in watch mode while preserving validation for one-off scans.
  • Extend the missing-directory regression test to cover both appmap.yml and --appmap-dir.
File Description
packages/​scanner/​test/​cli/​commands.spec.ts Tests watch mode with a missing directory supplied through either configuration or CLI arguments.
packages/​scanner/​src/​cli/​scan/​command.ts Limits explicit directory validation to non-watch scans.

Review effort: Balanced

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