fix: persist workbench turn admission before preflight
This commit is contained in:
@@ -35,3 +35,21 @@ test.describe("submit session authority", () => {
|
||||
expect(legacyGets).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("submit admission failure", () => {
|
||||
test.use({ scenarioId: "admission-unavailable" });
|
||||
|
||||
test("not-admitted chat failure restores draft and does not add preflight routes", async ({ page }) => {
|
||||
await gotoWorkbench(page, "/workbench/sessions/ses_completed");
|
||||
const draft = "admission unavailable draft must survive";
|
||||
await page.locator(selectors.commandInput).fill(draft);
|
||||
await page.locator(selectors.commandSend).click();
|
||||
await expect(page.locator(selectors.commandInput)).toHaveValue(draft);
|
||||
await expect(page.locator(`${selectors.messageCard}[data-role="agent"][data-status="failed"]`).last()).toContainText("admission_unavailable");
|
||||
|
||||
const state = await fakeServerState(page);
|
||||
expect(state.chatRequests).toHaveLength(1);
|
||||
const forbiddenPreflights = (state.requestLedger as Array<{ method?: string; path?: string }>).filter((item) => /billing|readiness|preflight|agentrun/iu.test(item.path ?? ""));
|
||||
expect(forbiddenPreflights).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user