Files
paseo/packages/app/e2e/browser/claude-workflow-subagent.real.spec.ts
T
Mohamed BoudraandGitHub f4e8522050 Show workflows in the subagent track (#2933)
* feat(server): show provider workflows in subagent track

Normalize workflow tasks into the provider-subagent contract so shared clients need no workflow awareness. Persisted nonterminal runs replay as failed because their original runtime can no longer deliver a terminal update.

* fix(server): preserve workflow replay and tool cards

* fix(server): suppress workflow notification cards

* fix(server): replay workflow child timelines

* fix(server): fail tasks when Claude exits

* fix(server): preserve workflow replay parity

* fix(server): fail tasks on Claude restart

* fix(server): hide workflow child prompts on replay

* fix: terminalize workflows on session reload

* fix(server): own workflow notification routing

* feat(server): show workflow results in detail pane

* fix(server): preserve unrestored task notifications

* fix(server): normalize replay task notifications
2026-08-06 21:01:26 +08:00

56 lines
2.2 KiB
TypeScript

import { mkdtempSync, realpathSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import { test } from "../support/fixtures";
import {
askClaudeToRunWorkflow,
expectSingleWorkflowParentCard,
expectWorkflowCompleted,
expectWorkflowRunning,
openWorkflowTimeline,
releaseWorkflow,
} from "../support/helpers/claude-workflow";
import { cleanupRewindFlow, launchAgent, type AgentHandle } from "../support/helpers/rewind-flow";
// Claude Code currently gates the Workflow tool behind its own rollout. The real-provider test
// opts in explicitly so it tests Paseo's integration rather than the account's rollout cohort.
process.env.CLAUDE_CODE_WORKFLOWS = "1";
const WORKFLOW_SCRIPT = path.resolve(__dirname, "../fixtures/claude-workflow/one-child.js");
test.describe("real Claude workflow subagent row", () => {
test.setTimeout(300_000);
test("shows a real Claude workflow running and completed through the generic subagent UI", async ({
page,
}, testInfo) => {
const cwd = realpathSync(mkdtempSync(path.join(tmpdir(), "paseo-claude-workflow-row-")));
const gatePath = path.join(cwd, "release-workflow");
let handle: AgentHandle | undefined;
try {
handle = await launchAgent({ page, provider: "claude", cwd, mode: "full-access" });
await test.step("ask Claude to run the workflow", async () => {
await askClaudeToRunWorkflow(handle!, WORKFLOW_SCRIPT, gatePath);
await expectWorkflowRunning(page);
await page.screenshot({ path: testInfo.outputPath("workflow-running.png") });
releaseWorkflow(gatePath);
});
await test.step("see the workflow finish without leaving a running row", async () => {
await expectWorkflowCompleted(page);
await expectSingleWorkflowParentCard(page);
await page.screenshot({ path: testInfo.outputPath("workflow-completed.png") });
});
await test.step("open the workflow through the existing provider-subagent pane", async () => {
await openWorkflowTimeline(page);
await page.screenshot({ path: testInfo.outputPath("workflow-timeline.png") });
});
} finally {
await cleanupRewindFlow({ handle, cwd });
}
});
});