Commit Graph

3528 Commits

Author SHA1 Message Date
Tianyi Cui
7f333d8837 Merge branch 'master' into sdk/ts-client-and-subagent 2026-07-27 22:41:23 +08:00
Tianyi Cui
55247b80b2 Merge origin/master (tsx lint lanes, session-telemetry-otel example dep) 2026-07-27 22:35:43 +08:00
Tianyi Cui
096d2dc06a Merge branch 'master' into xtr/agent-loop-message-machine 2026-07-27 22:34:21 +08:00
imccyu
cdd4d59ea0 chore(lint): clear the semantic .tsx backlog
Hand fixes for the findings --fix cannot touch, mirroring the fixes
already applied on the fe-docs feature branch (same file, same shape)
so its eventual rebase resolves cleanly:

- restore the return the no-confusing-void-expression autofix ate in
  useAbsentSnapshot (typed S | undefined; hook call kept for hook-order
  stability, undefined returned explicitly);
- re-type DOM queries the no-unnecessary-type-assertion autofix broke:
  getByRole<HTMLButtonElement>(...) generics instead of the removed
  as-casts (the eslint program and the client tsconfig aggregate
  disagree about these casts; the generic form satisfies both);
- justified eslint-disable for the deliberate legacy paths: keyCode 229
  IME-composition detection, execCommand clipboard fallbacks, lib.dom
  clipboard optionality, and the any-typed Reflect.get/this probes in
  test fakes;
- drop the dead react/no-danger directive (eslint-plugin-react is not
  loaded, so the rule never applied) keeping its shiki rationale;
- delete the tautological 'Z' comparison and the renameTarget null
  check already implied by renameBlocked;
- css-module non-null assertions replaced by type widening
  (Button className, TAG_CLASS Record) per the established pattern;
- misc: max-len comment wraps, void generic drop in the deferred test
  helper, unused type imports, floating selectWorkspace promises voided,
  member-delimiter newlines in inline type literals.
2026-07-27 22:23:41 +08:00
imccyu
2adf44fb80 chore(lint): declare contract callbacks property-style
unbound-method flags destructuring a method-style member (method
signatures are bivariant and exempt from the this-context check).
These contract members are all plain callbacks — declare them as
property-style function types so consumers can destructure them
without a false this-binding hazard. Type-level only.
2026-07-27 22:23:10 +08:00
Tianyi Cui
ed8f9c2808 refactor: rename the backend to dsh-subagent-dsh-sdk
The group's convention is package suffix == provider default
(subagent-acp/'acp', subagent-spawn/'spawn', subagent-fork/'fork'), and the
provider default became dsh-sdk in the last review round — so the package
follows: @deepseek-ai/dsh-subagent-dsh-sdk at
packages/subagent/subagent-dsh-sdk, plugin name subagent-dsh-sdk,
diagnostics prefixed subagent-dsh-sdk:. The dsh echo has precedent
(dsh-llm-deepseek). Directory, fixture path, knip/tsconfig/examples
registrations, catalogs, READMEs (en+zh), and the Agent Note follow; the
sdk-client dispose ladder moves to its own module (src/dispose.ts) with the
deterministic FakeChild tier tests restored alongside it.
2026-07-27 22:17:10 +08:00
Tianyi Cui
87a249106f Merge origin/master: port the SDK stack onto the subprocess seam
Master's #660 replaced dsh-subagent-subprocess with the dsh-subprocess
capability seam (ctx.subprocess + scrubbedParentEnv, tree-scoped teardown)
and moved subagent-acp onto it. Convergence for this branch's packages:

- The shared out-of-process provider vocabulary this branch had grown in
  the deleted library (NO_START_CAPABILITIES, assertPositiveFinite, cwd
  resolution, settleRunResult, subprocessRunHandle) moves into the subagent
  seam package as out-of-process.ts — it enforces subagent-seam contracts,
  not process mechanics, and both out-of-process backends now import it
  from there (subagent-acp keeps master's shape otherwise).
- subagent-sdk spawns THROUGH the SDK client (the subprocess README's
  documented exception for SDK-managed transports) and now applies the
  seam's scrubbedParentEnv() + explicit-env merge in place of the deleted
  buildChildEnv.
- sdk-client inlines the EOF→SIGTERM→SIGKILL ladder as private helpers (it
  runs outside any harness context, so it cannot ride ctx.subprocess).
- The child harness fixture gains the now-required dsh-subprocess-local
  entry for bash-local; the fixture cordis.yml keeps exercising the
  shipped provider default.
2026-07-27 21:52:40 +08:00
_Kerman
fb1dc6d117 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/session.i18n.yaml
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
2026-07-27 21:51:37 +08:00
imccyu
49c2e85ac7 chore(lint): apply eslint auto-fixes across the .tsx backlog
Mechanical --fix output over the newly linted .tsx files (indent,
arrow-parens, comma-dangle, member-delimiter-style, unnecessary type
assertions), plus the three generic-arrow test hooks converted to
function declarations up front: the comma-dangle fixer strips the
<T,> disambiguation comma and turns them into parse errors otherwise.
2026-07-27 21:49:40 +08:00
Tianyi Cui
605df45928 Merge remote-tracking branch 'origin/master' into feat/telemetry-otel-plugin 2026-07-27 21:32:50 +08:00
Tianyi Cui
0af16387ae fix(telemetry): rename record waterfall 2026-07-27 21:30:28 +08:00
_Kerman
ed67ad53d2 refactor(agent): return request retry action 2026-07-27 21:17:49 +08:00
Chinesezjc
207bab0c21 Merge remote-tracking branch 'origin/master' into fix/question-composer-row-shrink 2026-07-27 21:11:15 +08:00
kingwl
7d4b984037 Merge remote-tracking branch 'origin/master' into feat/telemetry-otel-plugin
Resolutions: regenerate the conflicted generated docs (cordis services
catalog, event-producer-consumer, module-graph); take master's
packages/README pair and re-insert the telemetry row on both sides;
re-record the README and session-doc translation pairs.
2026-07-27 20:26:21 +08:00
Chinesezjc
82f66f8fde Merge remote-tracking branch 'origin/master' into fix/question-composer-row-shrink 2026-07-27 20:20:16 +08:00
kingwl
bf76c52d76 fix(telemetry): reject non-positive maxExportBatchSize at plugin load
Review finding, pinned red-first: the SDK accepts
processor.maxExportBatchSize <= 0 (or fractional), but its shutdown
drain then splices empty batches without consuming the queue —
disposing telemetry hangs forever whenever records are queued. The
constructor now rejects a non-positive-integer batch size before
building the SDK processor, per the misconfiguration-fails-loud rule;
everything else in the processor block remains the SDK's verbatim
passthrough.
2026-07-27 20:11:30 +08:00
Ziya
91d85773ac Merge branch 'master' into feat/workspace-native-folder-picker 2026-07-27 08:06:44 -04:00
Tianyi Cui
08851a1a3e Merge branch 'master' into turtle1999-patch-1 2026-07-27 19:57:43 +08:00
_Kerman
c6073f07c2 Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	docs/architecture.i18n.yaml
#	docs/architecture.md
#	docs/architecture.zh.md
#	docs/core-data-structures/core.i18n.yaml
2026-07-27 19:55:55 +08:00
kingwl
a72436105b docs(telemetry): state the crash-repair export semantics for resumed streams
Review finding: synthetic turn closers written by SessionPersistence
.load() at crash-resume sit below firstLiveSeq and are never exported,
leaving the remote turn unbalanced. Kept deliberately — exporting a
synthetic closer cannot complete a turn whose real tail records died
in the crashed process's queue; it can only make an incomplete turn
look closed. The OTel README now states the receiver rule (a
never-closed turn on a resumed stream marks the previous process dying
inside it; a later clean shutdown marker attests only to the resumed
process's exit), and the revival Agent Note records why the repair
suffix stays local.
2026-07-27 19:49:19 +08:00
Chinesezjc
0701245007 Merge remote-tracking branch 'origin/master' into fix/pty-raw-ready-wait 2026-07-27 19:44:10 +08:00
ZiyaZhang
a5239b0f64 test(gui): cover native workspace picker branches 2026-07-27 04:37:24 -07:00
Tianyi Cui
dd03c88083 Merge commit 'refs/codex-unblock/20260727/pr660-master' into worktree/pr660-merge-20260727
# Conflicts:
#	scripts/doc-budgets.manifest.json
2026-07-27 19:34:55 +08:00
Chinesezjc
9dd57a25c5 fix(ui-question): stop option rows absorbing the capped card's shortfall
The question composer card is capped against the viewport and scrolls its
option list. `.options` is a flex column whose children defaulted to
`flex-shrink: 1`, so a short seat shrank the rows before overflowing the
scroll container: a row collapsed to its 42px minimum while `.optionCopy`
kept the taller height its wrapped copy needs, and `align-items: center`
then painted that copy outside the row's border box — over the question
title above and the next row below. Measured 6.5px of spill at 900x440 on
the shipped client, 10px at 380px tall, with `.options` reporting
scrollHeight === clientHeight and therefore offering no scrollbar.

`.option` and `.custom` now declare `flex-shrink: 0`, so the shortfall
reaches the scroll container that already owns `overflow-y: auto` — the
behavior the cap was designed for. Only rows whose copy wraps could
reproduce this, which is why the recorded scenario now asks a question
with long option descriptions; the web e2e asserts at three squeezed seat
heights that every row's children stay inside its border box, guarded
against holding vacuously by requiring a wrapped row and a scrolling list.
2026-07-27 19:20:33 +08:00
_Kerman
613eaba80c fix(tui): correlate referenced prompt snapshots 2026-07-27 19:06:44 +08:00
Chinesezjc
30d9bdfa42 Merge remote-tracking branch 'origin/master' into fix/pty-raw-ready-wait 2026-07-27 19:00:30 +08:00
_Kerman
9152858fd7 fix(agent-loop): preserve deferred message boundaries 2026-07-27 18:58:27 +08:00
ZiyaZhang
fef928a7e1 feat(gui): add native workspace folder picker 2026-07-27 03:50:22 -07:00
Tianyi Cui
961bde6473 test(sdk): keep fresh Yarn installs mutable in CI
The live-link E2E intentionally creates a project without a lockfile. Prevent ambient CI=true from making Yarn 4's first install immutable, while preserving the CI environment for every other behavior under test.
2026-07-27 18:48:11 +08:00
Chinesezjc
153157195c docs(pty): scope the settle boundary to the settled operation
The paragraph claimed later child output reaches only the scrollback. Output
after a settle still reaches the scrollback and whichever send is active when
it arrives — appendOutput writes both (session.ts:302-307), and settleActive
clears `active` rather than suppressing delivery. Only the settled operation
stops receiving it, which is what the timing bound protects.
2026-07-27 18:47:23 +08:00
_Kerman
7c2cf5f0b3 test(workspace-context): align typed baseline fixtures 2026-07-27 18:39:22 +08:00
kingwl
6adb14b56d feat(telemetry): adopt from the construction boundary — constructor seeds never re-export
A cursor-less adoption (process restart + resume, fork, seam-module
reload) replayed the session's full log from seq 0, re-exporting
history that already left the process — a resume re-billed its entire
stored log on every restart, and a fork re-shipped the parent's prefix
under the child's id, doubling query-time counts on OTLP backends with
no native ingest dedupe.

dsh-session now exposes the fact the constructor already validated but
discarded: Session.firstLiveSeq, the constructor-seed length — the
first seq appended in this process. header.seedLength cannot serve
here: it is the durable fork-lineage boundary, and a resumed session's
constructor seed is its full stored log while the header keeps the
original fork value (llm-replay and session-query-sqlite depend on
that meaning). Constructor seeds also never publish on the
session/event firehose, so adoption replaying them was inconsistent
with the system's own publication semantics.

Adoption's cursor-less fallback starts at firstLiveSeq; seed events
still feed the chunk projection, so mid-step continuations re-drop
after a resume. Fork streams are no longer self-contained: records now
carry session.seed_length (with the existing session.parent_id) so
receivers stitch the child's stream onto the parent's. Accepted cost,
consistent with at-most-once delivery and recorded in the revival
Agent Note: a resume no longer backfills records a previous process
failed to deliver — a deployment with that requirement needs the
deferred outbox, not replay.

Pinned red-first: seeded adoption exports nothing (assertion reversed
from the prior seed-readback test, obsolete behavior changed with its
test), resume-shaped seed rebuilds the projection without exporting,
and fork records carry the stitch attributes.
2026-07-27 18:35:03 +08:00
_Kerman
6af8a2e1d8 Merge remote-tracking branch 'origin/xtr/agent-loop-message-machine' into xtr/agent-loop-message-machine 2026-07-27 18:33:22 +08:00
_Kerman
98238ceace fix(agent-loop): settle rejected admission context 2026-07-27 18:32:07 +08:00
_Kerman
5d10074839 test(workspace-context): cover unsized dynamic probe 2026-07-27 18:31:50 +08:00
Chinesezjc
4f2068ff27 Merge remote-tracking branch 'origin/master' into fix/pty-raw-ready-wait 2026-07-27 18:31:46 +08:00
_Kerman
cda482b555 Merge branch 'master' into xtr/agent-loop-message-machine 2026-07-27 18:31:16 +08:00
_Kerman
376bf7f365 fix(workspace-context): rearm compacted baseline 2026-07-27 18:27:39 +08:00
Tianyi Cui
6c8bf0a522 fix: address human review — default providerName dsh-sdk; raise composition-e2e deadline
- subagent-sdk: the default registry name becomes `dsh-sdk` (the bare
  `sdk` read ambiguously in configs); READMEs, config catalog, fixture,
  and suites follow. The Loader fixture now omits providerName to exercise
  the shipped default end to end.
- loader-composition.e2e: two full harness runtimes boot in sequence, so
  the default 30s loader-smoke window times out under host load; raise the
  subprocess deadline to 120s with matching vitest headroom (the
  real-model.e2e precedent).
2026-07-27 18:25:18 +08:00
Chinesezjc
1927d347cd Merge remote-tracking branch 'origin/master' into fix/pty-raw-ready-wait
master already stabilized the raw-mode SIGINT scenario in 65e0ffe03 and
3be090f1d with wider scenario-owned bounds and deliberately delayed child
readiness, so the merge takes master's test implementation. What this branch
keeps is the contract that explains why those bounds are required: the note
paragraph on the settle boundary in PtySendOperation.append, and the
waitForOutput comment recording that raising its deadline alone cannot
recover output the send never collected.
2026-07-27 18:15:47 +08:00
_Kerman
cf49101d9a Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	.agents/notes/implemented/feature/2026-07-06-sandbox.i18n.yaml
2026-07-27 18:12:38 +08:00
_Kerman
ff7792b17c docs(agent): document next-step acceptance window 2026-07-27 18:07:51 +08:00
_Kerman
f63d937496 fix(tui): route prompts by next-step capability 2026-07-27 18:05:43 +08:00
Tianyi Cui
d897dcc7ea Merge remote-tracking branch 'origin/master' into worktree/pr682-retarget-20260727
# Conflicts:
#	.agents/notes/rejected/simplification/2026-07-26-dependency-swaps-rejected-by-nih-audit.i18n.yaml
2026-07-27 17:55:56 +08:00
_Kerman
a59ce0367c fix(agent-loop): route next-step input during admission 2026-07-27 17:55:55 +08:00
Tianyi Cui
cf2b9e211d fix(sdk-client): address ds-review-bot findings
- api: resolve a relative workspace cwd to absolute before the handshake —
  the child spawns relative to the parent cwd, but the wire cwd is resolved
  again inside the child, so a relative value double-resolved
  (worker -> worker/worker).
- api: make the documented handshake retry real — HarnessClient.close() is
  permanent, so a failed initialize now reaps the runtime and swaps in a
  fresh client; DeepSeekHarness.close() is terminal and stops the respawns.
- api: validate session.event envelopes, assistant/message content, and
  session.finished reasons at the wire boundary — a malformed runtime
  surfaces as SdkProtocolError instead of type-invalid TurnResult data or a
  TypeError out of finalResponse.
- client: a throwing subscribe() filter fails and detaches only its own
  subscription (normalized to Error); sibling fan-out and the transport read
  loop are undisturbed.
- client: NotificationSubscription.close() drops its queued notifications,
  matching its documented contract; runtime-death fail() still leaves
  already-delivered items drainable.
- client: subscribe() after close()/runtime death returns a born-failed
  subscription so next() rejects instead of parking forever.
- client/transport: bounded requests abandon via AbortSignal — the transport
  drops the pending entry at timeout, so repeated bounded calls against a
  hung method retain no per-call state.

One test per finding; per-file coverage stays 100% on both packages.
2026-07-27 17:48:07 +08:00
Turtle
ac1431e4f5 fix(session-title): improve prompt
bad case:
when i start the session with a skill reference, llm returns XML
2026-07-27 17:47:48 +08:00
_Kerman
52174e32cb refactor(agent): clarify turn lifecycle event names 2026-07-27 17:38:42 +08:00
Tianyi Cui
94d5816142 Merge remote-tracking branch 'origin/master' into worktree-process-service-seam 2026-07-27 17:38:01 +08:00
_Kerman
7d5cc498d3 docs(agent): call agent step an extension point 2026-07-27 17:24:20 +08:00