Skip to content

[Bug]: Codex Desktop + Grok 4.7 OAuth returns 400 for output.encrypted_content in include #7878

Closed

Description

@ethorxmomo777

Client or integration

Codex App

Area

Provider adapter

Summary

Codex Desktop 透過 OpenCodex 使用 xai/grok-4.7(SuperGrok 訂閱、Grok OAuth 登入)時,預設的 Responses 路徑回傳 HTTP 400:

Argument not supported: "output.encrypted_content" in "include" field

預期 OpenCodex 能適配用戶端與 xAI 的 Responses 欄位差異,讓已登入的 Grok 4.7 正常回應。

同一帳號、同一模型改用既有 modelAdapters["grok-4.7"] = "openai-chat" 後,帶著相同 include 選項的直接代理測試成功,包括串流回答、function call,以及回傳工具結果後的續答。這支持問題在 Responses 路徑的欄位相容性;沒有證據顯示此次失敗由訂閱或登入失效造成。

Reproduction

  1. 在 OpenCodex 綁定 Grok OAuth 帳號並啟用 xai/grok-4.7。
  2. 保留 Grok 4.7 的預設 Responses 路徑,沒有設定該模型的 openai-chat override。
  3. 在 Codex Desktop 選取 xai/grok-4.7,送出一般文字問題。
  4. 請求失敗,錯誤明確指出 include 中的 output.encrypted_content 不受支援。

本機共觀察到六次 HTTP 400,推理強度包含 high 與 medium。這些請求走 Responses → Responses,adapter 為 openai-responses,credential source 為 grok-oauth。

原始完整請求本文未保留/未公開;上述步驟與欄位是根據聊天錯誤及代理日誌整理,並非宣稱已捕獲完整 wire payload。

Version

OpenCodex 2.93.0

Codex Desktop session-reported CLI/runtime version: 0.165.0-alpha.1.2(不是另行確認的 Desktop app build number)。

Operating system

macOS 27.0.1

Provider and model

xai / grok-4.7, Grok OAuth / SuperGrok subscription

Logs or error output

{
  "code": "400",
  "error": "Argument not supported: \"output.encrypted_content\" in \"include\" field"
}

相關代理日誌摘錄(已移除帳號、對話與請求識別碼):

{
  "model": "grok-4.7",
  "provider": "xai",
  "requestedEffort": "medium",
  "configuredServiceTier": "default",
  "status": 400,
  "errorCode": "invalid_request_error",
  "attempts": [{
    "provider": "xai",
    "model": "grok-4.7",
    "adapter": "openai-responses",
    "status": 400,
    "credentialSource": "grok-oauth",
    "failureStage": "headers-only",
    "failureCause": "payload-rejected"
  }]
}

Redacted configuration

原本 xAI provider 中的模型協定設定如下;4.7 使用預設路徑:

{
  "authMode": "oauth",
  "modelAdapters": {
    "grok-4.5": "openai-chat",
    "grok-4.6": "openai-chat"
  }
}

暫時替代方案是在同一個 map 加上:

{
  "grok-4.7": "openai-chat"
}

Workaround verification and limits

透過管理 API 儲存 override,讀回確認已生效,沒有修改套件原始碼。接著直接呼叫本機代理的 /v1/responses,仍帶著 include: ["output.encrypted_content"],使用 medium effort:

  • 一般文字回應:HTTP 200 / completed。固定字串測試收到模型拒答,因此另做一般問題測試,不把 HTTP 200 當成指令遵循成功。
  • 一般問題的 SSE 串流:HTTP 200,收到答案與 response.completed,沒有 error event。
  • 指定的無副作用測試 function:收到正確 function name 和 arguments。
  • 回傳該 function 的結果後:收到正常續答。

四次測試日誌均確認 provider=xai、model=grok-4.7、adapter=openai-chat、credentialSource=grok-oauth、status 200,沒有其他模型或供應商備援。

尚未驗證修正後完整 Codex Desktop 任務、長對話、影像或 X/web search;Chat Completions 是目前的 workaround,並未修復原本的 Responses 路徑。

Related evidence

可能需要在 xAI Responses 邊界處理不受支援的 include 值。應過濾或映射、以及加密推理的保留方式,仍需維護者確認;不建議不分供應商直接移除整個 include。

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    account-pool
    provider
    on Oct 28, 2026
  2. Ingwannu commented on Oct 29, 2026

    @Ingwannu
    Owner

    Closing as completed on dev: #7911 merged as 392b786bcfee4078caa575e3fd0dee5b68eaf290, which I verified is an ancestor of current trusted dev 9b78a16f4fe0c300527e6b183052407269bb941d.

    The xAI Responses projection removes exactly output.encrypted_content from include, for the exact global/US HTTPS xAI destinations, preserving other entries/providers and the configured transport.

    I checked the implementation and the successful exact-head required CI for 0dff0cdfe5c188db67a4c834cb8336e4e7295315. Existing author regression receipts remain author-run evidence; I did not rerun unchanged passing suites or reproduce this on a live account/native client. This closure records the landed scope, not validation of the reporter's installed version or a release claim. If the same failure occurs on a build containing this commit, provide a new bounded, redacted reproduction against that build.

  3. ZarifS commented on Oct 30, 2026

    @ZarifS

    Additional Windows reproduction and verified workaround: OpenCodex 2.94.0, npm installation, Windows 11, xai/grok-4.7, Grok OAuth.

    I understand #7911 landed on dev; this confirms an affected installed release, not a regression of that commit. The installed source did not contain the output.encrypted_content normalization. OAuth reported loggedIn: true, status: complete.

    Minimal POST to the running local proxy's /v1/responses:

    {"model":"xai/grok-4.7","input":[{"role":"user","content":"What is 2 + 2? Answer briefly."}],"include":["reasoning.encrypted_content","output.encrypted_content"],"reasoning":{"effort":"medium"},"max_output_tokens":1024,"stream":false,"store":false}

    Reproduced HTTP 400:

    {"code":"400","error":"Argument not supported: \"output.encrypted_content\" in \"include\" field"}

    The request log showed one xai/grok-4.7 attempt, adapter=openai-responses, credentialSource=grok-oauth, status 400.

    Applied the supported modelAdapters["grok-4.7"] = "openai-chat" workaround through the management API, preserving existing overrides and the account. No package source or Codex catalog was manually patched, and no proxy restart was needed.

    Verified with tiny direct proxy requests, still including output.encrypted_content:

    • Same arithmetic request: HTTP 200 / completed, correct answer 4..
    • SSE arithmetic request: HTTP 200, answer 4, one response.completed, no error event.
    • Forced no-op function call: HTTP 200, correct function and arguments {"value":4}.
    • Stateless continuation supplying the function call and result: HTTP 200 / completed, correct returned value.

    All four success logs confirmed a single xai/grok-4.7 attempt, adapter=openai-chat, credentialSource=grok-oauth, status 200, with no other provider/model fallback. OAuth remained logged in.

    Limitations: not yet verified in a full restarted Codex Desktop task, long conversations, images, native Responses encrypted-state replay, or web/X search. This changes the upstream wire rather than fixing native Responses. Please include #7911 in the next stable release. No credentials, account identifiers, private prompts, or user paths included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolbugprovider

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions