Commit Graph
14405 Commits
Author SHA1 Message Date
Yichen Jiang b239db6aeb test(net): assert the proxy-name contract on a platform that folds case
The Windows coverage lane failed on four cases that assume `http_proxy` and
`HTTP_PROXY` are separate variables. They are one variable there: `process.env`
is case-insensitive, and the launch snapshot folds names for the same reason. A
scenario built on "the user set only the lowercase name" cannot exist.

Two of them assert a contract rather than a spelling, so they now hold either
way: what reaches a child for a scheme the user named is the user's own value
and never the derived one, and a nested install carries the active policy's
value rather than the outer install's published one. Both read over the pair of
names instead of one.

The other two are about the case distinction itself. Neither can hold on a
folded environment, so each asserts what that platform does instead of skipping:
the later entry wins where a preference cannot be expressed, and a diagnostic
names the spelling resolution asked for. Both were verified against the folding
arm rather than reasoned about.
2026-08-29 13:37:29 +08:00
Yichen Jiang 03d2c54db1 test: start every suite from an environment with no proxy
A developer's Clash and a CI runner's squid both export HTTP_PROXY and its
siblings. Now that the harness honors them, an ambient value decides test
outcomes: this PR has already recorded a proxy's 502 page as a snapshot's
expected output, and let a runner's own export stand in for "what the user
exported" in an assertion about inherited names.

A Vitest setup file clears the proxy names before any suite runs, wired into
every configuration that declares a setup. Real-API e2e is cleared too: before
proxy support existed every request connected directly and that suite passed, so
direct is the environment it is known to work in.

`NODE_USE_ENV_PROXY` cannot be cleared this way — Node samples the proxy
environment at process start — and the module says so. A proxy application never
exports it, and the eight names one does export are fully handled: with all of
them set, the affected suites pass.

The wiring is what regresses, so that is what the test pins. Configurations are
discovered rather than listed, because the web suites carry no setup today and a
hand-written list would let one of them gain a setup without gaining this one.

`plugin.spec.ts` kept its own copy of the eight names to guard against the
machine; it never sets a proxy variable itself, so the setup replaces that
entirely. `install.spec.ts` had one assertion waiting on a DNS miss with no
deadline, which timed out once under load.
2026-08-29 13:17:12 +08:00
Yichen Jiang 2a73128d78 docs(net): describe the worker seam as it is, not as a mechanism that exists
`installGlobalProxy` claimed each worker thread calls it with a policy its host
passed through `workerData`. Nothing does: the two workers this repository ships
evaluate model-authored scripts and are deliberately left without a proxy URL
that may carry credentials.
2026-08-29 13:17:12 +08:00
Yichen Jiang 4623c68e70 perf(scripts): parse only the files the dispatcher gate can find a violation in
`agentBindings` now walks the whole tree to reach a dynamic `import('undici')`,
which pushed the repository-wide scan past the 5s default under the coverage
lane's instrumentation.

Both violations name one of two words in source: an agent construction needs a
binding from the undici module, and the option is a property called
`dispatcher`. Skipping a file that mentions neither leaves 21 of 1597 files to
parse, so the scan runs in ~60ms instead of ~500ms — well clear of the timeout
even instrumented.
2026-08-29 13:17:12 +08:00
Yichen Jiang cfc9b3bdef fix(net): route by the policy, and give a child the routing its parent has
Second review pass on the outbound proxy work.

The installed dispatcher was undici's EnvHttpProxyAgent, which reuses the HTTP
proxy for `https:` whenever no HTTPS proxy is present. That is exactly the state
this package resolves after refusing a SOCKS or malformed URL the user named for
`https:`, so the scheme the diagnostic reported as direct was tunnelled anyway.
The dispatcher is now an Agent whose per-origin factory calls `proxyForUrl`, so
routing and `proxyForUrl` cannot disagree by parsing the same list twice.

`childProxyEnv` returned only the names the user exported, which left a child
Node direct whenever the proxy came from `ALL_PROXY` or from cordis.yml — Node's
`NODE_USE_ENV_PROXY` reads neither — and stripped the merged loopback bypass so
the child sent its own localhost traffic to the proxy. A scheme the user named
in either casing still reaches the child exactly as written; one they named in
neither now carries the resolved value, and the bypass list is always the merged
one.

A nested install (the plugin mounted over the launcher's policy) recorded the
outer policy's published values as the user's, then cleared the record on
disposal, so every later child inherited the normalization instead. The record
now belongs to the outermost install and is restored, not dropped.

`web_fetch` read the active policy twice — once to skip address pinning, again
inside the transport — so a disposal landing between the two reads produced an
unpinned direct connection to a host nothing validated. One snapshot now decides
both.

Also: the node:http proxy test asserted a route the engines range does not always
have, and the gate could not see undici bound through `await import('undici')`,
the form this repository actually uses.
2026-08-29 13:17:12 +08:00
Yichen Jiang 52e39cd783 test(net): clear the ambient proxy before asserting what a child inherits
The case builds a user environment and asserts a child receives it verbatim,
so a runner that exports its own proxy supplied half the "user" values and
decided the assertion.
2026-08-29 13:17:12 +08:00
Yichen Jiang e6dbf85f6c fix(net): address review — containment, opt-out, and syntax-aware discovery
The workflow worker no longer receives proxy configuration: it executes the
model-authored script body, and a proxy URL may carry credentials. A child
process now inherits the values the user exported rather than this process's
normalization, so a SOCKS proxy set for curl survives and no HTTPS_PROXY is
invented. `mode: 'off'` installs a direct dispatcher instead of recording a
policy the global dispatcher ignores, and the environment snapshot is taken
before any write so Windows restores the user's values.

E2B picks its proxy from the control-plane URL the SDK will really call, the
OTLP agent honors `exporter.keepAlive`, and a scheme whose own value was
refused stays direct instead of borrowing another scheme's proxy.

verify-no-bare-dispatcher parses the TypeScript AST as scripts/AGENTS.md
requires; it immediately found the `{ dispatcher }` shorthand the regex missed.
2026-08-29 13:17:12 +08:00
Yichen Jiang aa0ed35ebc test(snapshot): isolate a replayed dsh from the machine's proxy environment
A replay must not depend on the runner's network policy, the same reason it
pins its home and sessions root. The harness now honors the proxy environment,
so a runner exporting one sent the web-fetch scenario's fixture request to a
proxy that could not resolve the fixture host and recorded that proxy's error
page. Clear the proxy names in both test-support spawners, from the one list
dsh-http-proxy owns.
2026-08-29 13:17:12 +08:00
Yichen Jiang ca20b9af11 test(llm): cover the DeepSeek and pi-ai request paths with egress tests
Both adapters' inference requests were argued from a code read and, for
DeepSeek, from one product smoke. Drive each shipping adapter at an
unresolvable endpoint through a fake proxy instead, and cover pi-ai's provider
stream rather than only its model discovery.
2026-08-29 13:17:11 +08:00
Yichen Jiang 35bc2d1d45 fix(webworker): register a node:https placeholder for the proxy agent factory
The VFS packer sweeps module requests statically, so dsh-http-proxy's agent
factory made the preview image unpackable: it names node:https for the SDKs
that post through Node's core HTTP modules, a path the worker never takes.
Mock it the way node:net is mocked rather than hiding the request.
2026-08-29 13:17:11 +08:00
Yichen Jiang ec82e3e3ee test(net): assert the child and worker proxy seam by Node version
NODE_USE_ENV_PROXY reaches Node 24.0+ and 22.21+, while engines admits 22.19.
Assert the direct connection on an older runtime instead of only the proxied
one, so the seam is executable rather than prose.
2026-08-29 13:17:11 +08:00
Yichen Jiang 545e2ad914 feat(net): route every outbound request through the configured proxy
Node's built-in fetch ignores HTTP_PROXY, so every harness request connected
directly regardless of what the user exported. Resolve one policy from the
launch environment and install it as undici's global dispatcher, then wire the
four surfaces a global dispatcher cannot reach: web_fetch's pinned transport,
the OTLP exporter's node:http agent, the E2B SDK's own proxy option, and the
environment a child process or worker thread is given.

Each outbound call site carries an egress test that drives its real code path
through a fake proxy; that measurement is what found the OTLP and E2B gaps.
2026-08-29 13:17:11 +08:00
Yichen Jiang 1dd5476232 Merge pull request #3308 from deepseek-harness/worktree-windows-lane-hook-budget
test(ci): carry the hook budget and align the Lefthook suite with the lane
2026-08-29 12:06:59 +08:00
imccyu b56d4f4472 Merge pull request #3305 from deepseek-harness/worktree-connerr
feat(web): surface and recover connection failures
2026-08-29 12:03:33 +08:00
imccyu 84c7ae3398 fix(web): align connection indicator labels 2026-08-29 11:18:58 +08:00
imccyu 18480ff902 test(connection): verify and document recovery behavior 2026-08-29 11:18:58 +08:00
imccyu 19b4d7f26c feat(web): add connection recovery indicator 2026-08-29 11:18:58 +08:00
imccyu ccfbbb443a refactor(connection): centralize websocket recovery 2026-08-29 11:18:58 +08:00
Yichen Jiang 90505636cd test(ci): carry the hook budget and raise the Lefthook suite to the lane value
The Windows coverage lane grants DSH_COVERAGE_TEST_TIMEOUT_MS=90000, but two
paths declined it.

scripts/install-lefthook.spec.ts took a describe-level 30_000, restated as a
per-case constant on five cases. Every case drives spawned Git and Node
subprocesses; the slowest costs 7.5 s on an idle host, so the ceiling carried
roughly fourfold headroom and fired on branches that did not touch the file.
The suite takes 90_000 and the redundant constant is removed.

coverageTestTimeoutArgs raised --testTimeout and --expect.poll.timeout but left
--hookTimeout at Vitest's separate 10 s default, which removeFixtureSafely's
documented 10-second Windows retry window meets exactly. Raising only the test
budget would move a contended suite's failure into its teardown.
2026-08-29 11:15:32 +08:00
imccyu f27021c9b6 Merge pull request #3293 from deepseek-harness/worktree-apiremote
refactor(api): converge the ctx.remote programming surface
2026-08-29 11:09:58 +08:00
Yichen Jiang 837cc95245 Merge pull request #3254 from deepseek-harness/test/translation-pairing-merge-budget
test(scripts): align the translation-pairing-merge budget with the coverage lane
2026-08-29 10:44:01 +08:00
imccyu 73a723f37f docs(api): correct the api-gateway reference codes and the failure-vocabulary note
- api-gateway reference (en/zh): gateway/lookup-unavailable and
  gateway/internal replace the pre-convergence codes, and the resolver
  paragraph states the RemoteError pass-through semantics.
- failure-vocabulary note (en/zh): the package is dsh-util-time, the
  marker is isDSHRemoteError, and discrimination requires no
  instanceof at all.
2026-08-29 03:12:46 +08:00
imccyu 674a1e95a3 fix(api): rename the failure marker, harden cross-realm discrimination, and mark the packed-record violation
- protocol: isDSHRemoteGatewayError -> isDSHRemoteError (the class is
  protocol-wide, not Gateway-specific); remoteErrorOf drops its
  instanceof Error precondition and tests the marker plus a string code
  structurally, so a marked failure from another realm no longer reads
  as a local defect.
- session-controller: the live-follow packed-record protocol violation
  now throws a marked RemoteError('gateway/internal'), landing the
  session in openState=error instead of an unhandled rejection;
  pinned at the transport and session levels.
- util-time: correct the invariant companion's @module name.
- regenerate the tool-cordis catalog for the marker rename.
2026-08-29 03:12:43 +08:00
imccyu 02a542f49f chore(docs): regenerate the slot catalog for the hostInfo hook rename 2026-08-28 23:37:26 +08:00
imccyu f9e8fc8f8a fix(api): identity-stable $host facts and a whole-record host info hook
- api/gateway: $host caches its RemoteHostFacts record and mints a new
  one only when home changes, so snapshot readers compare by reference;
  identity pinned in the client spec.
- client/ui-tool, client/ui-workspace: the hooks channel exposes the
  host facts record as hostInfo and components select the field they
  need (useHostInfo(info => info.home)); row-component contracts are
  unchanged.
2026-08-28 23:28:51 +08:00
imccyu a4f7193d24 docs: drop the Remote-failure bullet from packages/AGENTS.md
The rule text lives in the cookbook and the failure-vocabulary Agent
Note; the AGENTS.md roster and its 675-word budget stay as they were.
2026-08-28 23:01:54 +08:00
imccyu 39a5a1d7e4 chore(docs): regenerate catalogs, graphs, and the message-feedback golden
- gen-cordis-catalog / gen-cordis-inspect-catalog / gen-client-catalog /
  gen-config-catalog / gen-doc-graphs / gen-module-graph outputs pick up
  the converged Remote vocabulary (gateway/* codes, RemoteError JSDoc)
  and the dsh-util-time package; the zh sides of the three
  English-generated pages follow the same line-number shifts.
- the message-feedback protocol golden records the accepted wire
  change: a boundary-validation failure now reports
  gateway/input-invalid with structured details instead of a bare
  internal code.
2026-08-28 22:37:42 +08:00
imccyu 2b750cfb51 docs(api): document the converged ctx.remote programming surface
- new cookbook page adding-a-remote-api (en/zh): the five-step HOW-TO
  for declaring, failing, registering, consuming, and testing a Remote
  endpoint.
- new Agent Note ctx-remote-failure-vocabulary records this round's
  decisions and alternatives; the 2026-08-02 and 2026-08-10 notes are
  rewritten to the shipped facts (RemoteError vocabulary, $host, the
  retired ApiProxy statements).
- package READMEs pick up the new failure-face contracts
  (typert/protocol, api/gateway, api/remotes,
  test-support/client-runtime), dsh-util-time gains its README and
  registry entries, and stale connection/WorkspaceError/legacy-code
  statements are corrected (ui-settings, ui-settings-models,
  workspace-controller, docs/subsystems/typert incl. the
  TypertGatewayErrorCode type-equiv block).
- packages/AGENTS.md gains the Remote-failure rule bullet; its doc
  budget rises 675 -> 714: the bullet is the compressed remainder
  after relocating detail to the cookbook and the Agent Note.
2026-08-28 22:37:36 +08:00
imccyu 41cd24f3f6 test(api): cover the non-Error terminal escape in RemoteStream
The terminal fold's String(error) arm had no coverage; a generation
that rejects with a bare string now pins the marked gateway/internal
outcome.
2026-08-28 22:37:36 +08:00
imccyu 2f2e6d627b fix(api): resolve review findings on stream boundary, inject staleness, and ctx discipline
- api/gateway: mark terminal Remote-stream escapes (carrier retry
  exhaustion and pre-acceptance end classification) as
  RemoteError('gateway/internal') at the two escape points; marked
  failures pass through verbatim. The carrier class stays the
  retry-internal signal for carrierFailed and the ended(true) retry
  trigger. Regression coverage lands on the session and workspace
  stream consumers.
- client/ui-tool, client/ui-workspace: read $host.home through a hooks
  observable subscribed to connection/reset; the slot renderer memoizes
  inject results per entry, so the previous plain-value injection froze
  home at the first render.
- client/ui-settings-models: components no longer receive ctx; apply
  binds the credential and settings Remote operations into callbacks,
  and the settings/conflict code judgment stays in the apply world.
2026-08-28 22:37:36 +08:00
imccyu 5af9eec51c fix(api): address review findings on the gateway client failure face
- classify a carrier throw under a caller-aborted signal as
  gateway/cancelled instead of gateway/internal, matching the code the
  Host produces when the abort wins the wire round-trip.
- read $host facts from the construction-time Connection handle,
  matching $stream; the service cannot be replaced without restarting
  this plugin, so the live re-lookup was dead complexity.
- state rebuiltFailure's actual contract in its comment: codes pass
  through verbatim without runtime validation.
- correct the @module name in dsh-util-time.
2026-08-28 22:37:36 +08:00
imccyu d40d678b93 fix(api): repair runtime closure, gateway client bundle, and $host coverage
- python/sdk-runtime: add @deepseek-ai/dsh-util-time so the runtime
  dependency closure stays closed (dsh-subagent now depends on it).
- api/gateway: drop the dsh.client.external request for
  dsh-typert-protocol and admit the protocol package into INLINE_SAFE
  instead. The loader module table has no supplier for the protocol
  package, so the built client factory threw at require time; the
  protocol layer is duplication-safe by design (string marker,
  code-based discrimination), which is the inline-safe admission
  criterion.
- api/gateway tests: cover the $host getter (live service read,
  pre-ready home, and the construction-time fallback after the
  Connection service is withdrawn).
2026-08-28 22:37:36 +08:00
imccyu 804b1ffbfc refactor(api): converge the Remote failure vocabulary and client surface
Single RemoteError with a merge-extensible, domain-prefixed code map;
owners throw at the failure point; streams surface marked failures;
clients consume ctx.remote directly with isRemoteFailure as the only
discrimination point and construct no failure instances.
2026-08-28 22:37:36 +08:00
Yifffan 12d7b4ed0c Merge pull request #3262 from deepseek-harness/feat/session-turn-stats-display
feat(web): turn-tail usage and time stat pills with anchored dialogs
2026-08-28 13:52:02 +02:00
Yifffan 031bec12eb Merge pull request #3263 from deepseek-harness/hero-fish-hover-swim
feat(web): hero fish hover swim morph
2026-08-28 13:51:49 +02:00
Yif d07108f9a0 Merge remote-tracking branch 'origin/master' into hero-fish-hover-swim
# Conflicts:
#	packages/client/ui-conversation/src/client/skeleton/EmptyHero.tsx
2026-08-28 19:35:56 +08:00
Yif ececf8c170 fix(web): address hero fish hover review feedback
Move hover enter/leave from the svg element to the stationary fishHitbox
span so the CSS sway and SMIL morph share the same trigger surface and the
animation cannot flicker when sway displaces the svg from the pointer.
Gate the morph with (hover: hover) to match the CSS and prevent tap-sticky
loops on touch devices.

Remove residual headline changes unrelated to this PR: white-space: pre on
.headlineText, data-testid="hero-headline", and corresponding getByTestId
test assertions — these belong to #2397.

Fix Agent Note coverage claim (was "asserting render states", now accurately
"slot contract") and compress blowhole paragraph to current-state fact.
2026-08-28 19:29:31 +08:00
Yifffan 15f66b9c3c Merge pull request #3265 from deepseek-harness/fix/web-ui-polish
fix(client): Web 会话与输入 UI 细节修复
2026-08-28 13:20:23 +02:00
Yichen Jiang a0aff5fe53 Merge pull request #3296 from deepseek-harness/worktree/fix-subagent-settings-label-color
fix(web): use primary color for Subagent setting label
2026-08-28 19:02:12 +08:00
Yichen Jiang 84df0f11ae fix(web): use primary color for subagent setting label 2026-08-28 17:53:18 +08:00
Yifffan 5e610e1a74 Merge branch 'master' into hero-fish-hover-swim 2026-08-28 11:51:06 +02:00
Yifffan 8f4fcdd792 Merge branch 'master' into feat/session-turn-stats-display 2026-08-28 11:50:42 +02:00
Yifffan 8a8db06d06 Merge branch 'master' into fix/web-ui-polish 2026-08-28 11:50:38 +02:00
Yichen Jiang 375af94454 Merge pull request #1756 from deepseek-harness/worktree/fix-settings-focus
fix(web): restore focus after closing settings
2026-08-28 17:25:40 +08:00
Yichen Jiang 9cd2cb8f03 Merge pull request #3279 from deepseek-harness/perf/session-lookup-windows-only-stat
perf(session): stat the probe parent only on Windows
2026-08-28 17:21:49 +08:00
Yichen Jiang f2b9875c47 test(session): await projection cache write-back 2026-08-28 17:07:33 +08:00
Yif a0a350f640 Merge remote-tracking branch 'origin/master' into fix/web-ui-polish 2026-08-28 16:25:42 +08:00
Yif 6daed7c5aa fix(client): make trigger-menu Enter an explicit no-op while refinement pends
Retained rows made arbitrate('enter') claim 'pick-highlighted' while
pick() silently declined the pending group, so the key vanished by
coincidence. Check the highlighted group's readiness like Tab does and
return 'consumed' deliberately; record the stale-while-revalidate menu
decision in an Agent Note.
2026-08-28 16:24:07 +08:00
Yif a666f86129 Merge remote-tracking branch 'origin/master' into hero-fish-hover-swim 2026-08-28 16:07:28 +08:00
Yif 3a0dd5d38b Merge remote-tracking branch 'origin/master' into feat/session-turn-stats-display
# Conflicts:
#	packages/client/ui-primitives/tests/icons.client.spec.tsx
2026-08-28 16:04:13 +08:00