fix(FN-4900): stop standalone promptWithFallback redispatch loop

Fusion-Task-Id: FN-4900
Fusion-Task-Lineage: ec7d26d7-4d38-4afd-b029-4b68d5f2db6f
This commit is contained in:
Fusion (runfusion.ai)
2026-05-17 08:53:53 -07:00
committed by gsxdsm
parent 890494d00b
commit 6e2f4274ff
2 changed files with 1 additions and 9 deletions

View File

@@ -12,6 +12,6 @@ describe("pi promptWithFallback recursion guard (FN-4900)", () => {
await expect(session.promptWithFallback("hello")).resolves.toBeUndefined();
expect(prompt).toHaveBeenCalledTimes(1);
expect(prompt).toHaveBeenCalledWith("hello", undefined);
expect(prompt).toHaveBeenCalledWith("hello");
});
});

View File

@@ -285,14 +285,6 @@ async function promptSessionAndCheck(session: AgentSession, prompt: string, opti
}
export async function promptWithFallback(session: AgentSession, prompt: string, options?: unknown): Promise<void> {
const maybePromptable = session as Partial<PromptableSession>;
if (typeof maybePromptable.promptWithFallback === "function") {
piLog.log(`promptWithFallback: delegating to session.promptWithFallback (prompt length=${prompt.length})`);
await maybePromptable.promptWithFallback(prompt, options);
piLog.log("promptWithFallback: completed");
return;
}
piLog.log(`promptWithFallback: calling session.prompt (prompt length=${prompt.length})`);
try {
await promptSessionAndCheck(session, prompt, options);