Configure
Model gateway and ledger
Transports: OpenRouter, OpenCode Go, GLM Coding Plan via Pi and GPT via Sign in with ChatGPT; the router is described below.
External model calls are made only by an explicit sych doctor --probe-model PROFILE and sych review --models PROFILE
(ANALYSIS.md).
Contract
Section titled “Contract”sych_core::model::ModelProvideris a single transport:ModelRequest→ModelReply | ProviderError. The adapter does not track the budget and does not retry requests; the gateway does that.Routepins the profile, provider, adapter, requested model,billing_kind,enforcementandCapabilities(native structured output, enforced output cap, usage/cost reporting, hidden upstream calls).ModelReplystores the actual model, upstream provider and generation id separately from the requested ones.ProviderError.kinddistinguishesAUTH,ENTITLEMENT,QUOTA_EXHAUSTED,RATE_LIMITED,TRANSIENT,TIMEOUT,UNSUPPORTED,BILLING_MISMATCH,CANCELLED,CONFIG;dispatchedtells whether the request could have reached the provider.Promptis assembled from layers: role → output contract → trusted rules (system message) → task → data blocks (user message). Each data block is framed as<<<DATA nonce label>>>…<<<END nonce>>>, where the nonce is part of the SHA-256 of the content itself, so repository text cannot close its own frame. The versioned template id (discovery@1) and the schema name are stored in every attempt; chain-of-thought is neither requested nor stored.
Structured output and repair
Section titled “Structured output and repair”- The reply schema is generated by
schemarsfrom the same Rust type the reply is parsed into; the provider receives it if it supports native structured output, and otherwise it is appended to the system message (# Reply schema): OpenCode Go and the GLM Coding Plan via Pi take no schema parameter, so the model reads it there. - The reply is parsed in full (
deny_unknown_fields, no trailing text). Only a single code fence wrapping the entire reply is allowed; JSON is not extracted from prose. - An invalid reply gets at most one repair: the original messages + the model’s reply + the schema error. A repair is
a separate attempt with its own reservation in the same budget. A second error is
TaskFailure::Schema.TRUNCATEDandREFUSEDreplies do not count as a result. - A
TRUNCATEDreply that spent reasoning tokens, on a route that can turn reasoning off (OpenRouter), is asked once more with the same messages andreasoning.effort: none(NO_REASONINGattempt, its own reservation): replaying the same request reproduces the cut, while without reasoning the output cap holds the answer. A multi-unit review or discovery is not asked again but split by the engine (ANALYSIS.md).
Budget before dispatch
Section titled “Budget before dispatch”For each attempt, before sending:
- Input bound: the number of UTF-8 bytes of the messages + 16 per message (no less than the byte-level BPE token count).
- Output bound: 2,000 tokens per request;
max_output_tokensis sent only if the route honors it (output_cap_enforced). - Monetary upper bound:
api_usageuses the price card fromprice_catalog_file, rounded up, with no cache discounts. No price card or no enforced output cap meansNO_PRICE_BOUND, and the request is not sent.subscription_quotais 0 per request (overage is disabled), but the provider must have afixed_fee, otherwiseFIXED_FEE_UNKNOWN. - A single SQLite transaction checks and records the reservation: attempts/input/output tokens and run money
(per purpose
ANALYSIS | TOUR | FOLLOWUP), money for the day, the week from Monday 00:00 UTC (budgets.tenant_weekly, no cap unless set; it spans a month boundary) and the UTC calendar month. A configuration needs day ≤ week ≤ month where they are set. An attempt of a playground run (a maintainer’s try that publishes nothing) also counts againstbudgets.playground_daily, the day’s spend of every playground run of the tenant, set no higher than the tenant day. Output tokens are hard only forapi_hard; forsubscription_observablethe upstream output/quota is soft/unknown, while Sych attempts, input and money stay hard. - Verification reserve: pure search (discovery, high-risk audit) reserves against caps minus one attempt
and its share of run money (
cap / max_attempts), so it cannot spend what the verifier needs; the verifier sees the full caps. Discovery share: assessment, combined review and the high-risk audit also keep one attempt per standalone discovery batch, at most(max_attempts - 1) / 2, with the same per-attempt share of money and tokens; while that share is not zero, assessment keeps the verifier’s attempt too. Retry, repair and fallback spend the same reserve-aware remainder.
Invariant: settled charges + held reservations + unknown charges ≤ cap.
Settlement
Section titled “Settlement”| Outcome | State | Money |
|---|---|---|
Request not sent (dispatched=false) |
RELEASED |
reservation is released |
| Reply with reported cost or full usage | SETTLED |
actual charge; reference estimate kept separately |
| Subscription without reported money | SETTLED, charge=NULL |
not zero but “not reported”; fee accounted separately |
| Timeout/cancel/disconnect after dispatch, metered reply without cost and usage | UNKNOWN |
reservation is held (UNKNOWN_CHARGE), usage NULL |
Settlement is idempotent by attempt id: SETTLED does not change again, and UNKNOWN can later be reconciled into
a known charge. A charge above the reservation is stored and marked billing_mismatch; for a subscription this
blocks further subscription-only reservations for that provider in the month (BILLING_MISMATCH).
Fixed subscription fee
Section titled “Fixed subscription fee”models.providers.<name>.fixed_fee: { amount_micro_usd, allocated_micro_usd } is the subscription price per UTC calendar
month and the share of it allocated to Sych’s model pool. The first subscription reservation in a
month writes a subscription_fees row; the share counts toward the monthly limit once, not per request
and not toward the daily/run limits. Fee/allocation values have no defaults: without them a subscription profile
is not used.
Price catalog
Section titled “Price catalog”{ "schema_version": 1, "revision": "openrouter-2026-10-25", "prices": { "deepseek/deepseek-v4.1-flash": { "input_per_mtok": 300000, "output_per_mtok": 1200000 } }}Prices are micro-USD per million tokens, reasoning is billed as output; the key is the profile’s model slug.
If a profile lists several upstreams, the price of the most expensive one is used. sych doctor parses the
catalog and prints the revision; the operator enters prices from the current rates, Sych does not guess them. An example is
examples/personal/config/prices.json; its prices are a snapshot of one revision.
OpenRouter
Section titled “OpenRouter”Adapter sych_adapters::openrouter is a single HTTP POST {endpoint}/chat/completions, with no SDK and no agent loop.
- Pinned routing.
modelis an exact slug (vendor/model);openrouter/*,~…and*latestare rejected. The profile must listupstreams; the request sendsprovider.order = upstreams,allow_fallbacks: false,require_parameters: true,data_collection: "deny"and does not sendmodels(the model fallback list). The profile’s price card must cover the most expensive of the listed upstreams. - Reasoning. The profile’s
reasoning_effort: low|medium|highis sent asreasoning.effort; without it the field is not sent. Reasoning counts toward the output cap of a single request (2,000 tokens), which is why DeepSeek in the example useslow: with the default effort the verify reply was truncated (TRUNCATED) after ~1,900 reasoning tokens. The per-request cap isbudgets.<purpose>.max_output_tokens_per_request(default 2,000, no more thanmax_output_tokens); the reservation’s money upper bound is computed from it. Together withrequire_parameters, an upstream that does not support the parameter is not selected. - Call shape.
max_units_per_callandmax_shown_tokens_per_callof a profile bound one discovery call when the profile is the reviewer’s primary: a model that reasons past the output cap over many review units gets fewer per call (more calls, each shorter). Unset, a call takes as many units as fitcontext.max_tokens_per_request. - Structured output.
response_format: json_schemawithstrict: true; local strict validation and repair always run.require_parametersprevents OpenRouter from silently choosing an upstream without schema support. - Streaming. The request is sent with
stream: true: keep-alive comments: OPENROUTER PROCESSINGkeep the connection open during long reasoning, and SSE chunks are assembled into the same reply as without streaming (content, finish reason, generation id, model, upstream; usage and cost come from the last chunk). A stream cut off before[DONE]and a finish reason is a dispatchedTRANSIENT/TIMEOUTwith the generation id in the message, not a partial reply; an error inside the stream is parsed as an error after 200. A non-200 reply arrives as plain JSON. - Usage and money. The generation id, actual model, upstream provider, prompt/completion/
reasoning tokens (reasoning is included in completion, not added) and
usage.costare stored. USD is converted to micro-USD from the decimal representation of the number, rounding up, without floats. - Errors. 401 →
AUTH, 402 →QUOTA_EXHAUSTED, 403 →ENTITLEMENT, 408 →TIMEOUT, 429 →RATE_LIMITED(+Retry-After), 503 →UNSUPPORTED(no upstream matches the requirements), other 5xx →TRANSIENT. 400/401/402/403/429/503 and connection refusal count as not dispatched (the reservation is released); 408, 5xx, a cut-off reply anderrorinside a 200 reply are dispatched, and the charge staysUNKNOWN.finish_reason: length/unknown →TRUNCATED,content_filter/refusal→REFUSED. A reply that did not finish withstoplogsfinish_reason,native_finish_reasonand the beginning of the refusal. - Egress. Only the provider’s
endpointfromsych.yaml(allowlist), no redirects and no system proxy, timeout 300 s. The key comes from theapi_key_envvariable and never appears in output or errors. Corporate mode with OpenRouter is rejected by configuration validation.
Fixtures
Section titled “Fixtures”Deterministic, no network: capability — a metered route without an enforced output cap is not sent
(crates/sych-core/tests/gateway.rs); schema — strict parsing and one repair (same file); partial stream — a cut-off
and a failed stream, length (crates/sych-adapters/tests/openrouter.rs); unknown charge — timeout after dispatch and
a reply without cost and usage (gateway.rs); provider selection — pinned model, provider.order, allow_fallbacks: false, require_parameters (openrouter.rs); the whole path doctor → gateway → ledger → adapter — loopback stub
(crates/sych-app/tests/probe.rs). Loopback stubs answer 404 to foreign connections, since another local tool may
poll a new loopback port.
sych db migrate --config sych.yamlsych doctor --config sych.yaml --repo . --probe-model cheap_apiMakes one small paid structured request (echo) through the gateway and ledger and prints JSON: route
(profile, model, upstreams, billing, enforcement, price revision), valid, failure and attempts (reserved,
charge, charge state, tokens, resolved model, upstream, generation id). The run is stored in the ledger under access scope
model-probe and closed without a review result. Exit 0 means a valid reply, 4 means no key or AUTH,
3 means another error, 2 means configuration.
OpenCode Go
Section titled “OpenCode Go”Adapter sych_adapters::opencode_go is POST https://opencode.ai/inference/go/openai/v1/chat/completions
(Go, inference contract).
SSE chat completions parsing shared with OpenRouter lives in sych_adapters::chat.
- The
/goboundary. Theendpointof theopencode_goprovider must be exactlyhttps://opencode.ai/inference/go/openai/v1(or loopback in tests); a path without/godraws on the Console balance and is rejected by configuration validation. Model is an exact Go id (deepseek-v4.1-flash), withoutopencode-go/and*latest. - Headers.
User-Agent: sych/<version>;x-opencode-sessionis the gateway task id (TaskId): the first attempt and its repair go in the same session, the next task gets a new one. The key comes fromapi_key_env; OpenCode auth files are not read. - Schema. Native structured output is not declared (
response_formatandmax_tokensare not sent): the schema goes into the system message and the reply is validated locally, with at most one repair. Output cap and quota are soft (subscription_observable). - Extra Usage. Sych does not enable it and does not check it via the API (there is none). The operator confirms the setting in
the Console and sets
overage_disabled: true; without it the profile does not resolve (sych doctorreports this). DeepSeek in Go requires the Global region in Settings › Privacy; this is also an account setting, not Sych’s. - Money and quota.
usage.costis the reported charge (0 within Go limits is an observed fact, not “free”);opencode.billing_sourceandopencode.allowance(quota spend in plan dollars) are stored in the attempt separately;opencode.list_costis reference only. A charge above a zero reservation (balance/byok) is marked by the ledger asbilling_mismatch, and further subscription-only calls for that provider in the month are rejected. Go does not report quota windows/reset in the reply; they stay unknown and are not invented. - Errors are the same as for OpenRouter (shared
chat): 401/403/429/5xx and a cut-off stream.
Fixtures: crates/sych-adapters/tests/opencode_go.rs (path, headers, session, body without schema, zero charge +
allowance, balance charge), crates/sych-core/tests/gateway.rs (allowance separate from charge, repair in the same
task), crates/sych-core/tests/config.rs (the /go boundary).
OpenAI-compatible endpoint
Section titled “OpenAI-compatible endpoint”The openai_compatible adapter (sych_adapters::openai_compatible) sends POST <endpoint>/chat/completions to any
OpenAI-compatible chat completions endpoint you run or pay for: a VPC gateway, vLLM, LiteLLM, Ollama, a vendor API.
This is the only route a corporate config can use.
- Endpoint and key.
endpointis the base URL. Like every provider endpoint, it is part of the egress allowlist.api_key_envis sent asAuthorization: Bearer, withUser-Agent: sych/<version>.- An endpoint without auth still needs
api_key_env: set the variable to any value.
- Money. The profile is
api_usage/api_hard, so its model needs a card inprice_catalog_file.- Every request carries
max_tokens, so the card bounds a call before it is sent. With no card the call is refused asNO_PRICE_BOUND. - The charge is computed from the card and the reported usage (
stream_options.include_usage). A cost field in the reply is ignored. - With no usage reported the charge is
UNKNOWN.
- Every request carries
- Schema. Native structured output is not claimed: the schema goes into the system message and the reply is validated locally, with at most one repair.
- Not covered. No vendor routing fields, reasoning controls or extra headers. A gateway that requires its own header
(OpenCode Go wants
x-opencode-session) needs its dedicated adapter.
Fixtures: crates/sych-adapters/tests/openai_compatible.rs (path, key, max_tokens, no schema, reported cost ignored).
GLM Coding Plan via Pi
Section titled “GLM Coding Plan via Pi”Z.ai permits the Coding Plan in supported coding tools (usage rules,
Pi), but not in a custom HTTP client/bot. That is why adapter sych_adapters::pi
runs the real Pi CLI instead of imitating its requests.
-
Pin. Only Pi
1.4.0(@earendil-works/pi-coding-agent@1.4.0, npm integritysha512-Z41LpZ3yYHSC/UUps6Mr39UMFPwH8elhJBG9DY1P7kuzsE5qSK/6eMj2EHzO5evJRQWLbKSqUMw+4nCNtIyiQg==): resolve runs--versionand rejects any other release. The bundle is self-contained (requires Node ≥ 22.19):Terminal window npm pack @earendil-works/pi-coding-agent@1.4.0 && tar xzf earendil-works-pi-coding-agent-1.4.0.tgzexport SYCH_PI_BINARY="$PWD/package/dist/bundle/cli.js" -
Endpoint and key. Provider
glm_coding_planwithtransport: supported_pi_climust specifyendpoint: https://api.z.ai/api/coding/paas/v4(validated; the Standard API/api/paas/v4has different billing) andexecutable_env. Pi receives the endpoint as thebaseUrlof thezaiprovider inmodels.json, and the key only asZAI_API_KEYin the process environment (not in argv). Sych cannot determine the key type (Coding Plan rather than Standard API); the operator confirms it;overage_disabled: trueconfirms that extra usage is disabled. -
Isolation. Each request is a new process in a temporary directory: empty
HOME,PI_CODING_AGENT_DIRand working directory,env_clear(onlyPATHis inherited), flags--mode json --no-session --no-tools --no-extensions --no-skills --no-prompt-templates --no-themes --no-context-files --no-mcp --no-approve --offline,PI_SKIP_VERSION_CHECK=1,PI_TELEMETRY=0.settings.json:retry.enabled: false,retry.provider.maxRetries: 0,compaction.enabled: false,cacheWarming: off,defaultProjectTrust: never. The system message is the--system-promptfile; everything else is a single prompt on stdin (repair passes the previous reply in the same prompt). A 300 s timeout kills the process; upstream spend stays unknown. -
Reply. The single assistant
message_endafteragent_settledis taken from the JSONL.tool_execution_start,auto_retry_start,compaction_start, a second model turn,toolUse→UNSUPPORTED; a stream withoutagent_settled→ dispatchedTRANSIENT;length→TRUNCATED;aborted→CANCELLED. JSON is checked by the shared local validation; native schema is not declared. -
Usage and money. Tokens come from Pi usage (input = input + cache read/write; reasoning is included in output); zero usage is unknown. Pi computes
usage.costfrom its own catalog, so it is areference, not a charge; the subscription charge is not reported (NULL), and the fixed fee is accounted once a month. Z.ai quota windows do not arrive in the reply. -
Errors follow Pi’s
errorMessage(<status>: <body>) and Z.ai codes (api-code): 1000/1001/1003/1005 →AUTH; 1308/1310/1316–1321 (5-hour/weekly/monthly limit, message with reset) →QUOTA_EXHAUSTED; 1113/1309/1311/1313/1314/1315/1220 (no package, plan expired, model outside the plan, fair use) →ENTITLEMENT; 1302 →RATE_LIMITED; 1305/1234/5xx →TRANSIENT. None of them changes the key/endpoint or enables the paid API.
Fixtures: crates/sych-adapters/tests/pi.rs; the JSONL in tests/fixtures/pi was recorded by a real Pi 1.4.0 against a loopback
stub (ok, err401; quota is the same stream with code 1308). A stand-in executable checks env, argv, stdin,
the empty working directory and the pinned endpoint.
GPT via ChatGPT plan: Sign in with ChatGPT
Section titled “GPT via ChatGPT plan: Sign in with ChatGPT”The transport is SIWC for open-source local clients (overview,
sign-in,
inference,
limitations,
errors). The Codex app-server is not
used: text-only Responses has no agent loop, so the no-tools boundary does not need to be proven separately.
A regular OpenAI API key is not this subscription: a provider with api_key_env is rejected by validation.
- Sign-in.
sych auth chatgpt --config sych.yaml --provider gpt_subscriptionuses authorization code + PKCE (S256) with loopback redirecthttp://127.0.0.1:1455/auth/callback, dynamic registration (client_id=dynamic_agent_client,agent_name_hint=Sych), scopeopenid profile email offline_access resource.invoke chatgpt.tokens.use.direct,resource=https://api.openai.com/v1.ext_agent_host_idis a randomurn:uuid, chosen once (file<token file>.host) and reused together with the issuedclient_id. The callback checksstateand the issued client id; the ID token, received directly from the token endpoint over TLS, is checked byiss(from/.well-known/openid-configuration),aud,expandnonce(OIDC Core §3.1.3.7 instead of a signature). Without a grantedchatgpt.tokens.use.directthe sign-in is not saved. A differentsubdoes not overwrite an existing account’s file. On a remote machine, usessh -L 1455:127.0.0.1:1455 HOSTor paste the address the browser stopped at. After sign-in the command prints the account’s models (GET /v1/models,visibility == list); no inference is performed. - Tokens. The file is the path from
connection_ref_env(outside the repository), written atomically with0600; fields follow the sign-in contract (issuer, subject, client id, host id, id/access/refresh token, expiry, scopes). Before a request the token is refreshed 120 s before expiry (grant_type=refresh_tokenwith the issued client id andresource); refresh is serialized by a lock file, and the rotated refresh token is saved together with the access token.invalid_grantand other terminal refresh codes →AUTH(sign in again), the file is not erased;invalid_client→CONFIG; network →TRANSIENT. Tokens are not logged and are not passed to other processes. - Request.
POST https://api.openai.com/v1/responses:model,instructions(trusted layers; the route rejects system items),input(user/assistant),store: false,stream: true,text.format= strictjson_schema.max_output_tokens, sampling,metadata,userand tools are not sent. The endpoint is pinned by validation; ChatGPTbackend-apiis not used. The documentation does not confirmtext.formatsupport on this route: onsubscription_sharing_unsupported_capabilitythe error isUNSUPPORTEDwithparam; the parameter is not silently dropped. - Reply. Success is only
response.completed(text deltas,usage.input_tokens/output_tokens, reasoning fromoutput_tokens_details, response id and actual model).response.incomplete→TRUNCATED(content_filter→REFUSED), refusal →REFUSED, an output item other thanmessage/reasoning(tool call) →UNSUPPORTED, a cut-off beforecompleted→ dispatchedTRANSIENT,response.failed→ by code, dispatched. - Errors (
error.code, otherwise HTTP):usage_limit_exceeded→QUOTA_EXHAUSTED(reset is not inferred),user_not_eligible/403 →ENTITLEMENT,invalid_user/401 →AUTH,unsupported_capability→UNSUPPORTED,route_not_supported/chatpass_v2_*→CONFIG,usage_unavailable/user_unavailable/503 →TRANSIENT. Errors before the stream (admission, 4xx, 503) are not dispatched. OpenAI does not switch the billing path by itself; neither does Sych. - Accounting.
subscription_observable: chargeNULL,billing_source: chatgpt_plan, tokens as reported; standard API prices do not apply to the plan; fixed fee once a month.allowed_modesis onlypersonal_local: SIWC for a paid or remotely hosted app requires separate admission.
Fixtures: crates/sych-adapters/tests/siwc.rs (route fields, completed/incomplete/refusal/cut, tool item, error
codes, refresh with rotation and 0600, revoked session without inference, missing file/scope) and tests/siwc_auth.rs
(base64url, PKCE RFC 7636, host id, claims, callback). The authorize page of auth.openai.com opens only in a browser,
so sign-in itself is not covered by an automated test.
Router: roles, fallback and premium
Section titled “Router: roles, fallback and premium”sych_core::model::Router is a single deterministic loop on top of Gateway; there is no separate orchestrator.
- Plan. A
RoutePlanis fixed per run (recorded in theanalysisartifact with a revision hash): for the rolesreviewer,verifier,risk_auditor— a primary and one chain.--models roles: the primary ismodels.roles.<role>(no role means the reviewer’s profile; in adeepmanual runmodels.deep_roles.<role>comes first), and the chain by priority isfallback.chains.profiles.<primary>→chains.roles.<role>→chains.providers.<provider primary>.--models PROFILEpins the profile for all roles and takes only its own chain (profile, then provider), without role chains, so that a cheapest-only comparison is not mixed with subscriptions. Chains are flat: a fallback profile’s chain is not attached, so the loop does not restart (mutual A → B and B → A end after the second hop); a duplicate in a chain, self-fallback, an unknown profile, a profile named after thefakeorrolesselector andwait_for_usage_reset: trueare rejected by validation. Theanalysisartifact records model,reasoning_effortandupstreamsfor each route. - Pass roles. Assessment, review and discovery use
reviewer; the obligation-bound high-risk audit usesrisk_auditor(wheremodels.roles.risk_auditorpoints to Astra/Fable, that is the premium escalation: only for high-risk obligations, not for the whole PR); checking candidates usesverifier. A more expensive model does not substitute for missing source/environment facts: such obligations stayUNKNOWN. - Hop. Each profile in a chain is visited at most once per task. Before a hop the profile is resolved
again (mode, billing, egress, credentials, pinned runtime), and the route must match the one planned at the start of the
run; a route without native structured output is used with the schema in its prompt. Cooldown is also checked, and,
inside the gateway, the same run/day/week/month caps,
attempts and deadline in one ledger: switching backends does not reset the counters, the previous route’s unknown charge stays
reserved, and a repair is a separate accounted attempt. A fallback profile that does not resolve stays in the plan with
its reason and is skipped; an explicit
--models PROFILEmust resolve by itself, androlesneeds at least one profile in the reviewer’s chain. - When to switch. Only on
fallback.on:quota_exhausted,rate_limited,transient,timeout,unsupported_capability. Also when the route itself cannot be accounted (NO_PRICE_BOUND,FIXED_FEE_UNKNOWN,BILLING_MISMATCH): the next route makes a new reservation.AUTH,ENTITLEMENT,CONFIG,CANCELLED, shared caps/deadline, a schema/truncated/refused reply stop without a retry. The same route is not called again within a task; there is no waiting for reset. The engine may start a new task for the same work: a refused review sends its units to discovery, and a refused discovery runs once more after the other searches, once the shortest cooldown is over and never past the run’s deadline (ANALYSIS.md). - Cooldown. A profile that failed on a trigger rests for
max(cooldown_seconds, Retry-After); subsequent tasks in the run skip it (SKIPPED, “cooling down until …”) and after expiry start from the primary again (revert_policy: cooldown_expiry). A timeout withoutRetry-Afteris one slow generation, not an outage: the task moves down its chain, and the profile stays usable for the run’s other tasks. - Outcome.
hopsin theanalysisartifact: role, profile andANSWERED | FELL_BACK | STOPPED | SKIPPEDwith failure/ reason. All skipped →NO_ELIGIBLE_ROUTEwith reasons; a failed pass becomes a gap in the result (PARTIAL), not an empty success.usage_summary.routeslists each route with attempts, quota attempts and fixed fee separately. - Boundaries. Subscription adapters (ChatGPT, GLM, OpenCode Go) are allowed by validation only in
personal_local: a personal login does not go into a hosted bot or corporate. A corporate config cannot have OpenRouter or a subscription either as a route or as a fallback; see the exampleexamples/corporate/sych.yaml.
Fixtures: crates/sych-core/tests/router.rs (cheap → subscription → premium in one ledger, auth stop, cooldown
and return to primary, exhausted cap, unknown charge, unconfigured trigger, no eligible route, a route without a fee
hands over to the next one, chain priority), tests/config.rs (duplicates, self-fallback, reset wait, corporate
deny-external, subscription local only).
Limitations
Section titled “Limitations”- The subscription transports (ChatGPT plan, GLM Coding Plan, OpenCode Go) are verified by fixtures and loopback stubs,
not against the live services: each needs its own sign-in or key,
fixed_feeand a confirmedoverage_disabled. openai_compatibleis verified by loopback stubs. A live call to OpenCode Go reached the endpoint with a price-card reservation and was refused for the missingx-opencode-sessionheader; no other endpoint has been tried live.- Cooldowns live within a single run; they are not persisted across processes.
- Reconciliation of
UNKNOWNattempts viaGET /generationis not implemented yet: the generation id of a cut-off stream is in the attempt’s error message, but the reservation stays held for now.

