#14572·AutoGPT

fix(backend): find_library_agent filters the expert scope after pagination, so an installed workflow beyond the first page reads as zero

Author: PwutsCreated Sep 15, 2026Updated Sep 15, 2026

find_library_agent filters the search results against the expert's installed-workflow scope after the query has already been truncated to its page — 10 for a query, 50 for a list-all (autogpt_platform/backend/backend/copilot/tools/find_library_agent.py:127-145). So when the first page is all agents the expert has not installed, the tool reports "Found 0 installed workflows" while a workflow it has installed sits beyond the limit, and the model concludes it has nothing to run.

The fix is to push the scope into the search rather than post-filter it, so the limit applies to the filtered set. A test proving it: seed an expert with one installed workflow, seed more than one page of uninstalled agents that rank ahead of it, and assert find_library_agent still returns the installed one — that test fails on today's post-filter and passes once the scope is in the query.

Found while reviewing #14415 (kcze's comment on find_library_agent.py:127). Deliberately not fixed there: the change is to the search path rather than to that PR's diff.

Source: Significant-Gravitas/AutoGPT