Repository navigation
fix(agents): report agent import failures instead of "not installed" - #4587
Closed
github-actions[bot] wants to merge 1 commit into
Closed
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
An agent wheel that was installed but failed to import (usually because it came from main and needs core symbols the released amd-gaia lacks) was reported as "not installed", and the suggested source-install URL was unpinned, so following it pulled main again and reproduced the failure. The hint now detects an installed wheel and reports the real ImportError, both package versions, and a --force-reinstall pinned to the core's tag. The source-install URL is pinned to v<core version> everywhere. Closes #4586
3 tasks done
Contributor
Contributor
Collaborator
6 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: when an agent wheel was installed but failed to import,
gaia chat, the email paths, the Agent UI and the email evals all said the agent was "not installed". The usual cause is an agent frommainrunning against a released core. The suggested source-install command then pulledmainagain, which brought back the same failure. After: an installed-but-broken agent is reported as such, with the real import error, both package versions and a--force-reinstallpinned to the core's release tag. A genuinely missing agent still gets the "not installed" hint, now pinned to the same tag.Closes #4586
Test plan
python -m pytest tests/unit/agents/test_install_hints.pypasses (adds cases for installed-but-broken, both versions, pinned URL)python util/lint.py --allpassespython -m pytest tests/unit/shows no failures in touched areas. The remaining failures come from missing optional deps (dateutil,cvss,sherpa_onnx,fitz,responses) and sandbox read-only paths, and reproduce onmain.amd-gaia==0.24.1, installgaia-agent-chatfrommain, rungaia chat, and confirm the error namescannot import name 'gaia_home', shows both versions, and suggests[email protected]#subdirectory=...gaia-agent-chat, rungaia chat, and confirm the "not installed" hint now uses the@v0.24.1URL--force-reinstallcommand and confirmgaia chatstarts🔍 Technical details
src/gaia/agents/install_hints.py.source_install_command()now pins@v{gaia.version.__version__}and acceptsforce_reinstall=.agent_not_installed_message()gains anerror=kwarg and checksimportlib.metadata.version(wheel). If the wheel is installed, it returns the skew message instead of the caller's "not installed" subject.cli.py×3,ui/server.py,ui/agent_loop.py,ui/_chat_helpers.pystreaming path) now passerror=e. The five email eval modules replace their ad-hocnext_step="Original import error: …"witherror=exc, so the error is no longer duplicated._chat_helpers._agent_unavailable_messageonly fires whenfind_spec("gaia_agent_chat") is None, so it has no exception to pass. It gets the pinned URL automatically, as doinit_command.pyandapi/agent_registry.py, which callsource_install_commanddirectly.mainstill reports its last release version (e.g.0.24.1), so the hint there points at the last release tag. Dev checkouts normally install the agents in editable mode and don't see this hint.amd-gaia>=0.22.0floor ingaia-agent-chat. As the issue notes, the correct floor can't be named until a core release that includes Honor GAIA_HOME for cache chat and index write paths #4381 ships.