Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 67 additions & 1 deletion frontend/src/components/agents/AgentsArtifactPane.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function deferred<T>() {

function renderPane(
activeTab: AgentArtifactTab = "tasks",
paneWorkspace = workspace(),
paneWorkspace: AgentConversationWorkspace | null = workspace(),
onPublishWorkspace = vi.fn(),
isPublishingWorkspace = false,
paneConversation = null,
Expand Down Expand Up @@ -629,6 +629,72 @@ describe("AgentsArtifactPane", () => {
useUiStore.setState({ activeModal: null, modalContext: undefined });
});

it("hydrates plan artifacts for an ideation conversation without a workspace link", async () => {
getIdeationSessionMock.mockResolvedValue({
session: {
id: "session-1",
projectId: "project-1",
title: "Planning session",
titleSource: "auto",
status: "active",
planArtifactId: null,
seedTaskId: null,
parentSessionId: null,
teamMode: null,
teamConfig: null,
createdAt: "2026-04-23T09:00:00Z",
updatedAt: "2026-04-23T09:00:00Z",
archivedAt: null,
convertedAt: null,
verificationStatus: "unverified",
verificationInProgress: false,
gapScore: null,
inheritedPlanArtifactId: null,
sessionPurpose: "general",
sessionFlow: "planning",
acceptanceStatus: null,
},
proposals: [],
messages: [],
});
getSessionPlanMock.mockResolvedValue({
id: "artifact-1",
type: "specification",
name: "Implementation Plan",
content: {
type: "inline",
text: "# Implementation Plan\n\nDo the work.",
},
metadata: {
createdAt: "2026-04-23T09:00:00Z",
createdBy: "orchestrator",
version: 1,
},
derivedFrom: [],
bucketId: "prd-library",
planApproval: {
status: "draft",
},
});

renderPane(
"plan",
null,
vi.fn(),
false,
{
...conversation(),
contextType: "ideation",
contextId: "session-1",
agentMode: "ideation",
},
);

await waitFor(() => expect(getIdeationSessionMock).toHaveBeenCalledWith("session-1"));
await waitFor(() => expect(getSessionPlanMock).toHaveBeenCalledWith("session-1"));
expect(screen.queryByText("No plan yet")).not.toBeInTheDocument();
});

it("anchors the active tab border to the bottom edge of the tab bar", async () => {
getIdeationSessionMock.mockResolvedValue({
session: {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/agents/AgentsArtifactPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ export const AgentsArtifactPane = memo(function AgentsArtifactPane({
}: AgentsArtifactPaneProps) {
const queryClient = useQueryClient();
const canHydrateIdeationArtifacts = Boolean(
focusedIdeationSessionId ||
conversation?.contextType === "ideation" ||
focusedIdeationSessionId ||
workspace?.mode === "ideation" ||
workspace?.mode === "plan" ||
workspace?.linkedIdeationSessionId ||
Expand Down
Loading