Skip to content

feat: module validation errors should include install hint when dependency is missing #227

@michaeljabbour

Description

@michaeljabbour

Summary

When a module fails the module_importable validation check due to a missing Python dependency, the error message only states the missing module name. It should also provide the exact command the user needs to run to resolve it.

Current behavior

Failed to load module 'tool-media-pipeline': Module 'tool-media-pipeline' failed validation: 
FAILED: 0/1 checks passed (1 errors, 0 warnings). 
Errors: module_importable: Failed to import module: No module named 'edge_tts'

The user must then figure out on their own:

  1. That edge_tts maps to the PyPI package edge-tts (different spelling)
  2. That Amplifier is installed via uv tool and cannot use a plain pip install
  3. The correct fix: uv tool install --with edge-tts amplifier

Desired behavior

The validation error should include a human-readable install hint:

Failed to load module 'tool-media-pipeline': missing dependency 'edge_tts'
Fix: uv tool install --with edge-tts amplifier

Broader opportunity

Modules already know what they import. If modules could optionally declare a pypi_package mapping alongside their imports (e.g. edge_tts -> edge-tts), the loader could:

  1. Detect the missing import
  2. Look up the correct PyPI package name
  3. Surface the exact uv tool install --with <package> amplifier command in the error

This would close the UX gap for any module with optional dependencies — TTS providers, OCR libraries, cloud SDKs, etc. — without requiring auto-installation (which carries security implications).

Context

  • Amplifier is installed as a uv isolated tool, so pip install doesn't work
  • Auto-install at runtime would have security implications and is not requested here
  • The ask is purely better error messaging + optional dependency declaration so the loader can generate the right hint

Affected module

tool-media-pipeline (requires edge-tts, which is not bundled by default)

Labels

enhancement, dx, module-loader

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions