🤖 refactor: Auto-validate IDs in Agent Query (#9555)

* 🤖 refactor: Auto-validate IDs in Agent Query

* chore: remove comments in useAgentToolPermissions
This commit is contained in:
Danny Avila 2025-09-10 18:38:33 -04:00 committed by GitHub
parent f3eca8c7a7
commit f125f5bd32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 21 additions and 33 deletions

View file

@ -47,11 +47,7 @@ export default function AgentPanel() {
const { onSelect: onSelectAgent } = useSelectAgent();
const modelsQuery = useGetModelsQuery();
// Basic agent query for initial permission check
const basicAgentQuery = useGetAgentByIdQuery(current_agent_id ?? '', {
enabled: !!(current_agent_id ?? '') && current_agent_id !== Constants.EPHEMERAL_AGENT_ID,
});
const basicAgentQuery = useGetAgentByIdQuery(current_agent_id);
const { hasPermission, isLoading: permissionsLoading } = useResourcePermissions(
ResourceType.AGENT,

View file

@ -16,14 +16,7 @@ export default function VersionPanel() {
const selectedAgentId = agent_id ?? '';
const {
data: agent,
isLoading,
error,
refetch,
} = useGetAgentByIdQuery(selectedAgentId, {
enabled: !!selectedAgentId && selectedAgentId !== '',
});
const { data: agent, isLoading, error, refetch } = useGetAgentByIdQuery(selectedAgentId);
const revertAgentVersion = useRevertAgentVersionMutation({
onSuccess: () => {