Skip to content

feat: reach a System One gateway of your own through TYPESAFE_BASE_URL - #17

Merged
FrancoisChastel merged 1 commit into
mainfrom
feat/own-gateway-setup
Oct 8, 2026
Merged

FrancoisChastel merged 1 commit into
mainfrom
feat/own-gateway-setup

Conversation

@FrancoisChastel

@FrancoisChastel FrancoisChastel commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

What

Makes a System One gateway of your own a first-class setup path, by treating it as what it already is: the proxy case the TypeSafe SDK knows. The gateway's key goes in TYPESAFE_API_KEY, its address in TYPESAFE_BASE_URL, and its model id in TYPESAFE_DEFAULT_MODEL when it is not jev-latest. No new variables, and nothing new to carry into harness configs.

This supersedes #16, which proposed the same goal through a separate custom provider with its own JEV_CODE_* variables. Thanks to @monanklynx for raising it and for the thorough spec.

  • setup offers "Other System One gateway" when it asks which host a pasted key is for, then asks for the URL and the model and stores the three variables together. An unusable URL stores nothing.
  • TYPESAFE_BASE_URL is checked before any request: an absolute http(s) URL with no credentials, query, or fragment, stopping before /v1/systemone. A bad value is a configuration problem in doctor and setup, and the value is never echoed.
  • doctor also shows a malformed override when no key is set yet.
  • README gains a "Your own gateway" section; SECURITY.md, the harness guides, the skill, .env.example, and --help get a line each.

Kept from #16: any System One gateway works, its key never borrows another host's, setup can take it interactively, the URL is validated without leaking it.
Left out: the parallel variable set, the zero-retry default for one kind of host, the display name (doctor labels a gateway as a TypeSafe-keyed proxy and says where requests go, as proxies already do), and the unrelated ignore-file changes.

How to verify

npm run check
npx vitest run tests/core/config.test.ts tests/cli/run.test.ts
TYPESAFE_API_KEY=x TYPESAFE_BASE_URL=https://gateway.example/api TYPESAFE_DEFAULT_MODEL=vendor/jev node dist/cli.js doctor
TYPESAFE_API_KEY=x TYPESAFE_BASE_URL=https://gateway.example/v1/systemone node dist/cli.js doctor   # refused
env -u TYPESAFE_API_KEY -u OPENROUTER_API_KEY -u AI_GATEWAY_API_KEY node dist/cli.js setup opencode --project   # paste a key, pick [5], give a URL

Checklist

  • npm run check passes
  • Tests added or updated
  • Docs updated where the contract or setup changed (README, docs/harnesses, skill references)
  • CHANGELOG.md entry under Unreleased

A gateway that speaks POST /v1/systemone is the proxy case the TypeSafe SDK
already has: the key in TYPESAFE_API_KEY, the address in TYPESAFE_BASE_URL,
TYPESAFE_DEFAULT_MODEL when the model id differs. Document it as such instead
of adding a parallel provider, and make the path first-class:

- setup offers "Other System One gateway" when asking which host a pasted key
  is for, asks for the URL and model, and stores the three variables together;
  an unusable URL stores nothing.
- TYPESAFE_BASE_URL is validated before any request (absolute http(s), no
  credentials, query or fragment, not ending in /v1/systemone). Failures are a
  configuration problem in doctor and setup and never echo the value.

Supersedes #16, keeping its goal and dropping the separate JEV_CODE_* variable
set, the custom retry default, and the unrelated ignore-file changes.
@FrancoisChastel
FrancoisChastel merged commit 61178cb into main Oct 8, 2026
4 checks passed
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.

1 participant