Skip to content

Commit 227ef9b

Browse files
committed
fix(chat): resolve relative agentAPI URL by default
1 parent a8c8cdb commit 227ef9b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

chat/src/components/chat-provider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export function ChatProvider({ children }: PropsWithChildren) {
5757
const [serverStatus, setServerStatus] = useState<ServerStatus>("unknown");
5858
const eventSourceRef = useRef<EventSource | null>(null);
5959
const searchParams = useSearchParams();
60-
const agentAPIUrl = searchParams.get("url") || window.location.origin;
60+
const defaultAgentAPIURL = new URL("../../", window.location.href).toString();
61+
const agentAPIUrl = searchParams.get("url") || defaultAgentAPIURL;
6162

6263
// Set up SSE connection to the events endpoint
6364
useEffect(() => {

0 commit comments

Comments
 (0)