Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from "r
import { AgentSpinner } from "~/components/primitives/Spinner";
import { useToast } from "~/components/primitives/Toast";
import { useAgentPageContext } from "~/hooks/useAgentPageContext";
import { useApiOrigin } from "~/hooks/useApiOrigin";
import { useDashboardAgentBaseUrl } from "~/hooks/useDashboardAgentBaseUrl";
import { useEnvironment } from "~/hooks/useEnvironment";
import { useOrganization } from "~/hooks/useOrganizations";
import { useProject } from "~/hooks/useProject";
Expand Down Expand Up @@ -104,7 +104,7 @@ export function DashboardAgentPanel({
const project = useProject();
const environment = useEnvironment();
const user = useUser();
const apiOrigin = useApiOrigin();
const apiOrigin = useDashboardAgentBaseUrl();
const location = useLocation();
const pageContext = useAgentPageContext();
const toast = useToast();
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/env.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ const EnvironmentSchema = z
// standard chat.agent SDK flow. When unset, the live agent is disabled — the
// conversation store / History still work, no chat can start.
DASHBOARD_AGENT_SECRET_KEY: z.string().optional(),
DASHBOARD_AGENT_BASE_URL: z.string().optional(),
Comment thread
ericallam marked this conversation as resolved.
// Pins agent sessions to a specific deployed version (paired with
// --skip-promotion deploys); unset => the project env's current version.
DASHBOARD_AGENT_VERSION: z.string().optional(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useTypedRouteLoaderData } from "remix-typedjson";
import type { loader } from "../root";

export function useApiOrigin() {
export function useDashboardAgentBaseUrl() {
const routeMatch = useTypedRouteLoaderData<typeof loader>("root");

return routeMatch!.apiOrigin;
return routeMatch!.dashboardAgentBaseUrl;
}
1 change: 1 addition & 0 deletions apps/webapp/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
appEnv: env.APP_ENV,
appOrigin: env.APP_ORIGIN,
apiOrigin: env.API_ORIGIN ?? env.APP_ORIGIN,
dashboardAgentBaseUrl: env.DASHBOARD_AGENT_BASE_URL ?? "https://api.trigger.dev",
triggerCliTag: env.TRIGGER_CLI_TAG,
kapa,
timezone,
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/services/dashboardAgent.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const DASHBOARD_AGENT_UAT_TTL_SECONDS = 10 * 60;
// The Trigger instance this webapp runs against — the same origin the agent
// task calls back to (as the user) for its read tools.
export function dashboardAgentApiOrigin(): string {
return env.API_ORIGIN ?? env.APP_ORIGIN;
return env.DASHBOARD_AGENT_BASE_URL ?? "https://api.trigger.dev";
}
Comment thread
ericallam marked this conversation as resolved.

// Mint a short-lived, read-only delegated token for the signed-in user. Self
Expand Down