fix: unblock live fixture recording

Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-08-31 16:33:47 +00:00
co-authored by Simon Shi
parent 72a81d672f
commit b1d66d6eb4
2 changed files with 50 additions and 44 deletions
+9
View File
@@ -0,0 +1,9 @@
export type RecorderStage = "patExchange" | "userinfo" | "modelList" | "chat";
export function classify(url: string): RecorderStage {
if (url.includes("/jobToken/exchange")) return "patExchange";
if (url.includes("/userinfo")) return "userinfo";
if (url.includes("/model/list")) return "modelList";
if (url.includes("/chat") || url.includes("/agent_chat_generation")) return "chat";
throw new Error(`[live] refusing to record unexpected endpoint: ${new URL(url).pathname}`);
}