From 0f7804293d1a61aa5bccdaa6fec006b1d2136c82 Mon Sep 17 00:00:00 2001 From: nams1570 Date: Mon, 16 Mar 2026 13:27:07 -0700 Subject: [PATCH 1/2] chore: skip failing cli tests The three cli tests that were failing on dev were failing because they required the create mode flag to be set. The hardcode to link made the create paths unreachable. Since we don't have local emulator working, allowing users to pass in opts.mode would be bad practice- they'd be triggering local emulator actions without the local emulator being set up. --- apps/e2e/tests/general/cli.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/e2e/tests/general/cli.test.ts b/apps/e2e/tests/general/cli.test.ts index bb8a9ebbde..82d5a7ba10 100644 --- a/apps/e2e/tests/general/cli.test.ts +++ b/apps/e2e/tests/general/cli.test.ts @@ -348,7 +348,9 @@ describe("Stack CLI", () => { // --- init command tests --- - it("init create writes stack.config.ts with selected apps", async ({ expect }) => { + // TODO: Re-enable these create-mode tests once init mode handling is finalized. + // We keep these skipped (instead of todo) so the test logic remains visible and easy to re-enable. + it.skip("init create writes stack.config.ts with selected apps", async ({ expect }) => { const initDir = path.join(tmpDir, "init-create"); fs.mkdirSync(initDir, { recursive: true }); @@ -367,7 +369,7 @@ describe("Stack CLI", () => { expect(parsed.apps.installed.teams).toEqual({ enabled: true }); }); - it("init create with single app", async ({ expect }) => { + it.skip("init create with single app", async ({ expect }) => { const initDir = path.join(tmpDir, "init-create-single"); fs.mkdirSync(initDir, { recursive: true }); @@ -450,7 +452,7 @@ describe("Stack CLI", () => { expect(stderr).toContain("not found"); }); - it("init outputs setup instructions", async ({ expect }) => { + it.skip("init outputs setup instructions", async ({ expect }) => { const initDir = path.join(tmpDir, "init-instructions"); fs.mkdirSync(initDir, { recursive: true }); From 181efb862248774d2e36245ecef36f12359abbec Mon Sep 17 00:00:00 2001 From: nams1570 Date: Mon, 16 Mar 2026 14:29:42 -0700 Subject: [PATCH 2/2] fix: flaky validation test in ai endpoint Previously, this test was flaky because it involved a call to the AI endpoint when it didn't need to. The test's previous comments indicated it was just for schema validation. This test was in a block that was run even when there was no key for the job. Now it's pure validation --- .../backend/endpoints/api/v1/ai-query.test.ts | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/apps/e2e/tests/backend/endpoints/api/v1/ai-query.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/ai-query.test.ts index 14921e4339..cb91d97b53 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/ai-query.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/ai-query.test.ts @@ -114,6 +114,8 @@ describe("AI Query Endpoint - Validation", () => { }); it("rejects invalid tool names", async ({ expect }) => { + // Deterministic non-AI check: this payload is schema-valid, then rejected by + // route-level tool-name validation before any model/provider call. const response = await niceBackendFetch("/api/v1/ai/query/generate", { method: "POST", accessType: "admin", @@ -196,23 +198,6 @@ describe("AI Query Endpoint - Validation", () => { expect(response.body).toMatchObject({ code: "SCHEMA_ERROR", error: expect.stringContaining("messages") }); }); - it("accepts valid request body with all required fields", async ({ expect }) => { - // This will forward to production, so we just verify it doesn't fail validation - const response = await niceBackendFetch("/api/v1/ai/query/generate", { - method: "POST", - accessType: "admin", - body: { - quality: "dumb", - speed: "fast", - tools: [], - systemPrompt: "command-center-ask-ai", - messages: [{ role: "user", content: "test" }], - }, - }); - - expect(response.body).not.toMatchObject({ code: "SCHEMA_ERROR" }); - - }, 10000); // 60 seconds for AI API call }); describeWithAi("AI Query Endpoint - Authentication", () => {