feat: filter sys_list_models results#3135
Conversation
Signed-off-by: ptrfariello <pietro.fariello@syrto.ai>
Signed-off-by: ptrfariello <pietro.fariello@syrto.ai>
|
CI note: the failing E2E UI shard 1/3 job appears unrelated to this backend-only PR. The sole failure was:
Playwright found the Add policy button, but its click timed out because the element remained unstable and was then detached from the DOM. The shard otherwise reported 84 passed and 4 skipped, and the other two E2E UI shards passed. A rerun of the failed job should be sufficient; no model-catalog code is implicated by the traceback. |
|
@ptr-syrto This PR is a Bug fix, Feature, or UI / frontend change but the Demo section is missing or only contains a placeholder. These change types require a screenshot or screen recording so reviewers can see the new behaviour without checking out the branch. Please update the Demo section with:
Use |
|
Hi @bbqiu - the demo-check bot flagged this PR. This is a backend-only What would you consider an acceptable |
Related issue
Closes #3130
Summary
workersand exactmodel_idsfilters tosys_list_models.workers: []selects zero workers and returns{}; selected workers remain present with an emptymodelslist when no requested model IDs match.Test Plan
OMNIGENT_SKIP_WEB_UI=true uv run --locked --extra dev pytest -p no:rerunfailures -q tests/tools/builtins/test_list_models.py tests/runner/test_runner_dispatch.py::test_sys_list_models_dispatches_locally_with_static_provider tests/runner/test_runner_dispatch.py::test_sys_list_models_dispatch_applies_filters tests/runner/test_runner_dispatch.py::test_sys_list_models_requires_agent_spec— 11 passed.uv run --locked ruff check omnigent/tools/builtins/list_models.py omnigent/runner/tool_dispatch.py tests/tools/builtins/test_list_models.py tests/runner/test_runner_dispatch.py— passed.uv run --locked ruff format --check omnigent/tools/builtins/list_models.py omnigent/runner/tool_dispatch.py tests/tools/builtins/test_list_models.py tests/runner/test_runner_dispatch.py— passed.uv run --locked pre-commit run --files omnigent/tools/builtins/list_models.py omnigent/runner/tool_dispatch.py tests/tools/builtins/test_list_models.py tests/runner/test_runner_dispatch.py— all hooks passed.Demo
Before:
sys_list_modelsaccepted no parameters and always returned the complete per-worker model catalog.After: callers can pass optional
workersand exactmodel_idsarrays to return only selected workers and model entries; the same filtering contract applies inomnigent/tools/builtins/list_models.py::SysListModelsTooland the runner-localomnigent/runner/tool_dispatch.py::_execute_list_models_toolpath.Type of change
Test coverage
Coverage notes
Tests cover schema exposure, unfiltered backward compatibility, independent and combined filters, non-mutation, invalid direct-call arguments, empty and unknown worker selections, unknown model IDs retaining workers with empty model lists, and runner-local dispatch.
Changelog
sys_list_modelscan now return only selected workers and model IDs, reducing orchestration context usage.