Skip to content

Conversation

@robotdad
Copy link
Member

@robotdad robotdad commented Dec 2, 2025

When using the installed version of Amplifier (via pip install or uv tool install), users
could only configure providers in ~/.amplifier/settings.yaml with git sources. Local file
paths were not supported in the provider discovery and configuration system, making it
difficult to:

  • Test local provider modifications without publishing to git
  • Use custom local providers alongside the installed Amplifier CLI
  • Develop providers locally while using the production CLI

This limitation only affected the global settings configuration - local project configs worked
fine with file sources.

Solution

This PR adds support for local file sources in the provider discovery and configuration
system:

  1. Provider Discovery: The module source resolver now properly handles local file paths (e.g.,
    file:///path/to/provider, /absolute/path, ./relative/path)
  2. Configuration Validation: Local file sources are now recognized as valid alongside git
    sources in settings.yaml
  3. None Check Safety: Added defensive check for amplifier_core.file to prevent
    AttributeError in certain import contexts

robotdad and others added 2 commits December 2, 2025 09:15
Two issues fixed:

1. _discover_providers_from_sources() only handled git URLs, causing local
   file source overrides (file://, ./, ../, /) to silently fail during
   provider discovery. This meant providers with local sources wouldn't
   appear in `amplifier init` selection.

2. list_providers() only used source discovery as a fallback when no
   entry points were found. Local source providers were invisible when
   other providers had entry points registered.

3. use_provider() used DEFAULT_PROVIDER_SOURCES instead of effective
   sources, causing local file overrides to be replaced with git URLs
   when saving provider configuration.

Changes:
- Rename _is_local_path to is_local_path and export it
- Add FileSource handling in _discover_providers_from_sources()
- Make list_providers() merge entry points with source discovery
- Make use_provider() use get_effective_provider_sources()

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Prevents AttributeError when __file__ is None in certain import contexts.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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