• YanzheL's avatar
    test(gateway): add tests for content-based session hash fallback · 91a3cae5
    YanzheL authored and 陈曦's avatar 陈曦 committed
    - 20 unit tests for deriveOpenAIContentSessionSeed covering:
      - Empty/nil inputs, model-only, stable across turns
      - Different model/system/first-user produce different seeds
      - Tools, functions, developer role, structured content
      - Responses API: input string, input array, instructions, input_text typed items
      - JSON canonicalization (whitespace/key-order insensitive)
      - Prefix presence, empty tools ignored, messages preferred over input
    - 3 integration tests for GenerateSessionHash content fallback:
      - Content fallback produces stable hash
      - Explicit signals override content fallback
      - Empty body still returns empty hash
    91a3cae5
openai_content_session_seed_test.go 7.62 KB