Add session to agents (#4216)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Jack Amadeo <jackamadeo@squareup.com>
Co-authored-by: Jack Amadeo <jackamadeo@block.xyz>
This commit is contained in:
Douwe Osinga
2025-09-03 10:31:24 -04:00
committed by GitHub
parent db94c5b7c3
commit d2195289cf
65 changed files with 1473 additions and 1601 deletions
@@ -3,7 +3,7 @@ import { getTools } from '../../api';
const { clearTimeout } = window;
export const useToolCount = () => {
export const useToolCount = (sessionId: string) => {
const [toolCount, setToolCount] = useState<number | null>(null);
useEffect(() => {
@@ -11,7 +11,7 @@ export const useToolCount = () => {
const fetchTools = async () => {
try {
const response = await getTools();
const response = await getTools({ query: { session_id: sessionId } });
if (!response.error && response.data) {
setToolCount(response.data.length);
} else {
@@ -30,7 +30,7 @@ export const useToolCount = () => {
return () => {
clearTimeout(timeoutId);
};
}, []);
}, [sessionId]);
return toolCount;
};