fix(agents): add include_disabled query to GET /api/agents#467
Open
szafranski wants to merge 1 commit into
Open
fix(agents): add include_disabled query to GET /api/agents#467szafranski wants to merge 1 commit into
szafranski wants to merge 1 commit into
Conversation
Disabling a custom agent removed it from every UI surface, including the settings screen that hosts the re-enable toggle, because GET /api/agents only returns rows where enabled && available. Add an opt-in include_disabled query parameter (default false) that also re-surfaces rows hidden solely because the user disabled them while their spawn command still resolves on PATH. CLI-missing rows stay hidden in both modes. The default view is unchanged, so pickers keep showing only spawnable agents. Separate the disabled guard out of probe_resolved_command into a new probe_command helper so a disabled-but-installed row can be told apart from a disabled-and-missing one without changing the available field.
Author
|
Small release-coordination bump: AionUi v2.1.19 already includes the renderer half in iOfficeAI/AionUi#3319 ( That means users on the latest release can still see the old behavior, because the settings UI now calls |
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.
What
Add an opt-in
include_disabledquery parameter toGET /api/agents.By default the endpoint is unchanged: it returns only
enabled && availablerows, sopickers keep showing only spawnable agents. With
?include_disabled=truethe responseadditionally includes rows hidden solely because the user disabled them
(
enabled = false) whose spawn command still resolves on$PATH. Rows hidden because thebinary is missing stay hidden in both modes.
Why
Disabling a custom agent currently removes it from every UI surface, including the AionUi
settings screen that hosts the re-enable toggle — leaving no way to turn it back on from the
GUI. The root cause is backend-side:
GET /api/agentsfilters out every non-visiblerow.This adds the management view the settings screen needs while keeping the picker contract
intact.
See the AionUi issue for the end-to-end report: iOfficeAI/AionUi#3318
How
aionui-api-types: newListAgentsQuery { include_disabled: bool }.routes/agent.rs:list_agentsnow extractsQuery<ListAgentsQuery>and threads the flag.services/agent.rs:list_agents(include_disabled)forwards to the registry.registry.rs:list_for_view(include_disabled)whose predicate isis_visible(m) || (include_disabled && is_disabled_but_installed(m));probe_resolved_commandis refactored to split the disabled guard out into a newprobe_commandhelper, so a disabled-but-installed row can be told apart from adisabled-and-missing one without changing the
availablefield. Disabled rows keepavailable = false; the renderer greys them offenabled, notavailable.refresh_agents(POST /api/agents/refresh) intentionally stays on the default filteredview — the settings screen drives the list endpoint, not refresh, so there is no need to
surface disabled rows there.
Tests
cargo test -p aionui-ai-agent— added registry tests:include_disabled=true;Coupling
This is the backend half of a cross-repo fix. The renderer half is a separate PR in
iOfficeAI/AionUi (which uses the new parameter from the settings screen only). Both PRs must
be bundled together for the fix to function in a release.