From c371c62d666cff3e89d60db1ca8960c47d2d6e90 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Fri, 7 Aug 2026 18:07:33 +0200 Subject: [PATCH] docs: correct onBeforeIteration contract for the fallback re-entry Co-Authored-By: Claude Opus 5 (1M context) --- frontend/src/lib/components/copilot/chat/chatLoop.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/chatLoop.ts b/frontend/src/lib/components/copilot/chat/chatLoop.ts index e3e407d6dc..df1789dc81 100644 --- a/frontend/src/lib/components/copilot/chat/chatLoop.ts +++ b/frontend/src/lib/components/copilot/chat/chatLoop.ts @@ -70,10 +70,10 @@ export interface ChatLoopConfig { * lets the caller recover partial output if the loop throws or is aborted. */ addedMessages?: ChatCompletionMessageParam[] - /** Called before each iteration (e.g. to refresh tool schemas, or to record - * which model it is about to use). `webSearch` is this iteration's effective - * value, and the system message is read after this returns, so a caller whose - * prompt advertises web search can resync it in time for this request. */ + /** Called before each request (e.g. to refresh tool schemas, or to record which + * model it is about to use), including again mid-iteration when a fallback + * changes `webSearch`. That argument is the effective value, and the system + * message is read after this returns, so a caller can resync its prompt in time. */ onBeforeIteration?: ( tools: Tool[], helpers: any,