Skip to content

Conversation

@agent-relay
Copy link
Contributor

@agent-relay agent-relay bot commented Jan 8, 2026

Summary

FileAutocomplete component was making direct fetch to /api/files without using cloud-aware routing.

Problem

In cloud mode, direct fetch bypasses workspace proxy and hits teamsRouter which has no /files route → 404.

Solution

Updated FileAutocomplete.tsx to use getApiUrl() for proper cloud-mode routing through workspace proxy.

Changes

  • src/dashboard/react-components/FileAutocomplete.tsx
  • Added getApiUrl import
  • Updated fetch logic to use getApiUrl when apiBase not provided

Testing

  • Local mode: Works as before (direct /api/files)
  • Cloud mode: Routes through /api/workspaces/:id/proxy/files
  • TypeScript: Compiles cleanly

FileAutocomplete was making direct fetch to /api/files without using
getApiUrl(), which bypasses the workspace proxy in cloud mode. This
caused 404 errors as requests hit the teamsRouter which doesn't have
a /files route.

Now uses getApiUrl() to properly route through /api/workspaces/:id/proxy/files
in cloud mode while maintaining backward compatibility with apiBase prop.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@khaliqgant khaliqgant merged commit 0e04be2 into main Jan 8, 2026
6 checks passed
@khaliqgant khaliqgant deleted the fix/file-autocomplete-cloud-routing branch January 8, 2026 23:41
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.

2 participants