Skip to content

feat: filter sys_list_models results#3135

Open
ptr-syrto wants to merge 5 commits into
omnigent-ai:mainfrom
ptr-syrto:codex/filter-sys-list-models
Open

feat: filter sys_list_models results#3135
ptr-syrto wants to merge 5 commits into
omnigent-ai:mainfrom
ptr-syrto:codex/filter-sys-list-models

Conversation

@ptr-syrto

@ptr-syrto ptr-syrto commented Jul 23, 2026

Copy link
Copy Markdown

Related issue

Closes #3130

Summary

  • Add optional workers and exact model_ids filters to sys_list_models.
  • Share one filtering implementation between the in-process tool and runner-local dispatch.
  • Preserve the full catalog when filters are omitted. An explicit workers: [] selects zero workers and returns {}; selected workers remain present with an empty models list 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_models accepted no parameters and always returned the complete per-worker model catalog.

After: callers can pass optional workers and exact model_ids arrays to return only selected workers and model entries; the same filtering contract applies in omnigent/tools/builtins/list_models.py::SysListModelsTool and the runner-local omnigent/runner/tool_dispatch.py::_execute_list_models_tool path.

Type of change

  • Bug fix
  • Feature
  • UI / frontend change
  • Refactor / chore
  • Docs
  • Test / CI
  • Breaking change

Test coverage

  • Unit tests added / updated
  • Integration tests added / updated
  • E2E tests added / updated
  • Manual verification completed
  • Existing tests cover this change
  • Not applicable

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_models can now return only selected workers and model IDs, reducing orchestration context usage.

Signed-off-by: ptrfariello <pietro.fariello@syrto.ai>
@github-actions github-actions Bot added the size/M Pull request size: M label Jul 23, 2026
@github-actions github-actions Bot added size/L Pull request size: L and removed size/M Pull request size: M labels Jul 23, 2026
@ptr-syrto
ptr-syrto marked this pull request as ready for review July 23, 2026 10:35
@github-actions
github-actions Bot requested a review from bbqiu July 23, 2026 10:36
@ptr-syrto

Copy link
Copy Markdown
Author

CI note: the failing E2E UI shard 1/3 job appears unrelated to this backend-only PR.

The sole failure was:

tests/e2e_ui/agents/test_agent_info_popover.py::test_agent_info_policy_integer_params_validate_and_submit

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.

@github-actions

Copy link
Copy Markdown
Contributor

@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:

  • A screenshot or screen recording of the change, or
  • A link to a hosted video or GIF showing the new behaviour.

Use N/A only when the change has no user-visible effect whatsoever (e.g. a pure refactor or test-only change). If that's the case, uncheck the relevant type box and check Refactor / chore or Test / CI instead.

@github-actions github-actions Bot added the needs-demo PR needs a demo screenshot or recording label Jul 23, 2026
@ptr-syrto

Copy link
Copy Markdown
Author

Hi @bbqiu - the demo-check bot flagged this PR. This is a backend-only sys_list_models feature: callers can filter the returned model catalog by worker and exact model ID; there is no UI surface to capture.

What would you consider an acceptable ## Demo here, given there's no UI to record - or should this be reclassified / have needs-demo removed instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-demo PR needs a demo screenshot or recording size/L Pull request size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Add optional worker and model filters to sys_list_models

2 participants