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:
committed by
gsxdsm
parent
890494d00b
commit
6e2f4274ff
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user