microsoft / microsoft/amplifier

bug(windows): parse_uri does not recognize Windows absolute paths - 'No handler for URI' for local behaviors and bundle modules

Open Beginner friendly
#374 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.1k
Forks
261
Avg merge
3h 28m
Merged PRs (30d)
13

Description

Summary

On native Windows, parse_uri does not recognize absolute Windows paths (drive-letter C:\... / C:/..., or UNC \\server\share\...). They fall through to the package-name heuristic, so no source handler claims them and resolution fails with BundleNotFoundError: No handler for URI: C:\....

Environment

  • Windows 11, native PowerShell (no WSL)
  • amplifier CLI 2026.08.14, amplifier-foundation @ c779cba (installed via uv tool install git+https://github.com/microsoft/amplifier)

Where it breaks

  1. Local bundle/behavior references in ~/.amplifier/settings.yaml, e.g.:

    bundle:
      app:
        - C:/Users/dan/code/bundle-the-usual/behaviors/the-usual.yaml
    

    produces Failed to compose behavior 'C:/Users/dan/...': No handler for URI.

  2. Relative module entries inside cached git bundles. The app resolves these to absolute OS path strings before passing them to the source resolver, so on Windows every such module fails to activate and strict mode aborts session startup:

    - tool-apply-patch: No handler for URI: C:\Users\dan\.amplifier\cache\amplifier-bundle-filesystem-800514b6bec1fdef\modules\tool-apply-patch
    - tool-terminal-inspector: No handler for URI: C:\...\modules\tool-terminal-inspector
    - hooks-design-context: No handler for URI: C:\...\modules\hooks-design-context
    

Root cause

In amplifier_foundation/paths/resolution.py, parse_uri classifies only file:// URLs, leading-/ POSIX absolute paths, and ./ / ../ relative paths as file URIs. C:/... and C:\... match none of these branches and end up in the package-name fallback ("C:" becomes the package, Users/dan/... its subpath).

Repro

from amplifier_foundation.paths.resolution import parse_uri

parse_uri(r"C:\Users\dan\bundle").is_file    # False -- expected True
parse_uri("C:/Users/dan/bundle").is_file     # False -- expected True
parse_uri(r"\\server\share\bundle").is_file  # False -- expected True

Proposed fix

Recognize drive-letter (``:followed by` or `/`) and UNC (`\`) prefixes as file URIs in `parse_uri`, before the package-name fallback. (`file://C:/Users/...` happens to work today because the `file://` branch keeps the drive-letter tail intact, but internal callers pass plain OS paths.)

PR to follow.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in amplifier_foundation/paths/resolution.py at parse_uri and run the three Windows path examples from the issue. Verify that drive-letter and UNC paths are classified as file URIs before the package-name fallback, then confirm local behaviors and bundle modules resolve without the reported handler error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.