fix: keep presentation deep links replay backed

This commit is contained in:
lda
2026-07-09 08:29:48 +07:00 Verified
parent 86832ab7ee
commit bee00a7a2f
7 changed files with 60 additions and 19 deletions
@@ -34,7 +34,7 @@ describe("useTimelineAgent", () => {
const { result } = renderHook(() => useTimelineAgent(demo, "live"));
await act(async () => result.current.runPreparedWorkflow());
expect(start).toHaveBeenCalledTimes(1);
expect(start).toHaveBeenCalledWith("live");
expect(result.current.messages.at(-1)?.parts).toEqual(
expect.arrayContaining([
expect.objectContaining({ type: "tool-result" }),
@@ -42,6 +42,16 @@ describe("useTimelineAgent", () => {
);
});
it("starts the replay walkthrough explicitly when replay is active", async () => {
const start = vi.fn();
const demo = demoController({ start });
const { result } = renderHook(() => useTimelineAgent(demo, "replay"));
await act(async () => result.current.runPreparedWorkflow());
expect(start).toHaveBeenCalledWith("replay");
});
it("submits selected issues from the current interrupt payload", async () => {
const submitSelectedIssues = vi.fn(async () => {});
const demo = demoController({
@@ -79,4 +89,4 @@ describe("useTimelineAgent", () => {
const { result } = renderHook(() => useTimelineAgent(demo, "live"));
expect(result.current.canRun).toBe(false);
});
});
});
@@ -48,7 +48,7 @@ export const useTimelineAgent = (
"timeline-agent-intro",
"assistant",
modeLabel === "live"
? "Live workflow server is available. I can run the prepared workflow now."
? "Live workflow target is configured. I can run the prepared workflow now."
: "Replay fallback is active. I can still walk through the prepared workflow evidence.",
),
]);
@@ -58,8 +58,7 @@ export const useTimelineAgent = (
const runPreparedWorkflow = useCallback(async () => {
if (!demo.canStart || demo.inFlight) return;
demo.restart();
demo.start();
demo.start(modeLabel);
setMessages((current) => appendToolMessage(
current,
"timeline-agent-start",
@@ -107,4 +106,4 @@ export const useTimelineAgent = (
submitSelectedIssues,
cancelReview,
};
};
};