feat(FN-1433): wire prompt overrides into mission interview service
- Import resolvePrompt and PromptOverrideMap from @fusion/core
- Add promptOverrides parameter to all agent creation paths:
- createMissionInterviewSession
- submitMissionInterviewResponse
- retryMissionInterviewSession
- initializeAgent
- createMissionInterviewAgent
- ensureMissionInterviewAgent
- Use resolvePrompt('planning-system', promptOverrides) for effective prompt
- Fall back to MISSION_INTERVIEW_SYSTEM_PROMPT when override absent
- Update module docs to reflect prompt override behavior
This commit is contained in:
@@ -497,7 +497,7 @@ function TaskCardComponent({
|
||||
task.column,
|
||||
task.mergeDetails?.commitSha,
|
||||
projectId,
|
||||
{ enabled: isInViewport },
|
||||
{ enabled: isInViewport, worktree: task.worktree },
|
||||
);
|
||||
|
||||
// Get fresh batch data if available
|
||||
@@ -910,17 +910,24 @@ function TaskCardComponent({
|
||||
</>
|
||||
);
|
||||
})()}
|
||||
{task.worktree && (task.column === "in-progress" || task.column === "in-review") && (
|
||||
<button
|
||||
type="button"
|
||||
className="card-session-files"
|
||||
onClick={handleOpenFiles}
|
||||
disabled={!onOpenDetailWithTab}
|
||||
>
|
||||
<Folder size={12} />
|
||||
<span>View files</span>
|
||||
</button>
|
||||
)}
|
||||
{task.worktree && (task.column === "in-progress" || task.column === "in-review") && (() => {
|
||||
const activeCount = diffStats?.filesChanged;
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="card-session-files"
|
||||
onClick={handleOpenFiles}
|
||||
disabled={!onOpenDetailWithTab}
|
||||
>
|
||||
<Folder size={12} />
|
||||
<span>
|
||||
{activeCount != null && activeCount > 0
|
||||
? `${activeCount} ${activeCount === 1 ? "file" : "files"} changed`
|
||||
: "View files"}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
})()}
|
||||
{task.column === "done" && (() => {
|
||||
// Prefer diff stats from the same endpoint the modal uses so the
|
||||
// count is always consistent with the Changes tab.
|
||||
|
||||
@@ -3227,13 +3227,54 @@ describe("TaskCard singular/plural file count", () => {
|
||||
mockUseTaskDiffStats.mockReturnValue({ stats: null, loading: false });
|
||||
});
|
||||
|
||||
it("shows a static files action for in-progress worktrees without fetching file counts", () => {
|
||||
it("shows changed-file counts for in-progress worktrees", () => {
|
||||
const task = makeTask({
|
||||
column: "in-progress",
|
||||
worktree: "/repo/.worktrees/fn-099",
|
||||
status: "executing",
|
||||
});
|
||||
mockUseSessionFiles.mockReturnValue({ files: ["src/a.ts"], loading: false });
|
||||
mockUseTaskDiffStats.mockReturnValue({ stats: { filesChanged: 3, additions: 10, deletions: 2 }, loading: false });
|
||||
|
||||
render(
|
||||
<TaskCard
|
||||
task={task}
|
||||
onOpenDetail={vi.fn()}
|
||||
addToast={noopToast}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.getByText("3 files changed")).toBeInTheDocument();
|
||||
expect(screen.queryByText("View files")).not.toBeInTheDocument();
|
||||
expect(screen.queryByText("Checking files…")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows changed-file counts for in-review worktrees", () => {
|
||||
const task = makeTask({
|
||||
column: "in-review",
|
||||
worktree: "/repo/.worktrees/fn-099",
|
||||
status: "reviewing",
|
||||
});
|
||||
mockUseTaskDiffStats.mockReturnValue({ stats: { filesChanged: 2, additions: 7, deletions: 1 }, loading: false });
|
||||
|
||||
render(
|
||||
<TaskCard
|
||||
task={task}
|
||||
onOpenDetail={vi.fn()}
|
||||
addToast={noopToast}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.getByText("2 files changed")).toBeInTheDocument();
|
||||
expect(screen.queryByText("View files")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("falls back to View files for in-progress worktrees without a positive diff count", () => {
|
||||
const task = makeTask({
|
||||
column: "in-progress",
|
||||
worktree: "/repo/.worktrees/fn-099",
|
||||
status: "executing",
|
||||
});
|
||||
mockUseTaskDiffStats.mockReturnValue({ stats: { filesChanged: 0, additions: 0, deletions: 0 }, loading: false });
|
||||
|
||||
render(
|
||||
<TaskCard
|
||||
@@ -3245,27 +3286,6 @@ describe("TaskCard singular/plural file count", () => {
|
||||
|
||||
expect(screen.getByText("View files")).toBeInTheDocument();
|
||||
expect(screen.queryByText(/files? changed/)).not.toBeInTheDocument();
|
||||
expect(screen.queryByText("Checking files…")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("does not use session file counts for in-progress worktree cards", () => {
|
||||
const task = makeTask({
|
||||
column: "in-progress",
|
||||
worktree: "/repo/.worktrees/fn-099",
|
||||
status: "executing",
|
||||
});
|
||||
mockUseSessionFiles.mockReturnValue({ files: ["src/a.ts", "src/b.ts"], loading: false });
|
||||
|
||||
render(
|
||||
<TaskCard
|
||||
task={task}
|
||||
onOpenDetail={vi.fn()}
|
||||
addToast={noopToast}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.getByText("View files")).toBeInTheDocument();
|
||||
expect(screen.queryByText("2 files changed")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("displays '1 file changed' (singular) for done column with displayCount=1 via diffStats", () => {
|
||||
|
||||
Reference in New Issue
Block a user