Skip to content

[Feature]: Support self-hosted JEV-compatible decision endpoints #6268

Closed

Description

@jyu-zhou

Summary

OpenCodex 2.72.0's JEV Combo cannot use a self-hosted JEV-compatible typed-decision service, even when the jev provider is configured with a local endpoint and allowPrivateNetwork: true.

This prevents local replacements such as Laya-MLX from serving the decision step while keeping the normal Combo targets unchanged.

Reproduction

Environment: macOS, OpenCodex 2.72.0, local jev provider, Combo strategy jev.

Example provider configuration (the key is only a non-secret placeholder):

{
  "jev": {
    "adapter": "jev-decision",
    "baseUrl": "http://127.0.0.1:8001/v1/systemone",
    "authMode": "key",
    "apiKey": "local-placeholder",
    "allowPrivateNetwork": true
  }
}

The local service implements the System One decision contract, exposes a /models discovery endpoint, and returns a typed route choice such as answers.route.choice.

Observed behavior:

  1. Model discovery succeeds with HTTP 200.
  2. A 6-Astra request also succeeds with HTTP 200.
  3. The local service receives the discovery GET, but no decision POST.
  4. OpenCodex request history records jevDecision.gate = "missing_key" and routes to the first eligible target instead.

Root cause in v2.72.0

The current implementation has three coupled constraints:

  • src/combos/jev.ts only treats the configured jev provider as authoritative when providerMatchesRegistryTransport("jev", configured) is true. A local base URL does not match the registry's official TypeSafe URL, so the configured key and destination are ignored.
  • The resolver posts to the hard-coded JEV_API_URL instead of the configured provider base URL.
  • src/lib/provider-outbound.ts rejects every non-HTTPS POST before the private-network policy can evaluate an explicitly opted-in loopback/private destination.
  • The provider connectivity probe in src/server/management/provider-routes.ts only runs the JEV decision probe for the canonical registry transport.

Relevant source files:

Proposed behavior

Please add an explicit, backward-compatible opt-in for self-hosted JEV-compatible endpoints:

  • When the jev provider uses adapter: "jev-decision", a non-empty baseUrl, and allowPrivateNetwork: true, use that configured endpoint and configured API key for the JEV decision request.
  • Keep the current official TypeSafe JEV URL and credential behavior as the default when no custom endpoint is configured.
  • Allow http: only for destinations proven to be loopback/localhost/private and explicitly allowed by allowPrivateNetwork; continue requiring HTTPS for public destinations.
  • Continue rejecting metadata, link-local, and unspecified destinations, and preserve redirect blocking.
  • Use the same configured endpoint in the provider connectivity probe.
  • Keep the existing fail-open behavior for timeout, network, HTTP, malformed, or invalid decisions.

A separate provider field such as decisionService would also work if that is preferable to extending the jev provider semantics. The important part is an explicit opt-in rather than silently accepting arbitrary JEV destinations.

Suggested acceptance coverage

  • Existing canonical TypeSafe JEV tests remain unchanged.
  • A loopback HTTP fixture receives the decision POST and produces gate: "apply".
  • Missing credentials, timeout/network errors, malformed responses, and invalid choices still fall back safely.
  • The connectivity test succeeds for an opted-in self-hosted endpoint.
  • Security tests reject public HTTP, metadata, link-local, and unspecified destinations.

Activity

  1. added
    enhancement
    on Sep 29, 2026
  2. Ingwannu commented on Oct 1, 2026

    @Ingwannu
    Owner

    There are overlapping implementations for this request: #6275 and the JEV work in #6302 (the separate #6348 was closed after being folded into #6302). Please converge on one owner-selected contract before integration rather than landing competing endpoint/key resolution behavior. In particular, discovery success is not decision-POST proof: acceptance needs the actual outbound policy against an explicitly configured local service, the matching credential destination, typed-decision parsing, and unchanged fallback when unavailable. None of these draft PRs is a shipped fix yet.

  3. github-actions commented on Oct 1, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  4. lidge-jun commented on Oct 1, 2026

    @lidge-jun
    Owner

    Fixed on dev by #6364 (squash 06cc3815c0). A JEV combo can now point its decision at a self-hosted System One-compatible endpoint: add a jev-decision provider whose baseUrl is the full /v1/systemone URL and set the combo's decisionProvider. Private-network endpoints require allowPrivateNetwork: true on that row, and TypeSafe credentials are never sent there. A combo can also decide with any model opencodex already routes. The setup is in the combo guide. It ships in the next release. Thanks for the report, @jyu-zhou.

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

    enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions