🤖 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

@ -125,13 +125,8 @@ export default function useQueryParams({
const queryClient = useQueryClient();
const { conversation, newConversation } = useChatContext();
// Extract agent_id from URL for proactive fetching
const urlAgentId = searchParams.get('agent_id') || '';
// Use the existing query hook to fetch agent if present in URL
const { data: urlAgent } = useGetAgentByIdQuery(urlAgentId, {
enabled: !!urlAgentId, // Only fetch if agent_id exists in URL
});
const { data: urlAgent } = useGetAgentByIdQuery(urlAgentId);
/**
* Applies settings from URL query parameters to create a new conversation.