The service held a table of the two DeepSeek route ids, which are ids of
its consumers. connect() now takes the provider route its plugin
registers, and routeKind() answers the kind connected under that id, so
the service names no route.
A conversation recorded on deepseek-account or deepseek-official whose
route plugin is not mounted is ordered as any other route: the API key,
then the account sign-in. Before, such a conversation tried only the API
key. With both route plugins mounted the order is unchanged.
The minimal compositions in the dsh-llm, dsh-web, and dsh-tool-web READMEs
mount a DeepSeek route or the DeepSeek web backend, which start only beside
the authentication service. Each example gains its row and one sentence
that says why.
The decision record said both web providers report a route whose settings
do not resolve as WEB_PROVIDER_MISCONFIGURED. Messages search reports
WEB_PROVIDER_ERROR, and only the Search and Fetch APIs word their failures
from the candidates.
The upgrade guide again states that the account route plugin owns the
sign-out cancellation and that the account package drops its dsh-agent and
dsh-llm peer dependencies.
The web tool integration test mounts the Search API provider by hand. The
provider requires ctx.deepseekAuth, so without the service it never
registered and web_search failed. The test mounts the service first.
The built dsh smoke test pins the exact rows of the sdk-minimal profile; it
gains the deepseek-auth row the bundle carries.
The route fixture connects deployments to ctx.deepseekAuth, and two of its
fields kept names from the credential publication it replaced:
withoutCredential and publishedBaseURL. They are withoutConnection and
connectedBaseURL.
The decision record and the upgrade guide described credentials that each
DeepSeek model route published through ctx.llm.providerCredential(). The
routes, the Search and Fetch APIs, and Messages search ask ctx.deepseekAuth
instead, so both documents describe that service: who orders the two
credential kinds, where each kind's deployment comes from, what a consumer
declares, and which alternatives lost. Both take the name of the subject
they cover.
The upgrade guide adds the steps this change asks of a composition: mount
@deepseek-ai/dsh-deepseek-auth beside any DeepSeek route or web provider,
and take the key check from @deepseek-ai/dsh-credentials.
Five older decision records and nine package READMEs still said that routes
publish credentials, that consumers read keys themselves, or that a request
credential carries a bare value. They state the current mechanism, and the
model service README drops the source-map row of the key check that moved
to dsh-credentials.
The transport's cancellation helper returned at once when the caller's signal was already aborted, without observing the credential read it had been handed. A read that cancels its caller and then rejects left that rejection unhandled. The helper now observes the read, as the same helper of the Messages search provider does.
Messages search asked `ctx.llm.providerCredential()` whether the conversation's route published an account credential, compared origins itself, and read and checked `DEEPSEEK_API_KEY` itself. It now asks `ctx.deepseekAuth` for the credential of the search endpoint: the account sign-in in a conversation on the account route, otherwise its referenced key, which stays its own and goes to the search endpoint. The provider's two credential options become one `authorize` option; the literal `apiKey` is unchanged.
Behavior is unchanged except in two places. A key that is blank or cannot travel in an HTTP header is reported with the error name `DeepSeekAuthError` where it named `LlmError`. A base URL that embeds credentials makes the provider unavailable, as one that does not parse already did; `fetch` refused such a URL before.
The provider's cancellation helper now observes a credential read that began before its caller's cancellation was noticed. Such a read can reject after the cancellation it caused, and that rejection was unhandled.
The package no longer depends on `dsh-llm`.
The plugin asked `ctx.llm.providerCredential()` for each route's credential, read `DEEPSEEK_API_KEY` and the account service itself when a route was not mounted, ordered those sources by billing, and rendered the request headers in its transport. It now names the kinds the two APIs accept and the capability's billing, and `ctx.deepseekAuth` returns the ordered credentials, each bound to its endpoint. The plugin keeps the wording of its failures; the transport sends the headers it is given.
Behavior is unchanged except in two places. A key that is blank or cannot travel in an HTTP header is reported with the error name `DeepSeekAuthError` where it named `LlmError`. A capability's own base URL that embeds credentials now leaves the provider unavailable, as one that does not parse already did; `fetch` refused such a URL before.
The package no longer depends on `dsh-llm`, `dsh-launch-environment`, or the account service. The transport's `apiKeyHeaders` request option, which only tests set, is gone, and the tests of adapters that publish the other credential kind under a DeepSeek route id went with that publication.
Both route plugins now require the DeepSeek authentication service and connect the deployment their settings name: the API-key route its base URL and key reference, the account route its base URL. Other DeepSeek consumers will bind each credential kind to that deployment through the service.
The `base` and `sdk-minimal` bundles mount the service, and the SDK server mounts it with its fallback route when the composition has none. Tests that mount a route plugin by hand mount the service first; the pinned row list of the `sdk-minimal` bundle gains the `deepseek-auth` row.
Reviewers found `routeCredential` unclear. The method takes a provider route id, as `providerInfo()` and `providerRetryPolicy()` on the same adapter do, so the method and its types now carry that prefix: `LlmAdapter.providerCredential()`, `LlmRuntime.providerCredential()`, `ProviderCredential`, `ProviderCredentialGrant`, and `DeepSeekProviderCredentialOptions`.
Behavior is unchanged. master never had the old names, so no released surface is renamed; the upgrade guide for this change names the new ones.
The Chinese pages of the route credential change rendered "withdraw" as
收回. The bilingual pages on master render it as 撤回 in most places, so
the seven pages this branch edited now use that term. The English pages
are unchanged; only the Chinese hashes of the pairing records move.
Unloading the account route removed its sign-out listener and running-task
report while a model request it had dispatched kept streaming, so a later
sign-out neither closed that request nor cancelled its turn.
A route credential grant now carries an optional `revoked` signal. The
account service aborts it at each sign-out, after the
deepseek-account/signed-out listeners return, and the shared transport
runs the model request and its file operations under it. The route plugin
names that end ACCOUNT_SIGN_IN_REQUIRED and cancels the route's running
Agents from the request's own failure callback, so a turn whose route was
disabled mid-turn still ends with the signed-out cause, and disabling the
route never waits for a turn.
The Search and Fetch API providers and Messages search run their request
under the same signal and report WEB_PROVIDER_ERROR with sign-in guidance,
keeping WEB_ABORTED for caller cancellation. Account model requests
outside an Agent turn and account-billed web requests therefore end at
sign-out as well. The web-search-account-signout recorded scenario pins
the failure the model sees.
While the route is disabled, a task it started that is executing a tool
is not reported to the sign-out confirmation and ends at its next model
request, which fails because the route is no longer registered.
The API-key route README Summary exceeded its 100-word limit; the origin
detail moves to the usage section.
Search and Fetch picked a route credential by route id without comparing
its kind, so an adapter registered as deepseek-official that publishes an
account credential had that credential sent under API-key billing, and
the reverse held for deepseek-account. A credential whose kind differs
from the route's counts as no route, as an adapter publishing no
credential already does: API-key billing falls back to DEEPSEEK_API_KEY
at the official base, and account billing asks the account service.
Readiness and dispatch share the source, so both follow the same rule.
master moved internal identity construction to brandString (#8214) and
added the empty-catch gate with its recorded baseline (#4862); both touch
files this branch changes or moves.
Conflicts:
- packages/llm/llm-deepseek/tests/adapter.spec.ts,
packages/llm/llm-deepseek-account/tests/provider.spec.ts,
packages/experimental/translator/tests/paid-fixture.ts, and
packages/web/web-search-deepseek/tests/deepseek.spec.ts: master rewrote
the id constructor calls to brandString<T>() with type-only imports,
while this branch replaced the hand-built account stand-ins with
accountStub. The result keeps master's id construction and imports and
this branch's stand-ins; the one Session this branch's own search test
creates follows master's construction.
- packages/web/web-deepseek-api/package.json and
packages/web/web-search-deepseek/package.json: this branch's sorted
devDependencies plus master's dsh-brand entry.
- docs/capability-seams.md and docs/capability-seams.zh.md: master's
cuaPrograms consumer edge and this branch's deepseekAccount consumer
edges coexist; the pairing record is recorded again from the merged
pair.
- docs/module-graph.md, docs/module-graph.zh.md,
docs/persistence-schema.json, and pnpm-lock.yaml: regenerated from the
merged sources.
Beyond the conflicts:
- scripts/empty-catch.baseline.json: master recorded two clauses under
packages/credentials/deepseek-account, which this branch moves to
packages/account/deepseek-account. The two keys are renamed with the
files, as the gate requires for a moved file.
- AGENTS.md: master's checker link and this branch's account/ layout row
together exceeded the frozen 2,080-word ceiling by one word, so the row
reads "account/ DeepSeek".
The config catalog records the source line of the plugin's Config. The
previous commit grew the module comment by one line, which moved that
line and left the generated catalog stale; reflowing the comment keeps
the catalog as committed.
- web-search-deepseek: the initiating route's account credential is used
only when the search endpoint has the origin of that route's base URL.
For another origin the provider does not ask the route and sends the
API key, and readiness answers the same way. A route publishing an
unparsable base URL is treated like settings that do not resolve.
- web-deepseek-api, web-search-deepseek: after HTTP 401 a failure of the
grant's reject() is contained, so the reported error stays the HTTP
rejection whichever owner published the credential.
- deepseek-account: the request credential's reject() re-resolves the
account service through the resolving context, so a reload between a
request and the destination's HTTP 401 still removes the stored grant;
without a mounted service the grant stays for the next one to reject.
resolveToken and rejectToken become private; the e2e sign-in stand-in
and the generated API catalog follow.
- llm-deepseek: routeCredential().resolve() publishes the grant's headers,
value, and rejection only, keeping the adapter's onRequestError behind
the seam.
- web-deepseek-api: a route publishing an unparsable base URL becomes a
misconfigured source instead of throwing from readiness or dispatch.
- RouteCredential.configured: the owner may read its store to answer; the
contract no longer claims "without reading the credential's value". Same
text in the source JSDoc, both llm-streaming type-equiv blocks, and the
seam Agent Note.
- llm-deepseek README: replace the stale resolveAuth(connection) summary
with the resolveAuth(connection, endpoint) contract.
- llm-deepseek-account README: the listing cache is keyed by a SHA-256 of
the credential headers, not of the token.
- web-deepseek-api tests/routes.ts: note that composition.spec.ts covers the
real route plugins.
- packages/README: restore the document/, credentials/, and util/ rows and
raise the verify-doc-budgets ceiling to 1,060 for the account/ row.
`LlmAdapter.routeCredential(provider)` publishes the credential a route
currently sends: kind, resolved base URL, optional reference, a value-free
presence check, and per-endpoint grants carrying protocol headers, the bare
value, and an optional 401 invalidation. `LlmRuntime.routeCredential()`
forwards to the owning adapter.
`dsh-llm-deepseek` reads no credential: `resolveAuth(connection, endpoint)`
returns a grant or `undefined`, `missingCredential` names the failure, and
`credential` declares the publication. The route plugins own their
credentials through the new `dsh-credentials` reference helpers and the
account service's `resolveRequestCredential()`; the account route also owns
sign-out cancellation and registers a running-task report. The account
service inspects no Agents, drops its `dsh-agent` and `dsh-llm` peers, and
moves to `packages/account/`. The web providers consume route publications
and drop their dependencies on `dsh-llm-deepseek`, the route plugins, and the
Loader.
Documented in the Agent Note and the `llm-route-credential` upgrade guide.
Both are hand-checked argument constraints, like the blank web_search
query, so they throw ToolArgsError and gain the invalid arguments:
prefix. SkillError no longer declares SKILL_INVALID_NAME.
Refs #7869
web_search query count and blank-query checks now throw ToolArgsError
(INVALID_ARGS), so their text gains the shared "invalid arguments:"
prefix. A blank web_fetch URL throws WebError with the existing
WEB_INVALID_URL code and keeps its message.
Refs #7869
The Harness-home exemption matched every name case-insensitively, so a
home `.env` line such as `deepseek_base_url=...` passed the check and
landed in `process.env` under that spelling. The launch snapshot looks
names up exactly on POSIX, so llm-deepseek, web-search-deepseek, and
web-deepseek-api never saw it: the launch succeeded with the official
endpoint, where it used to fail. Proxy names keep matching in any letter
case because proxy clients read both spellings; the two endpoint names
now match only as `DEEPSEEK_BASE_URL` and `DEEPSEEK_SEARCH_BASE_URL`, and
another spelling fails the launch with the exact name to use.
The home-layer refusal case now covers `SSL_CERT_FILE`,
`NODE_TLS_REJECT_UNAUTHORIZED`, and `DSH_HOME`. The web-deepseek-api
README states where `DEEPSEEK_BASE_URL` may come from; the
launch-environment README, the development guide, and the configuration
source Agent Note no longer overstate which file is refused, which
Vitest configurations load the root `.env`, or what a checkout may carry.
Refs #8138
`loadLayeredEnv` refused `DEEPSEEK_BASE_URL` and
`DEEPSEEK_SEARCH_BASE_URL` from every discovered `.env`, including the
user's own `$DSH_HOME/.env`, so a machine-level endpoint written there
made both the CLI and Desktop fail at startup.
The refusal exists for the invoking directory's file: it arrives with a
clone, and a repository must not choose where requests carrying the
user's DeepSeek credential go. The home file is the user's own, and the
profile patches in the same directory can already set these endpoints as
plugin `baseURL` fields, so refusing it there protected nothing.
`HOME_LAYER_PROXY_NAMES` becomes `HOME_LAYER_ROUTE_NAMES` and adds the
two endpoint names; a project `.env` that sets either still fails the
launch, and its message now names the home file as the second way out.
`DSH_HOME` stays bootstrap-only, and the CA and TLS names stay refused
everywhere.
Tests cover the project layer refusing both names, the home layer
accepting both below an exported value, and the project-layer message.
The app-boot, launch-environment, llm-deepseek, and web-search-deepseek
READMEs, the development guide, and the two Agent Notes that stated the
old rule now state this one.
Refs #8138