Skip to content

Releases

v0.7.0

Choose a tag to compare

@dean0x dean0x released this 18 Nov 13:00
48fb532

Added

  • Shared routes with configuration version 2. You can set access profiles for
    your Claude and Codex subscription sign ins. You can also set named routes
    with an ordered list of fallback targets. When one subscription reaches its
    limit, the route uses the next target. A Claude route continues a
    conversation with signed history after the proxy restarts. On a route, a
    native Claude Messages response that is not streamed keeps its signed
    thinking blocks, in the correct order, with complete usage.
  • Configs without configVersion: 2 keep the previous routing.
  • Access profiles accept only subscription sign ins. A profile or route that
    names an API key account, an environment credential, API billing or
    sameModelApi fails at load. The error names the setting.
  • Access profiles and routes load only from your user config or from the file
    that SUBSWITCH_CONFIG names. A project config file that sets them fails at
    load.
  • The subswitch models --schema-version 3 --client <client> --json command
    shows the routes that a client can use.
  • The subswitch run-action command runs one native client command as one
    routed action. Its tools and child agents use the same route.
  • Subswitch records upstream limit errors in a private local store by default.
    The subswitch limits --json command shows them. Set
    SUBSWITCH_LIMIT_DIR to change the store directory. Set
    SUBSWITCH_LIMIT_RECORDING=0 to turn the record off.
  • Register gpt-6.2-sol, gpt-6.2-astra, gpt-6.1-terra, and claude-fable-5-2 in the built-in catalogs.
    Explicit routes targets accept these IDs with efforts low, medium, high, xhigh, and max.
    Model lists and doctor use these catalogs.
    Native Codex discovery preserves OpenAI's own rows and adds Claude rows from CLAUDE_MODELS.
  • Keep Terra 6.1 available by exact ID only through a preview entry.
    The terra default stays on gpt-5.6-terra.
    The Codex catalog requires Codex CLI 0.159.0 or later for Terra 6.1.
  • Apply Fable 5.2 limits on each translated path:
    • The Codex-client reverse leg rejects disabled thinking and forced tool choice with 400.
      It caps output at 128,000 tokens.
    • Claude Code explicit routes reject disabled thinking, forced tool choice, and max_tokens above 128,000 with 422 target_capability_unavailable.
    • The default Anthropic passthrough applies no local limit.
  • Use the Codex effort set for Sol 6.2 and Astra 6.2.
    Their model pages do not confirm xhigh or max per model.
    These sets are not live-verified.
  • Subswitch sends codex_cli_rs/0.144.6 as its default user agent.
    Access to the new Codex models with this value is not verified.
    Set providers.codex.userAgent to change this value.

Changed

  • The sol and astra family aliases now resolve to gpt-6.2-sol and gpt-6.2-astra.
    Older exact IDs remain routable.
  • The fable alias on the Codex-client reverse leg now resolves to claude-fable-5-2.
    Older Fable exact IDs remain routable.
  • The lock file uses newer versions of zod, ws and @clack/prompts.

v0.6.1

Choose a tag to compare

@dean0x dean0x released this 20 Oct 14:27
00a8577

Fixed

  • Configured Codex aliases now apply consistently to bare and provider-qualified
    names, including overrides such as sol and codex:sol.
  • Future model IDs declared as alias targets can be requested directly, both as
    the full ID and as codex:<model-id>. Registered IDs and existing alias names
    retain their precedence; unrelated unknown IDs remain unresolved.
  • doctor reports unregistered configured targets as warnings without failing
    the check solely for that reason. Unknown agent model names still fail.

Configured model IDs must be available to the upstream account. Forwarding an
override does not verify availability or add model capability metadata.

v0.6.0

Choose a tag to compare

@dean0x dean0x released this 08 Oct 17:50
de137de

Added

  • GPT-6.1 Sol (gpt-6.1-sol) with reasoning efforts low, medium, high,
    xhigh, and max. Unsupported efforts are dropped with a warning.
  • Claude Sonnet 5.5 (claude-sonnet-5-5) and Haiku 5.5 (claude-haiku-5-5) on
    the opt-in Codex → Claude leg, including native model discovery, 1M context
    windows, and 128K output ceilings. Haiku defaults to medium effort; Sonnet
    defaults to high.

Changed

  • sol now routes to gpt-6.1-sol without configuration. gpt-6-sol and
    older registered Sol IDs stay directly routable. Config overrides keep precedence.
  • sonnet now routes to claude-sonnet-5-5; haiku routes to
    claude-haiku-5-5.
    Sonnet 5 remains directly routable. Sonnet 5.5 rejects
    effort none and forced tool choice locally, matching its upstream restrictions;
    Haiku 5.5 supports disabled thinking and forced tool choice.
  • Verified the remaining defaults: Astra 6, Luna 6, Terra 5.6, Opus 5.5, and
    Fable 5.1. The README lists every family and its default target, and
    subswitch models --client all exposes both effective catalogs.
  • Clarified that family aliases track the newest model registered in the installed
    SubSwitch release. New provider releases require a SubSwitch update or a config
    alias; the proxy does not discover or guess future versions at startup.

v0.5.0

Choose a tag to compare

@dean0x dean0x released this 26 Sep 21:49

Added

  • Astra routing: gpt-6-astra and its astra family alias, with Astra-specific
    reasoning effort validation.

  • Opt-in native Codex → Claude routing for Sonnet, Opus and Fable, while OpenAI
    models continue to OpenAI and Codex retains native agents, tools and permissions.

  • Subscription authentication, credential refresh, readable collaboration messages,
    streamed/non-stream responses, prompt caching and bounded process-local replay.

  • init, doctor and models --client codex|all, native model discovery, and a
    user configuration fallback. Existing Claude Code setup remains the default.

  • Live native acceptance runners and shared parity follow-ups in issues #45–#48.

  • --client all selects all supported clients; both remains a compatibility alias.

  • GPT-6 Sol and Luna: gpt-6-sol and gpt-6-luna join the forward registry. Both
    accept reasoning effort low, medium, high, xhigh and max; none and
    minimal are dropped with an unsupported_effort_dropped warning.

  • Claude Opus 5.5 (claude-opus-5-5) on the Codex → Claude leg.

  • Per-model Claude capabilities: each registered Claude model declares its output-token
    ceiling, whether it always thinks, whether it accepts forced tool choice, and its default
    reasoning level. Native Codex model discovery advertises that default per model (medium
    for Opus 5.5, high for the others).

  • New reverse-leg 400 errors, returned before any upstream call:
    reasoning_effort_unsupported_by_model (effort none on a model that always thinks:
    Opus 5.5, Fable 5, Fable 5.1), tool_choice_unsupported_by_model (required or a named
    tool on Opus 5.5 or Fable 5.1), and unregistered_claude_model (a claude-* or
    claude:* name that no registered model or codexIngress.claude.aliases entry routes).

Changed

  • Supported Node versions are ^22.15.0 || >=24, matching native zstd and runtime dependency requirements.

  • Reverse routing includes the documented Claude identity preamble. Durable restart/compaction, setup undo and
    explicit API authentication for translated inference remain separate shared work.

  • User-level configuration now participates in every implicit config load, including
    forward-only runs. Project fields override it; explicit config selection bypasses it.
    Invalid user configuration can therefore prevent startup; diagnostics show its source.

  • Raw relay headers named by Connection are stripped on both legs in both directions.

  • Native Codex setup requires explicit trust for a custom upstream host before it writes files.

  • astra is now a reserved OpenAI model name for claude-ingress aliases (matched
    case-insensitively, including astra[...] family-suffix variants); a
    codexIngress.claude.aliases entry that claims it is rejected at config load,
    and the relay refuses to start until the alias is removed or renamed.

  • The sol and luna family aliases now resolve to gpt-6-sol and gpt-6-luna.
    terra stays on gpt-5.6-terra. gpt-5.6-sol and gpt-5.6-luna still route by exact id
    and appear as (direct) rows in subswitch models.

  • The opus alias on the Codex → Claude leg now resolves to claude-opus-5-5.
    claude-opus-5 still routes by its exact id.

  • gpt-5.5 is retired ahead of its Codex shutdown on 2026-10-14. It still routes by exact
    id (and as codex:gpt-5.5), but it no longer wins a family alias, counts toward the
    routable set (now 6 models) or appears in the subswitch models table.
    models --json lists it with retired: true and routable: false, and doctor reports
    an agent pinned to it as an info finding.

  • fable and best are reserved Claude Code model names alongside sonnet, opus,
    haiku, inherit and claude-*, as the exact word or with a [...] suffix. They are
    rejected as providers.codex.aliases keys or targets, and doctor no longer flags an
    agent with model: fable as unresolvable.

  • Reverse-leg max_tokens is capped at the model's output-token ceiling.

Fixed

  • Unregistered claude-* model names on the Codex → Claude leg are refused with
    unregistered_claude_model instead of being forwarded to OpenAI, on HTTP, WebSocket
    and over-window requests.

  • doctor recognises Claude-* and claude:* agent models as Claude names; its check was
    previously case-sensitive and missed the claude: form.

  • The development HTTP recorder now captures eligible streamed /responses
    replies even when the upstream omits Content-Type, without inspecting other
    missing-header responses.

  • Native Codex conversations can continue after cancelling a Claude response; pending
    replay handles and ordered cancellation notices no longer cause 409/400 failures.

  • Missing relay-side Claude credentials produce Claude-specific setup guidance without
    triggering native Codex to refresh its unrelated OpenAI login. Lost continuation
    errors now explain that a new conversation is required.

  • Scope native credential substitution to exact Codex endpoints and redact synthesized
    OpenAI errors at the JSON, SSE, and WebSocket render boundaries.

  • Use async decompression, one shared continuation/replay budget, bounded upgraded
    sockets, and the shared raw HTTP transport with one credential refresh retry.

  • Classify translation, state, internal, and upstream failures explicitly; validate
    malformed history/catalog values and bound recursive protocol traversal.

  • Document all ingress configuration keys, model JSON schemas, and ingress log routes.

v0.4.0

Choose a tag to compare

@dean0x dean0x released this 31 Aug 23:11

Changed

  • limits.maxBodyBytes no longer applies to Anthropic-bound request bodies; renamed to limits.maxBufferedBodyBytes. The relay buffers up to this many bytes to read the model field and route the request; a larger body is now streamed to api.anthropic.com verbatim instead of being answered with a relay-synthesized 413 request_too_large, because Anthropic enforces its own payload limits with authoritative errors and a proxy-invented 413 misattributes proxy policy as upstream state (ADR-010). A body above the window whose leading model resolves to a translated provider (Codex) still returns 413 request_too_large — on that leg subswitch is the origin and cannot translate a body it cannot hold.
  • BREAKING: a config containing limits.maxBodyBytes refuses to start with a message naming the replacement key. Peak memory for Anthropic-bound requests with a declared-over-window Content-Length drops from ~2× the body to a bounded ~8 KiB prefix plus stream backpressure; for chunked or undeclared over-window bodies, the relay still buffers up to one routing window plus one socket read before the trip fires.

v0.3.0

Choose a tag to compare

@dean0x dean0x released this 20 Aug 11:50

Fixed

  • Codex auth concurrent-refresh guard — replaced the lexicographic string > comparison
    on last_refresh timestamps in persistTokens with a refresh-token identity check
    (fileNow.tokens.refresh_token !== refreshToken). The old comparison depended on the
    Codex CLI emitting byte-identical ISO-8601 formatting indefinitely; a format divergence
    or same-second collision could cause the guard to miss, letting subswitch clobber the
    CLI's rotated refresh token. The identity check is format-independent and is the
    established idiom already used in the invalid_grant retry path. A Date.parse numeric
    comparison is kept as a secondary signal for correct ordering when timestamp formats
    differ (e.g. "…08:00:05.500Z" vs "…08:00:05Z" sorts wrong lexicographically but
    right numerically). (Fixes #26)

  • Codex auth guard bypass on materialFrom failure — when fileIsNewer is true but
    materialFrom fails on the newer file, the branch now serves the just-refreshed tokens
    from memory rather than returning an error. The newer file's refresh_token is still never
    clobbered (no write occurs); the request succeeds using the valid tokens we hold.
    Previously, control fell through into the merge and wrote our refresh result anyway,
    defeating the guard even when it had correctly fired.

  • Anthropic passthrough — connectTimeoutMs now genuinely bounds DNS resolution and
    TCP establishment
    (fixes #27).
    Previously upstream.setTimeout(connectTimeoutMs) was called on the ClientRequest
    object, but Node's implementation defers that call via an internal 'connect'
    listener — so it fired only after TCP connect, meaning connectTimeoutMs was never in
    force for any measurable interval. Measured against a blackholed IP (192.0.2.1,
    TEST-NET-1) with connectTimeoutMs=700, the request previously failed after
    75 019 ms (the macOS kernel TCP timeout). The fix arms the timer directly on the
    socket
    inside the 'socket' event handler, before DNS resolves, so the budget covers
    the full connect window: DNS lookup plus TCP SYN/ACK. The same measured scenario now
    fails at ~700 ms. Upgrade note: operators with a slow DNS resolver may now see
    connectTimeoutMs 504s that 0.2.0 would have passed through — the budget is now
    enforced for the first time.

  • Anthropic passthrough — x-subswitch-synthesized: 1 header marks every relay-generated response; stripped from proxied responses (stacks on #30).
    Previously a relay fault (502 connection failure, 504 timeout, 500 internal proxy error, 413 body too large,
    431 header fields too large) was indistinguishable from an upstream outage on the client side. Every response the
    relay synthesises itself now carries x-subswitch-synthesized: 1; this covers the Anthropic-leg error
    paths, all codex-leg responses (both streaming SSE and aggregated JSON — the codex leg translates
    Codex→Anthropic format so every byte it returns is relay-synthesised), and every relay-generated error in
    server.ts. On the proxied path the header is actively stripped from upstream responses via the hop-by-hop
    filter so an origin that sets it cannot impersonate the relay. Bodies and status codes are unchanged — the
    header is purely additive. See the new ## x-subswitch-synthesized section in the README for the
    operator-facing wire contract.

  • Anthropic passthrough — a pre-header upstream timeout no longer produces a spurious
    anthropic_upstream_error warn
    (fixes #27). In 0.2.0, when the Anthropic upstream
    timed out before sending response headers, the relay emitted two simultaneous warn
    events — anthropic_upstream_timeout and anthropic_upstream_error — because
    destroying the timed-out request caused a second error event that the error handler
    logged unconditionally. In 0.3.0, at most one warn event fires per upstream request:
    whichever terminal outcome responds first claims the log slot; any subsequent error
    event is silently discarded.

  • 404 responses now use the same Anthropic-shaped error body as all other synthesized
    errors.
    Previously an unknown path returned a bare 404 with no body. The body now
    carries { type: "error", error: { type: "not_found_error", message: "…" } } and the
    x-subswitch-synthesized: 1 marker, matching every other relay-generated response.

  • Unhandled-exception route labeled internal_error in the request_complete log.
    When an unexpected exception occurs during request handling, the route field in the
    request_complete event is now "internal_error" rather than whatever routing label
    was in effect when the exception fired. This makes relay-side panics distinguishable
    from normal traffic in post-hoc log analysis.

Changed

  • anthropic.maxUpstreamSockets default raised from 32 to 256. With no relay-side
    concurrency cap, the old pool of 32 sockets created silent http.Agent queuing at
    realistic peak load (~100 concurrent Claude Code sub-agents). 256 gives comfortable
    headroom over realistic peak concurrency.

  • Colon-bearing model names with unknown prefixes now forward to Anthropic instead of
    returning a relay-invented 400. When a model name like claude-sonnet-9:preview
    contains a colon whose prefix is not a registered provider, the relay logs a diagnostic
    warning and forwards to Anthropic unchanged. Real codex: qualified names continue to
    route to the Codex provider as before.

  • Ambiguous model family names now forward to Anthropic instead of returning a
    relay-invented error. When two providers claim the same family name, the relay logs an
    ambiguous_model_name warn carrying the provider list and forwards the request to
    Anthropic unchanged (ADR-010: the relay has no authority to adjudicate a registry
    conflict it did not cause).

  • doctor unknown_provider finding downgraded from fail to info. An agent
    frontmatter naming a colon-qualified model with an unknown prefix (e.g. myco:mymodel)
    previously produced a severity fail finding and caused subswitch doctor to exit 1.
    Because the relay now forwards those requests to Anthropic unchanged, the finding is
    informational — the agent works, just not via Codex. ambiguous (two providers claim
    the same family name) remains fail: that conflict is relay-derived and will 404 at the
    origin regardless of which upstream handles it.

  • 413 now uses error type request_too_large instead of invalid_request_error,
    matching the Anthropic API's own error taxonomy for oversized bodies. A 413 response
    now also drains the remaining upload bytes before closing the connection, with a 2-second
    hard cutoff; in 0.2.0 the connection closed immediately, which could prevent the client
    from reading the 413 body if its TCP write buffer was still filling.

  • SERVER_TUNING constants set explicitly on the HTTP server: requestTimeout
    (600 s — Anthropic's own server-side ceiling for long-running requests), headersTimeout
    (120 s — maximum time to receive all request headers), keepAliveTimeout (300 s —
    matches Anthropic's idle-socket keepalive window so the relay's pool never evicts a
    socket the origin still considers live), maxRequestsPerSocket (unlimited, matching
    the Anthropic origin's behaviour), and maxHeaderSize: 64 * 1024 (raises the inbound
    header ceiling from Node's 16 KiB default to 64 KiB — also determines when the relay
    fires a 431 Header Fields Too Large). Previously these values were whatever Node's
    built-in defaults happened to be. Inbound timeouts (requestTimeout,
    headersTimeout) that expire now return an Anthropic-shaped 408 with
    x-subswitch-synthesized: 1; in 0.2.0 Node emitted its own unshapeable bare 408
    that no relay code produced or logged.

Added

  • request_too_large and not_found_error added to the internal AnthropicErrorType union.
  • client_disconnected log event — emitted (at info level) when the client closes the
    connection before any response headers are sent (e.g. a cancelled upload). Fields: path,
    route, model (optional), latencyMs. request_complete is not emitted for the same
    request — the two events are mutually exclusive. This distinguishes an abandoned request from a
    served one: without this event, a vanished client would either produce no log entry or a
    misleading request_complete status=200 (Node's default initialiser, not a real status).
  • Two new route values for fail-open forwards — anthropic:ambiguous (two providers claim
    the same family name) and anthropic:fallback (colon-qualified name with an unknown prefix).
    Both carry the anthropic prefix so leg-level filtering continues to work; the suffix makes
    fail-open forwards distinguishable from intended Anthropic routes in request_complete and
    client_disconnected log queries.

Changed

  • route field: three values retired on this branch. Operators filtering logs on route
    should update their queries:
    • "rate_limited" — removed with the admission gate; requests are no longer rejected at the
      relay level for rate-limit reasons.
    • "ambiguous" — replaced by "anthropic:ambiguous" (fail-open forward; see above).
    • "unknown_provider" — replaced by "anthropic:fallback" (fail-open forward; see above).

Removed (BREAKING)

  • Two config keys are now fully removed and produce a hard error on load if present.
    Delete these keys from your subswitch.config.json before upgrading:

    • anthropic.streamIdleTimeoutMs — the relay does not bound the stream-idle phase on a
      connected client (ADR-010).
    • limits.maxConcurrentRequests — the admission gate was removed (ADR-010).

    If your config contains either of these, subswitch exits immediately with a message
    naming every offending key.

v0.2.0

Choose a tag to compare

@dean0x dean0x released this 09 Aug 20:42
7d6e7e6

[0.2.0] - 2026-08-09

Upgrading from 0.1.0

A 0.1.0 subswitch.config.json will not start the server. If you copied the
example config shipped with 0.1.0, or wrote a config in the old layout, the process
exits immediately with:

outdated config layout in subswitch.config.json — move `codex` to `providers.codex`; move `reasoningCache` to `providers.codex.reasoningCache`; move `limits.connectTimeoutMs` to `anthropic.connectTimeoutMs`; move `limits.maxUpstreamSockets` to `anthropic.maxUpstreamSockets`; move `limits.streamIdleTimeoutMs` to `anthropic.streamIdleTimeoutMs and/or providers.codex.streamIdleTimeoutMs`; move `limits.requestTimeoutMs` to `providers.codex.requestTimeoutMs`; move `limits.maxSseEventBytes` to `providers.codex.maxSseEventBytes`; move `codex.models` to `(removed — routing now follows the built-in model registry; use providers.codex.aliases for custom names)`. Edit the file to match subswitch.config.example.json, or delete it to run on defaults.

Two ways forward:

  1. Edit subswitch.config.json to match the new subswitch.config.example.json layout
    (the migration table in the Breaking Changes section below lists every key that moved).
  2. Delete subswitch.config.json and run on defaults — the proxy works out of the box
    once Codex auth is in place.

Warning — migrating the codex block wholesale: The migration table's first row
says codex.* moves to providers.codex.*. Copying the entire old codex block
as-is carries the removed codex.models key along with it. The schema uses strict
key checking, so providers.codex.models produces a second, less helpful error rather
than the guided migration message above. Drop models from the block before copying.

Breaking Changes

Non-default base URL hosts now refused by default

subswitch serve now exits with an error if providers.codex.baseUrl,
providers.codex.oauthTokenUrl, or anthropic.baseUrl points at a host other than
the provider's expected default (chatgpt.com, auth.openai.com, and
api.anthropic.com respectively), unless the new opt-in key is set.

Previously, a non-default host emitted a startup warning and the server started
anyway. A warning is easy to miss in a long serve session, and a hostile
subswitch.config.json in a cloned repository would silently forward the user's
subscription credentials and OAuth refresh token to an attacker-chosen host.

If you were intentionally overriding a URL to route through a trusted proxy, add
the opt-in key to your subswitch.config.json:

{
  "providers": {
    "codex": {
      "baseUrl": "https://your-proxy.example.com/...",
      "oauthTokenUrl": "https://your-proxy.example.com/...",
      "allowInsecureBaseUrl": true
    }
  }
}

Or for the Anthropic leg:

{
  "anthropic": {
    "baseUrl": "https://your-proxy.example.com/v1",
    "allowInsecureBaseUrl": true
  }
}

Loopback addresses (127.*, localhost, ::1) are always exempt — the e2e
wire-recorder workflow (http://127.0.0.1:4142) continues to work without the opt-in.

oauthTokenUrl is also gated because it carries the long-lived OAuth refresh token —
more damaging to expose than the short-lived access token in baseUrl.

Config file format restructured

This is a breaking change if you have an existing subswitch.config.json. There
is no automatic migration and no compatibility shim. A compatibility shim was not
written because Zod's default behaviour strips unknown keys — a shim would have
silently reverted any custom settings the old keys held to their defaults rather than
carrying them forward, which is worse than a hard error. The change is enforced loudly
at load instead.

What moved and what was removed:

Old key New location
codex.* (entire block) providers.codex.*
reasoningCache.* (top-level) providers.codex.reasoningCache.*
limits.connectTimeoutMs anthropic.connectTimeoutMs
limits.maxUpstreamSockets anthropic.maxUpstreamSockets
limits.streamIdleTimeoutMs anthropic.streamIdleTimeoutMs and/or providers.codex.streamIdleTimeoutMs
limits.requestTimeoutMs providers.codex.requestTimeoutMs
limits.maxSseEventBytes providers.codex.maxSseEventBytes
codex.models Removed — routing now follows the built-in model registry; use providers.codex.aliases for custom names

Two subswitch init flags were also removed:

Old flag Replacement
--codex-model <name> Removed — use providers.codex.aliases in config to map custom model names
--codex-models <csv> Removed — use providers.codex.aliases in config to map custom model names

An old config file is rejected at load with an error that names each key and its
replacement. This is intentional: Zod's default behaviour strips unknown keys, so
without the detection gate every custom setting would silently revert to defaults.

For the same reason, a providers.<id> block written under an id subswitch does not
ship — a typo like providers.codexx, or a provider from a future release — is also
rejected at load, naming the offending key and listing the known provider ids.
Such a block would otherwise be stripped by the schema and do nothing at all.

Added

  • providers.codex.allowInsecureBaseUrl (default false): opt-in that permits
    providers.codex.baseUrl or providers.codex.oauthTokenUrl to point at a
    non-default host. When the gate fires, the error message names the offending host,
    the config key, and this opt-in key.
  • anthropic.allowInsecureBaseUrl (default false): same gate for the Anthropic
    passthrough leg.
  • providers.codex.maxAggregateBytes (default 67108864, 64 MiB): maximum total
    byte budget for a non-streaming Codex response. Responses that exceed this limit are
    rejected with a 502 rather than accumulating unbounded memory.
  • codex_base_url_host_rejected log event (error level): emitted when the
    host-rejection gate fires for a Codex URL. Event name is a compile-time template
    literal over the ProviderId union — part of the log-injection barrier.
  • anthropic_base_url_host_rejected log event (error level): emitted when the
    gate fires for the Anthropic leg.
  • Model family aliases: sol, terra, and luna are now valid model: values
    in agent frontmatter. Each alias resolves to the highest-generation canonical id
    for that family (e.g. sol → gpt-5.6-sol). Resolution follows five rules in
    priority order: exact registry id, custom alias override, qualified provider:name,
    family (unique claimant), then unresolved (passes to Anthropic).
  • subswitch models: new subcommand that prints the effective model registry and
    alias resolution table under the current config. --json emits a machine-readable
    document (see README §subswitch models --json) with an integer schemaVersion
    contract. gen is an integer tuple ([5, 6]) rather than a string ("5.6")
    because string comparison sorts "5.10" before "5.9". preview and retired
    are always-present booleans. Anthropic is listed with zero model rows — we
    prefix-match Claude names and cannot enumerate them; fabricating a list would be a
    lie consumers cache.
  • providers.codex.aliases config key: free-form map of custom model name
    overrides. Aliases win over derived family aliases but never over exact registry ids.
    Neither key nor target may be an Anthropic model name; such a config is rejected at
    load because either side would route main-agent traffic to Codex.
  • subswitch doctor per-provider diagnostics: doctor fans out to all configured
    providers, prints a per-provider ready banner on startup, and scans .claude/agents/
    and ~/.claude/agents/ for six finding kinds: unresolvable, ambiguous,
    unknown_provider, retired, provider_unconfigured, and preview_only.
    Anthropic-named subagents are skipped. Finding severity follows provider configuration
    — a provider the user never configured stays informational; only explicitly configured
    providers can fail the exit code.
  • limits.maxConcurrentRequests (default: 32): in-flight request ceiling. Requests
    above this limit receive an immediate 503. Protects against burst overload and makes
    resource usage predictable.
  • providers.codex.requestTimeoutMs, providers.codex.streamIdleTimeoutMs,
    providers.codex.maxSseEventBytes: three per-Codex-leg timeout/size limits,
    split out from the old flat limits.* block.
  • writeFrame abort safety: the SSE frame drain wait is now raced against the
    request abort signal, preventing a hang when the client disconnects mid-stream.
  • /health endpoint providers[]: the health JSON now includes a providers
    array so monitoring scripts can check provider-level ready state without parsing
    server logs.
  • New modules: anthropic-wire-types.ts, anthropic-parse.ts,
    provider-transport.ts, provider-handler.ts, provider-auth.ts,
    provider-events.ts, models.ts, agent-scan.ts — provider-neutral seams,
    the pure model registry, and the agent frontmatter scanner.

Changed / Behavior

  • codex.models deleted: the user-maintained model allowlist is gone. The compiled-in
    MODEL_REGISTRY is now the sole source of the routable set, built into a
    RoutingTable once at startup by buildRoutingTable. This is not a capability loss:
    every Codex route traces back to a model name the user wrote in agent frontmatter,
    and Codex auth is already a second gate. A providers.codex.aliases entry (rule 2)
    shadows a derived family alias but can never shadow an exact registry id (rule 1).
  • subswitch init no longer asks about model selection and no longer writes a
    codex.models key to config. The routing decision belongs to the agent frontmatter.
  • **`decideRo...
Read more

v0.1.0

Choose a tag to compare

@dean0x dean0x released this 24 Jul 07:33
f689509

Added

  • Proxy core: local subscription-routing proxy that splits Claude Code traffic
    by model name — requests whose model matches the codex.models list are
    translated and forwarded to the Codex backend; everything else is relayed to
    Anthropic verbatim.
  • subswitch serve: starts the proxy on 127.0.0.1:4141 (configurable with
    --port); accepts --verbose / --quiet log-level overrides for the session.
  • subswitch doctor: preflight health check that reports config, codex auth
    status, subswitch-running probe, and TLS reachability for both upstream hosts.
  • subswitch init: interactive wizard (powered by @clack/prompts) that
    writes subswitch.config.json and wires ANTHROPIC_BASE_URL into the Claude
    Code settings file; supports --yes for non-interactive execution and --dry-run
    to preview the planned writes without touching the filesystem.
  • Codex leg: full Anthropic Messages → OpenAI Responses translation including
    system prompts, tool calling, reasoning round-trip cache (bounded LRU), and
    effort-control forwarding (output_config.effort → reasoning.effort).
  • Codex OAuth: reads ~/.codex/auth.json, proactively refreshes access
    tokens, and retries once on a 401.
  • subswitch.config.json: optional project-level config for port, log level,
    model list, reasoning cache limits, and upstream socket pool size.

Changed / Behavior

  • doctor exits non-zero when any check fails — exit code 0 means all
    checks passed; exit code 1 means at least one check failed. This makes
    subswitch doctor usable as a preflight gate in scripts and CI pipelines.
    (Note: do not invoke doctor bare under set -e in CI — in CI environments
    the live checks will always fail because the proxy is not running and codex
    auth is not configured. Use subswitch --version for a "binary resolves"
    smoke check instead.)
  • Strict per-command flag rejection — a known flag passed to the wrong
    command (e.g. doctor --verbose) now produces a clean error and exits 1
    instead of being silently accepted or ignored.
  • init fails closed on non-TTY / CI — running subswitch init without
    --yes in a non-interactive environment (no TTY, or CI env var set) exits 1
    immediately and writes no files. Use --yes to opt in to non-interactive mode
    with explicit intent. --dry-run is the only exception — it works in all
    contexts because it writes nothing.
  • Misapplied and unknown flags produce clean subswitch:-prefixed errors —
    no stack traces; exit code 1 with a human-readable message and a pointer to
    --help.