Skip to content

[Provider compatibility] Empty-ID model row rejects discovery and leaves new provider selection pending #7910

Closed

Description

@HuntJhone

Client or integration

DeepSeek Harness Desktop 0.2.1-rc.3 and direct HTTP requests to the OpenCodeX OpenAI-compatible API.

Provider or upstream service

A third-party new-api-style gateway, configured as a custom openai-chat provider. The upstream domain, credentials, account details, request IDs, and local paths are omitted.

OpenCodeX version

@bitkyc08/opencodex 2.93.0, Windows x64.

Endpoint or capability

Upstream GET /v1/models, automatic model discovery, initial model selection, and downstream model publication.

Current behaviour

An authenticated upstream GET /v1/models returned HTTP 200 with valid JSON containing 29 entries. The first entry has an empty id; the other 28 entries have nonempty IDs. The actual first entry was:

{"id":"","object":"model","created":1626777600,"owned_by":"custom","supported_endpoint_types":[]}

Actual response or error

OpenCodeX rejects the entire listing and logs:

[opencodex] Provider model discovery for "<custom-provider>" returned malformed 2xx data [status=200, contentType=application/json, urlClass=provider-models, fallback=configured].

Authenticated chat completions with a valid model ID work, both directly upstream and through OpenCodeX. Thus the endpoint is callable even though its listing contains one invalid record.

Initial-selection interaction

Adding a static models list while retaining live discovery did not resolve publication for this newly registered provider:

  • The configured models appeared in the management inventory.
  • An explicitly provider-qualified chat completion succeeded through the proxy.
  • initialModelSelection.status remained pending.
  • No provider-qualified models appeared in downstream /v1/models.

Setting liveModels: false resolved this: the configured roster became authoritative, initial selection changed to ready, and 19 provider-qualified entries appeared in downstream /v1/models. The stored list contained 28 model IDs; not all were published as chat models.

Minimal redacted request or reproduction

Configure a custom openai-chat provider whose models endpoint responds with a mixed valid/invalid listing like this reduced example:

{
  "object": "list",
  "data": [
    {"id": "", "object": "model"},
    {"id": "example-chat-model", "object": "model"}
  ]
}

This is a reduced representation of the captured 29-row upstream response, not a separately executed local mock-server test.

  1. Register the provider with live model discovery enabled.
  2. Refresh the model inventory and inspect the discovery error.
  3. For a newly registered provider, add the valid model ID to its configured models list while leaving live discovery enabled.
  4. Compare the management inventory, downstream /v1/models, and initialModelSelection.status.
  5. As a control, use liveModels: false with the configured valid list.

Expected behaviour

The empty-ID entry is malformed upstream data; this report is not claiming it complies with the OpenAI model-list contract.

Could OpenCodeX support an explicit, bounded compatibility mode that skips individually invalid rows, retains the valid rows, and emits a sanitized warning with the skipped-row count? DeepSeek Harness's model-list discovery skipped the invalid entry and successfully listed the remaining models against this same endpoint.

If failing the entire response is intentional, an actionable message directing users to liveModels: false plus a configured list would also help. In particular, fallback=configured can be misleading for a newly registered provider whose initial selection remains pending and whose fallback models therefore remain hidden from downstream pickers.

Upstream documentation

No public provider-specific specification was verified. The evidence is the observed authenticated response and successful chat calls. The invalid empty-ID row is acknowledged as an upstream defect.

Suggested mapping or implementation notes

Local source inspection in 2.93.0 identified these related paths:

  • src/providers/model-discovery.ts: extractProviderModelItems returns invalid_shape for the whole result when an individual row fails isValidModelDiscoveryModelId.
  • src/providers/initial-model-selection.ts: pending registrations are reconciled only for authoritative providers (apart from the login-provider branch).
  • src/codex/catalog/model-visibility.ts: pending providers are excluded from the public model roster.
  • src/codex/catalog/provider-models.ts: liveModels: false makes the configured roster authoritative and clears discovery failure status.

Any row-level tolerance should preserve byte/row limits, model-ID safety checks, destination policy, and admission filters. Invalid IDs should not be published or silently renamed; all-invalid or ambiguous responses should not become an authoritative empty catalog accidentally. Opt-in behaviour may be preferable if strict discovery is a deliberate security boundary.

Checks

Working workaround

Use the supported static-catalog configuration rather than live discovery:

{
  "adapter": "openai-chat",
  "baseUrl": "https://gateway.example/v1",
  "authMode": "key",
  "apiKey": "<REDACTED>",
  "liveModels": false,
  "defaultModel": "example-chat-model",
  "models": ["example-chat-model"]
}

This restores listing and calling, but the configured roster needs maintenance as upstream models change.

Please let me know if this is better treated as a compatibility option, a diagnostic improvement, or a separate initial-selection UX issue.

Activity

  1. added
    provider-compatibility
    provider
    on Oct 28, 2026
  2. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  3. Ingwannu commented on Oct 29, 2026

    @Ingwannu
    Owner

    Checked current dev 9b78a16f4fe0c300527e6b183052407269bb941d. The two source behaviors you identified still hold: extractProviderModelItems rejects the complete listing when any admitted row has an invalid id (src/providers/model-discovery.ts:542), and a newly registered provider remains pending until an authoritative roster reaches reconcileInitialModelSelections (src/providers/initial-model-selection.ts:93). A configured fallback inventory therefore does not itself establish published picker availability. This is not a Windows-specific parser result.

    The static recovery you documented is consistent with those contracts: use a maintained valid models roster with liveModels: false; do not manually forge initialModelSelection or treat a malformed response as authoritative empty discovery. The bounded compatibility proposal needs a separate explicit contract for mixed rows, all-invalid results, deduplication, filters and byte/row limits before implementation; blindly skipping invalid rows globally would change an existing boundary.

    Keeping this open as a diagnostic/compatibility gap. The reduced two-row example is enough for an offline regression; no credentials, actual gateway domain or personal response is needed. I have not executed your gateway request or claimed a new compatibility setting exists.

  4. lidge-jun commented on Nov 10, 2026

    @lidge-jun
    Owner

    Rechecked on dev df0e6ccc4: extractProviderModelItems still rejects the whole listing on one invalid id (src/providers/model-discovery.ts). As the earlier triage said, skipping rows globally would change an existing boundary, so this is an owner decision:

    1. Status quo plus a better diagnostic. Keep rejecting the listing, but have the malformed-2xx log name the first offending row index and reason, so the liveModels: false recovery is discoverable.
    2. Per-provider opt-in, for example modelDiscovery.skipInvalidRows: true. Rows with an empty or invalid id are skipped and counted in the diagnostic. An all-invalid listing stays malformed and is never an authoritative empty roster. Deduplication, filters, and row and byte limits apply to the surviving rows.
    3. Skip invalid rows for every provider. Not recommended, for the reason above.

    Recommendation: 1 and 2 together. Neither changes behavior for a provider that does not opt in.

  5. added
    needs-design
    on Nov 10, 2026
  6. lidge-jun commented on Nov 10, 2026

    @lidge-jun
    Owner

    Decision: options 1 and 2. A better malformed-listing diagnostic plus a per-provider opt-in modelDiscovery.skipInvalidRows; an all-invalid listing stays malformed and is never treated as an empty roster.

  7. removed
    needs-design
    on Nov 10, 2026
  8. added a commit that references this issue on Nov 10, 2026
    4e83a8e
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-compatibility

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions