(chatId: string)
| 1176 | ]); |
| 1177 | |
| 1178 | export const chatDebugRuns = (chatId: string) => |
| 1179 | queryOptions({ |
| 1180 | queryKey: chatDebugRunsKey(chatId), |
| 1181 | queryFn: () => API.experimental.getChatDebugRuns(chatId), |
| 1182 | refetchInterval: ({ state }) => { |
| 1183 | // Keep polling on error with backoff so a transient fetch |
| 1184 | // failure does not freeze the panel until a manual remount. |
| 1185 | if (state.status === "error") { |
| 1186 | return DEBUG_RUN_ERROR_POLL_MS; |
| 1187 | } |
| 1188 | // Consistent foreground cadence while the Debug tab is open. |
| 1189 | // A slower terminal-state interval would delay discovery of |
| 1190 | // newly-started runs until the user switches tabs. |
| 1191 | return DEBUG_RUN_POLL_MS; |
| 1192 | }, |
| 1193 | refetchIntervalInBackground: false, |
| 1194 | }); |
| 1195 | |
| 1196 | export const chatDebugRun = (chatId: string, runId: string) => |
| 1197 | queryOptions({ |
no test coverage detected