fix: add missing /api prefix in fetchAgentLogsWithMeta causing empty agent logs

fetchAgentLogsWithMeta was calling fetch(url) directly instead of
fetch(buildApiUrl(url)), so requests hit the SPA fallback instead of
the /api/tasks/:id/logs endpoint, returning HTML that silently failed
JSON parsing and resulted in empty agent log entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-15 12:20:03 -07:00
parent f62d97cff8
commit 533f627ea4

View File

@@ -420,8 +420,7 @@ export async function fetchAgentLogsWithMeta(
const suffix = params.toString() ? `?${params.toString()}` : "";
const url = withProjectId(`/tasks/${taskId}/logs${suffix}`, projectId);
// Call api function to get the fetch-compatible URL
const response = await fetch(url);
const response = await fetch(buildApiUrl(url));
if (!response.ok) {
const data = await response.json().catch(() => ({ error: "Failed to fetch agent logs" }));