Skip to content

Stop posting Jev custom endpoints to /chat/completions - #819

Draft
mnvsk97 wants to merge 2 commits into
mainfrom
cursor/gateway-custom-endpoint-chat-c4d4
Draft

mnvsk97 wants to merge 2 commits into
mainfrom
cursor/gateway-custom-endpoint-chat-c4d4

Conversation

@mnvsk97

@mnvsk97 mnvsk97 commented Sep 19, 2026

Copy link
Copy Markdown

Summary

Agent turns against a TrueFoundry custom endpoint named Jev failed with Request failed (404): Not Found on https://gateway.truefoundry.ai/proxy-api/jev/custom-endpoint/chat/completions.

Jev is TypeSafe's evaluation API (POST /v1/systemone), not an OpenAI chat model. The gateway custom-endpoint proxy forwards the extra path as-is, and the OpenAI-compatible client always appends /chat/completions, so the upstream returns FastAPI's {"detail":"Not Found"}. Jev also has no tools or streaming text, so it cannot run an agent turn.

Changes

  • Call TrueFoundry custom endpoints at {gateway}/proxy-api/{account}/{endpoint}, appending /chat/completions only when the upstream base is an OpenAI /vN root.
  • When the upstream is TypeSafe, or any other non-chat path, store invocation_error and reject the model with HTTP 422 before the LLM call.
  • If a Jev model is still pointed at a bare proxy root with no chat path, refuse the request instead of posting to /chat/completions. A 404 on that proxy path now names POST /v1/systemone.

How was this tested?

  • pnpm --filter @truefoundry/trueforge-core test -- tests/core/llm/VercelAILLM.model.test.ts tests/core/llm/VercelAILLM.stream.test.ts
  • pnpm --filter @truefoundry/trueforge test -- tests/unit/truefoundry/mapEnabledModels.test.ts tests/unit/truefoundry/TrueFoundryModelProviderStore.test.ts tests/unit/truefoundry/trueFoundryNaming.test.ts tests/unit/runtime/sessionResources.test.ts tests/unit/schemas/modelProvider.test.ts
  • pnpm --filter @truefoundry/trueforge-core typecheck and pnpm --filter @truefoundry/trueforge typecheck

Checklist

  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, python/trueforge_sdk, OpenAPI specs)
  • Full pnpm build, pnpm test, pnpm lint:ci, and pnpm format:check were not run; targeted tests, typecheck, and eslint on the changed sources passed
Open in Web Open in Cursor 

TrueFoundry custom endpoints are transparent proxies. Jev is TypeSafe's evaluation API (POST /v1/systemone), so the OpenAI-compatible client appending /chat/completions returns 404. Route OpenAI-compatible custom endpoints through proxy-api, and reject non-chat upstreams before the request.
@changeset-bot

changeset-bot Bot commented Sep 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9d7e282

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@truefoundry/trueforge-sdk Patch
@truefoundry/trueforge Patch
@truefoundry/trueforge-core Patch
@truefoundry/trueforge-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants