Skip to content

codex 透传报错 #490

Description

@wtj-0527

报错如下:
Response input messages must contain the word 'json' in some form to use 'text.format' of type 'json_object'.

请求如下:

curl 'https://chatgpt.com/backend-api/codex/responses' \
  -H 'Accept: text/event-stream' \
  -H 'Version: 0.144.1' \
  -H 'Originator: axonhub' \
  -H 'Session-Id: e7dc302b-4dd3-4699-b6e4-68c09bcd1a51' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: ******' \
  -H 'X-Forwarded-By: lzc-ingress' \
  -H 'Conversation_id: e7dc302b-4dd3-4699-b6e4-68c09bcd1a51' \
  -H 'Chatgpt-Account-Id: 22cb1255-0fd9-42a1-af47-ad509654a2b6' \
  -d '{"text":{"format":{"type":"json_object"}},"input":[{"role":"user","type":"message","content":[{"text":"Title: Unicode 令牌预算估算应采用 UTF-8 字节上界\n\nMemory:\n令牌预算估算不能对 Unicode 文本采用可能低估风险的简化 fallback,而应使用保守的 UTF-8 字节上界。非 ASCII 文本可能使简化估算显著低于真实 tokenizer 结果,进而导致上下文预算严重低估。修改相关逻辑时应覆盖所有令牌估算调用路径,并保留 Unicode 回归测试,以防止仅修复单一路径后其他运行时路径仍发生低估。","type":"input_text"}]}],"model":"gpt-5.4","store":false,"tools":[{"name":"classify_memory_unit_type","type":"function","parameters":{"type":"object","required":["unit_type","confidence","rationale"],"properties":{"rationale":{"type":"string","description":"Short reason grounded in the memory text."},"unit_type":{"enum":["fact","preference","decision","plan","procedure","learning","context","event"],"type":"string","description":"The single best unit_type."},"confidence":{"type":"number","description":"0..1 confidence in the classification."}}},"description":"Classify one durable memory into Nowledge Mem'\''s closed unit_type vocabulary."}],"stream":true,"include":["reasoning.encrypted_content"],"reasoning":{"summary":"auto"},"instructions":"Classify one durable memory into exactly one Nowledge Mem unit_type.\nAlways call classify_memory_unit_type.\nUse the closed vocabulary only:\n- fact: A stable objective statement, observation, or data point with no stronger behavioral, temporal, or procedural role.\n- preference: A user'\''s or owner'\''s preferred behavior, style, or constraint.\n- decision: A committed choice, tradeoff, or rejected alternative.\n- plan: An intended future action, roadmap item, or open next step.\n- procedure: A reusable how-to, runbook, command sequence, workflow, or operational rule for doing something again.\n- learning: A reusable lesson, gotcha, correction, or failure pattern that does not itself prescribe a repeatable workflow.\n- context: Background context, project state, identity, or scoping information.\n- event: A time-bound occurrence, meeting, milestone, incident, or deadline.\nImportant distinctions:\n- fact is for objective statements only; do not use fact as an '\''unknown'\'' bucket when another type fits.\n- preference is an always-on behavioral or style constraint.\n- procedure is a repeatable workflow, runbook, operational rule, command sequence, or how-to; it is evidence for skills but is not itself a skill.\n- learning is a lesson/gotcha/correction; if the memory includes the fix, prevention rule, or repeatable way to handle the gotcha, choose procedure.\n- decision is a committed choice; if the durable value is how to repeat the chosen process, choose procedure.\n- schema, API, storage, architecture, naming, or product-boundary choices are decision when the durable value is '\''use this design / do not use that design'\'', even if phrased imperatively.\n- do not classify a one-off design choice as procedure merely because it says '\''use X'\'' or '\''do not add Y'\''; choose procedure only when it gives a reusable execution workflow for future work.\n- if the memory describes how to handle future instances of a recurring situation (for example: for large imports, do not auto-run expensive work; show a plan; let the user schedule a bounded job), choose procedure.\n- decision records the chosen design; procedure tells an agent or system what to do next time that situation happens.\n- plan is future intent; if it is already a reusable way of working, choose procedure.\n- context is background state or identity when no stronger type applies.\n- crystal is not a unit_type; crystals still use one of the eight types.\nWhen uncertain, choose the closest valid type with low confidence; choose fact only for objective statements.\n\nReturn the result as one valid json object.","parallel_tool_calls":true}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions