fix(codex): load persisted threads only on explicit send after refusal

This commit is contained in:
2026-10-20 18:46:17 +01:00
parent d564765ca5
commit 03a508fa2b
4 changed files with 119 additions and 5 deletions
+5 -1
View File
@@ -42,7 +42,11 @@ func modelTestChat(t *testing.T, handle func(string, json.RawMessage) any) *Chat
return
}
result := handle(req.Method, req.Params)
if err := wsjson.Write(ctx, conn, map[string]any{"id": req.ID, "result": result}); err != nil {
response := map[string]any{"id": req.ID, "result": result}
if failure, ok := result.(*rpcError); ok {
response = map[string]any{"id": req.ID, "error": failure}
}
if err := wsjson.Write(ctx, conn, response); err != nil {
return
}
}