Skip to content

Conversation

@gszep
Copy link

@gszep gszep commented Jan 20, 2026

When running amplifier update while developing a local module the session started but the module silently failed to load. After an attempted tool call the session raises:

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

This PR emits a module:load_error event when providers, tools, or hooks fail to load. The event appears in events.jsonl with the module ID, type, and actual error message, making failures visible without
changing the existing graceful degradation behavior.

Event payload

{"module_id": "my-tool", "module_type": "tool", "error": "No module named 'aiohttp'"}

Changes

  • Emit module:load_error event when providers, tools, or hooks fail to load (e.g., missing dependency). Previously these failures were silently swallowed with only a log warning, making debugging difficult.
  • Event payload includes module_id, module_type (provider|tool|hook), and error message. Failures now appear in events.jsonl for observability while maintaining existing graceful degradation behavior.

Follow-up

A separate PR could preserve ImportError/ModuleNotFoundError specifically in loader.py rather than catching all exceptions - this would improve diagnostics by keeping the actual error type instead of converting everything to a generic string.

Emit module:load_error event when providers, tools, or hooks fail to load
(e.g., missing dependency). Previously these failures were silently swallowed
with only a log warning, making debugging difficult.

Event payload includes module_id, module_type (provider|tool|hook), and error
message. Failures now appear in events.jsonl for observability while
maintaining existing graceful degradation behavior.
@gszep
Copy link
Author

gszep commented Jan 20, 2026

@microsoft-github-policy-service agree [company="Chiba Institute of Technology"]

@gszep
Copy link
Author

gszep commented Jan 20, 2026

@microsoft-github-policy-service agree company="Chiba Institute of Technology"

@gszep
Copy link
Author

gszep commented Jan 22, 2026

closing as it is not that important - issue does not persist after clean re-install.

@gszep gszep closed this Jan 22, 2026
@gszep
Copy link
Author

gszep commented Jan 23, 2026

re-opening as the following error was raised after today's amplifier update. The thrid-party module is now also loading from github so the previous issue was not due to local dev

Failed to load module 'tool-web': Module 'tool-web' failed validation: FAILED: 0/1 checks passed (1 errors, 0 warnings). Errors: module_importable: Failed to import module: No module named 'aiohttp'
Failed to load tool 'tool-web': Module 'tool-web' failed validation: FAILED: 0/1 checks passed (1 errors, 0 warnings). Errors: module_importable: Failed to import module: No module named 'aiohttp'
Traceback (most recent call last):
  File "/home/gszep/.local/share/uv/tools/amplifier/lib/python3.13/site-packages/amplifier_core/session.py", line 194, in initialize
    tool_mount = await self.loader.load(
                 ^^^^^^^^^^^^^^^^^^^^^^^
        module_id, tool_config.get("config", {}), source_hint=tool_config.get("source")
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/gszep/.local/share/uv/tools/amplifier/lib/python3.13/site-packages/amplifier_core/loader.py", line 263, in load
    raise resolve_error
  File "/home/gszep/.local/share/uv/tools/amplifier/lib/python3.13/site-packages/amplifier_core/loader.py", line 250, in load
    await self._validate_module(module_id, module_path, config=config)
  File "/home/gszep/.local/share/uv/tools/amplifier/lib/python3.13/site-packages/amplifier_core/loader.py", line 525, in _validate_module
    raise ModuleValidationError(
        f"Module '{module_id}' failed validation: {result.summary()}. Errors: {error_details}"
    )
amplifier_core.loader.ModuleValidationError: Module 'tool-web' failed validation: FAILED: 0/1 checks passed (1 errors, 0 warnings). Errors: module_importable: Failed to import module: No module named 'aiohttp'

@gszep gszep reopened this Jan 23, 2026
@gszep
Copy link
Author

gszep commented Jan 23, 2026

issue resolves after clean re-install (without losing session history)

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