revert(cli): keep HeyGen API traffic on stable prod (#3202)

* Revert "fix(cli): route HeyGen API calls through canary (#3201)"

This reverts commit 5545521556.

* fix(cli): remove remaining EF canary routes
This commit is contained in:
Miguel Ángel
2026-08-10 21:41:21 -04:00
committed by GitHub
parent 5545521556
commit 08934bfd55
10 changed files with 23 additions and 76 deletions
-9
View File
@@ -1,9 +0,0 @@
const HEYGEN_ROUTE_HEADER = "heygen_route";
const HEYGEN_CANARY_ROUTE = "canary";
/** Route CLI-owned HeyGen API calls through the EF canary deployment. */
export function withHeygenCanaryRoute(
headers: Record<string, string> = {},
): Record<string, string> {
return { ...headers, [HEYGEN_ROUTE_HEADER]: HEYGEN_CANARY_ROUTE };
}
@@ -36,7 +36,6 @@ describeE2E("publish stable-URL round trip (live server)", () => {
async function fetchPublicProject(projectId: string): Promise<Record<string, unknown>> {
const response = await fetch(
`${getPublishApiBaseUrl()}/v1/hyperframes/projects/${projectId}/public`,
{ headers: { heygen_route: "canary" } },
);
expect(response.ok).toBe(true);
const payload = (await response.json()) as { data: Record<string, unknown> };
@@ -551,7 +551,7 @@ afterEach(() => {
vi.unstubAllEnvs();
});
const jsonHeaders = { "content-type": "application/json", heygen_route: "canary" };
const jsonHeaders = { "content-type": "application/json" };
const signedStagedS3Url =
"https://s3.example.com/upload?X-Amz-SignedHeaders=content-length;content-type;host;x-amz-server-side-encryption";
@@ -662,7 +662,7 @@ describe("publishProjectArchive", () => {
expect(fetchMock).toHaveBeenCalledTimes(2);
expectFetchCall(fetchMock, 2, "https://api2.heygen.com/v1/hyperframes/projects/publish", {
method: "POST",
headers: { heygen_route: "canary" },
headers: {},
});
} finally {
rmSync(dir, { recursive: true, force: true });
+5 -6
View File
@@ -5,7 +5,6 @@ import AdmZip from "adm-zip";
import ignore, { type Ignore } from "ignore";
import { CSS_URL_RE, isNonRelativeUrl, isPathInside } from "@hyperframes/core";
import { buildAuthHeaders } from "../auth/client.js";
import { withHeygenCanaryRoute } from "./heygenRoute.js";
import { tryResolveCredential } from "../auth/index.js";
import { writeProjectLink } from "./projectLink.js";
@@ -558,7 +557,7 @@ async function publishProjectArchiveDirect(
"file",
new File([archiveArrayBuffer(archive)], `${title}.zip`, { type: PUBLISH_CONTENT_TYPE }),
);
const headers = withHeygenCanaryRoute(authHeaders);
const headers: Record<string, string> = { ...authHeaders };
const response = await fetchForPublish(
`${apiBaseUrl}/v1/hyperframes/projects/publish`,
@@ -621,10 +620,10 @@ async function publishProjectArchiveStaged(
content_type: PUBLISH_CONTENT_TYPE,
content_length: archive.buffer.byteLength,
}),
headers: withHeygenCanaryRoute({
headers: {
...authHeaders,
"content-type": "application/json",
}),
},
signal: AbortSignal.timeout(PUBLISH_METADATA_TIMEOUT_MS),
}),
"Failed to prepare project upload",
@@ -654,10 +653,10 @@ async function publishProjectArchiveStaged(
...(isPublic ? { is_public: true } : {}),
...(projectId ? { project_id: projectId } : {}),
}),
headers: withHeygenCanaryRoute({
headers: {
...authHeaders,
"content-type": "application/json",
}),
},
signal: AbortSignal.timeout(uploadTimeoutMs(archive.buffer.byteLength)),
}),
"Failed to finalize project publish",
@@ -35,7 +35,7 @@ describe("submitFeedback", () => {
"https://api.example.com/v1/hyperframes/feedback",
expect.objectContaining({
method: "POST",
headers: { "content-type": "application/json", heygen_route: "canary" },
headers: { "content-type": "application/json" },
body: JSON.stringify({
rating: 4,
rating_scale: 10,
+2 -3
View File
@@ -1,6 +1,5 @@
import { getPublishApiBaseUrl } from "./publishProject.js";
import { FEEDBACK_RATING_SCALE } from "./feedbackRating.js";
import { withHeygenCanaryRoute } from "./heygenRoute.js";
// Match the backend DTO caps (HyperframesFeedbackRequest). Truncate here so an
// over-long field (e.g. a pasted stack trace) is still forwarded truncated,
@@ -31,9 +30,9 @@ export async function submitFeedback(input: {
cli_version: cap(input.cliVersion, MAX_CLI_VERSION),
env: cap(input.env, MAX_ENV),
}),
headers: withHeygenCanaryRoute({
headers: {
"content-type": "application/json",
}),
},
signal: AbortSignal.timeout(5000),
});
} catch {