Skip to content

[Provider compatibility] Codex App delegated tasks fail on ollama-cloud with orphan tool result <missing-id> #3259

Description

@gongyu0918-debug

Client or integration

Codex App

Provider or upstream service

Ollama Cloud (ollama-cloud, ollama-native adapter)

OpenCodex version

2.39.0

Endpoint or capability

POST /v1/responses — delegated task startup and history conversion

Current behaviour

An Ollama Cloud model fails before producing its first response when it is assigned to a delegated child task in Codex App.

The same model works when a task is created normally and begins with a regular user message. The provider connection is healthy, model discovery succeeds, and a normal minimal request returns HTTP 200.

The failure was reproduced with:

  • ollama-cloud/deepseek-v4-flash:0731
  • ollama-cloud/glm-5.3-flash

Minimal redacted request or reproduction

  1. Connect Codex App to a healthy OpenCodex instance.
  2. Confirm that Ollama Cloud model discovery and a normal task both work.
  3. From an existing Codex App task, start a delegated child task and assign it an Ollama Cloud model.
  4. Let the child task begin.
  5. The child fails before any model output is produced.
  6. Start a separate task normally with the same model. It reaches Ollama Cloud successfully.

Actual response or error

Codex App reports:

unexpected status 502 Bad Gateway: Provider unreachable:
ollama-native orphan tool result <missing-id>

The delegated task history begins with a result-like item that has no call_id and no preceding matching call. During local history conversion, ollama-native classifies it as an orphan result and aborts the request. Diagnostics show that the failing request is rejected before an upstream request is sent.

There is also an error-mapping difference:

  • Without web search, the same history condition returns HTTP 400 invalid_request_error.
  • With web search enabled, it returns HTTP 502 Provider unreachable.

Expected behaviour

Delegated child tasks should start normally on Ollama Cloud models. The client bootstrap history should be normalized before native Ollama tool-history validation.

A local history-validation failure should not be reported as an unreachable upstream provider.

Additional context and attachments

Codex CLI: 0.144.6
OS: Windows 11, build 26200

Control results:

Ollama Cloud provider test: connected, 19 models discovered
Normal Ollama Cloud request: HTTP 200, upstream request sent
Delegated-task history failure: rejected locally, no upstream request sent

Upstream documentation

Activity

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

    providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions