























@@ -301,8 +301,7 @@ describe("qa-lab server", () => {
301301port: 0,
302302 outputPath,
303303 repoRoot,
304-controlUiUrl: "http://127.0.0.1:18789/",
305-controlUiToken: "qa-token",
304+controlUiUrl: "http://127.0.0.1:18789/?token=qa-token&panel=chat#token=fragment-token",
306305embeddedGateway: "disabled",
307306});
308307cleanups.push(async () => {
@@ -321,15 +320,22 @@ describe("qa-lab server", () => {
321320};
322321expect(bootstrap.defaults.conversationId).toBe("qa-operator");
323322expect(bootstrap.defaults.senderId).toBe("qa-operator");
324-expect(bootstrap.controlUiUrl).toBe("http://127.0.0.1:18789/");
325-expect(bootstrap.controlUiEmbeddedUrl).toBe("http://127.0.0.1:18789/#token=qa-token");
323+expect(bootstrap.controlUiUrl).toBe("http://127.0.0.1:18789/?panel=chat");
324+expect(bootstrap.controlUiEmbeddedUrl).toBe("http://127.0.0.1:18789/?panel=chat");
326325expect(bootstrap.kickoffTask).toContain("Lobster Invaders");
327326expect(bootstrap.scenarios.length).toBeGreaterThanOrEqual(10);
328327expect(bootstrap.scenarios.map((scenario) => scenario.id)).toContain("dm-chat-baseline");
329328expect(bootstrap.runner.status).toBe("idle");
330329expect(bootstrap.runner.selection.providerMode).toBe("live-frontier");
331330expect(bootstrap.runner.selection.scenarioIds).toHaveLength(bootstrap.scenarios.length);
332331332+const startupStatus = (await (
333+await fetchWithRetry(`${lab.baseUrl}/api/capture/startup-status`)
334+).json()) as {
335+status: { gateway: { url: string } };
336+};
337+expect(startupStatus.status.gateway.url).toBe("http://127.0.0.1:18789/?panel=chat");
338+333339const messageResponse = await fetch(`${lab.baseUrl}/api/inbound/message`, {
334340method: "POST",
335341headers: {
@@ -453,7 +459,9 @@ describe("qa-lab server", () => {
453459});
454460455461it("proxies control-ui paths through /control-ui", async () => {
462+const authorizations: Array<string | undefined> = [];
456463const upstream = createServer((req, res) => {
464+authorizations.push(req.headers.authorization);
457465if ((req.url ?? "/") === "/healthz") {
458466res.writeHead(200, { "content-type": "application/json" });
459467res.end(JSON.stringify({ ok: true, status: "live" }));
@@ -488,7 +496,7 @@ describe("qa-lab server", () => {
488496advertiseHost: "127.0.0.1",
489497advertisePort: 43124,
490498controlUiProxyTarget: `http://127.0.0.1:${address.port}/`,
491-controlUiToken: "proxy-token",
499+controlUiProxyToken: "proxy-token",
492500});
493501cleanups.push(async () => {
494502await lab.stop();
@@ -499,9 +507,7 @@ describe("qa-lab server", () => {
499507controlUiEmbeddedUrl: string | null;
500508};
501509expect(bootstrap.controlUiUrl).toBe("http://127.0.0.1:43124/control-ui/");
502-expect(bootstrap.controlUiEmbeddedUrl).toBe(
503-"http://127.0.0.1:43124/control-ui/#token=proxy-token",
504-);
510+expect(bootstrap.controlUiEmbeddedUrl).toBe("http://127.0.0.1:43124/control-ui/");
505511506512const healthResponse = await fetchWithRetry(`${lab.listenUrl}/control-ui/healthz`);
507513expect(healthResponse.status).toBe(200);
@@ -512,6 +518,7 @@ describe("qa-lab server", () => {
512518expect(rootResponse.headers.get("x-frame-options")).toBeNull();
513519expect(rootResponse.headers.get("content-security-policy")).toContain("frame-ancestors 'self'");
514520expect(await rootResponse.text()).toContain("Control UI");
521+expect(authorizations).toEqual(["Bearer proxy-token", "Bearer proxy-token"]);
515522});
516523517524it("serves the built QA UI bundle when available", async () => {
@@ -742,14 +749,13 @@ describe("qa-lab server", () => {
742749],
743750});
744751lab.setControlUi({
745-controlUiUrl: "http://127.0.0.1:18789/",
746-controlUiToken: "late-token",
752+controlUiUrl: "http://127.0.0.1:18789/?password=late-password#token=late-token",
747753});
748754749755const bootstrap = (await (await fetchWithRetry(`${lab.baseUrl}/api/bootstrap`)).json()) as {
750756controlUiEmbeddedUrl: string | null;
751757};
752-expect(bootstrap.controlUiEmbeddedUrl).toBe("http://127.0.0.1:18789/#token=late-token");
758+expect(bootstrap.controlUiEmbeddedUrl).toBe("http://127.0.0.1:18789/");
753759754760const outcomes = (await (await fetchWithRetry(`${lab.baseUrl}/api/outcomes`)).json()) as {
755761run: {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。