优化chatgpt检查

This commit is contained in:
2026-07-06 10:57:41 +08:00
parent e05db36f63
commit 713cca8f67
3 changed files with 10 additions and 23 deletions
@@ -14,6 +14,7 @@ import (
"io"
stdhttp "net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
@@ -879,6 +880,9 @@ func (c *Client) getConversation(ctx context.Context, session tlsclient.HttpClie
if err := ensureOK(resp.StatusCode, body, "conversation_get"); err != nil {
return nil, err
}
if dir := os.Getenv("CHATGPT_DEBUG_DUMP"); dir != "" {
_ = os.WriteFile(filepath.Join(dir, fmt.Sprintf("conv-%s-%d.json", conversationID, time.Now().UnixMilli())), body, 0o644)
}
var payload map[string]any
if err := json.Unmarshal(body, &payload); err != nil {
return nil, err