Skip to content

ui: fall back to own conversations when useAgentInstances(true) is refused - #3288

Open
suryakant-source wants to merge 2 commits into
kagent-dev:mainfrom
suryakant-source:fix-agent-instances-fallback
Open

suryakant-source wants to merge 2 commits into
kagent-dev:mainfrom
suryakant-source:fix-agent-instances-fallback

Conversation

@suryakant-source

Copy link
Copy Markdown

Fixes #3212

useAgentInstances(true) surfaced the controller's PermissionDenied for all_creators as a page error, so AgentsPage showed "Could not count conversations" and UnmappedConversationsPage failed for callers without that permission.

The hook now re-reads with allCreators: false when the wide read is refused (403) and exposes widerReadRefused, the same way useAgentConversations already does. Other errors are still reported as errors. The return type gains an optional widerReadRefused; existing callers keep working unchanged.

Tests: added useAgentInstances.test.tsx covering the allowed wide read, the 403 fallback, a non-403 failure, and the narrow read. vitest, tsc --noEmit and eslint pass on the changed files.

Commits are signed off (DCO).

useAgentInstances(true) now re-reads with allCreators: false when the wide read is refused (403) and exposes widerReadRefused, matching useAgentConversations.

Signed-off-by: Suryakant Sahoo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui: useAgentInstances(true) turns an all_creators refusal into a page error

1 participant