Commit Graph
87 Commits
Author SHA1 Message Date
LegGasai 0750436cb4 feat(sdk): report why a session agent was disposed (#8738)
* feat(sdk): report why a session agent was disposed

A request for a session whose agent left the registry now states whether the
whole runtime is shutting down, the SDK server is shutting down, or only the
agent loop was unloaded. During runtime shutdown it names the last process
event observed before teardown; for an agent-loop unload it gives the time and
the plugin whose unload began first. The liveness check reads the registry as
optional, so both stages of root disposal report the same failure.

Refs #8737

* fix(sdk): keep the runtime observation out of the plugin entry exports

The static gates reject a new read of the Cordis root context, a value export
from a function plugin entry, and new assertions to unknown. The plugin entry
now passes the server an observation built from the root fiber it already
holds, the helper lives in the internal process-events module, and the new
tests complete the handshake instead of casting the server.

Refs #8737

* fix(sdk): keep the process-event record from throwing and state the unload origin as an observation

A rejection value without a string form made the failure text throw inside a
prepended listener, which would end the dispatch before the listener that owns
the event. The text now falls back to a fixed marker. The plugin named for an
agent-loop unload is the first one unloading at that time, which overlapping
unloads can make unrelated, so the message and README say that.

Refs #8737

* feat(python-sdk): log the runtime's stderr lines as they arrive

The runtime writes its fatal report, including the stack of an unhandled
rejection that ends the process, to its own stderr. The SDK kept those lines
in memory and attached them only to initialization, timeout, and transport
failures, so a host saw none of it for an ordinary JSON-RPC error. Each line
now also goes to the Python logger deepseek_harness.runtime at INFO.

Refs #8737
2026-11-19 07:59:52 +00:00
yudshj dca075e2a2 feat(sdk): 普通 prompt 逐条上报用户时区
session/prompt 与 session/query 接受可选 timeZone,TS/Python 客户端透传;省略时逐条采样进程时区,写入 sdk-user 来源的 clientTimeZone。time-context 读取不带 rpcId 的 user 来源时区。补持久化记录、Agent Note、升级指南、README,并刷新 SDK snapshot。
2026-11-19 11:58:00 +08:00
LegGasai f9eb524891 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers 2026-11-17 19:50:49 +08:00
LegGasai 854ebc768a Merge remote-tracking branch 'origin/master' into feat/session-workspace-root 2026-11-17 19:29:22 +08:00
LegGasai 3834d302df fix(sdk-server): remove the fallback authentication when its route fails
initialize() mounts DeepSeek request authentication before the fallback
official route in a composition that has none. When the route did not
mount, for example for a DEEPSEEK_BASE_URL that is no HTTP(S) root, the
authentication service stayed in the composition and shutdown() skipped
it, because shutdown releases both only after the route mounted. A route
whose disposal threw skipped the service the same way.

A failed route mount now removes the service that call mounted, and
shutdown releases the service whether or not the route's disposal
succeeds.
2026-11-17 14:51:36 +08:00
LegGasai c9b9859b74 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers
The lower branch removed `rootOf` and the `workspaceRoot` projection: a Session
has one directory, read through `ctx.workingDirectory.get`. This merge moves the
consumers of this branch to that read.

- sandbox-policy, workspace-files, and workspace-changes read `get`; the
  `recordedRootOf` read is removed. With the working-directory service mounted,
  a Session without a header directory is bounded by that service's default
  directory.
- The skill catalog, sidebar terminals, project instructions, `@` file
  candidates, the LSP workspace, and skill lookup return to the lower branch's
  code, which already reads the directory.
- The client helper exports `selectSessionDirectory` and `sessionDirectory`
  in place of the `{ root, cwd }` pair; `WorkspaceChangesSummary` keeps `cwd`,
  now the directory the turn started in.
- A stored `working-directory/change` inside the project moves the write
  boundary and file views with the directory; one outside returns to the project.
2026-11-16 22:33:13 +08:00
LegGasai 219f27c927 Merge branch 'refactor/llm-route-credential' into refactor/deepseek-auth
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	packages/experimental/translator/package.json
#	packages/experimental/translator/tests/paid-fixture.ts
#	packages/llm/llm/README.i18n.yaml
#	packages/web/web-deepseek-api/src/index.ts
2026-11-16 21:47:49 +08:00
LegGasai f9513796b8 Merge remote-tracking branch 'origin/master' into feat/session-workspace-root 2026-11-16 21:36:56 +08:00
_Kerman 9e8b32e3f1 Merge master and preserve forge command rules during text extraction 2026-11-16 20:29:36 +08:00
LegGasai 2846506983 refactor(llm): connect the DeepSeek model routes to ctx.deepseekAuth
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.
2026-11-15 16:03:18 +08:00
LegGasai cb0ebcc032 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers
Brings master (23c1d884226) through the parent branch. The SDK client README
keeps master's resume-permission paragraph and this branch's statement that
`setWorkingDirectory` moves the `workspace-write` boundary.
2026-11-13 17:23:38 +08:00
LegGasai 19f1314433 Merge remote-tracking branch 'origin/master' into feat/session-workspace-root 2026-11-13 17:05:44 +08:00
fz e198ef07b3 Merge pull request #8400 from deepseek-harness/feat/sdk-resume-permissions
feat(sdk): allow permission overrides when resuming sessions
2026-11-13 16:40:12 +08:00
LegGasai 86c3127ecf Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers 2026-11-13 15:55:47 +08:00
LegGasai e92c4eea4b Merge remote-tracking branch 'origin/master' into feat/session-workspace-root
master released 0.2.2-rc.3: the removed `tool-working-directory` package stays
deleted (master only bumped its version), and the upgrade guide moves to
`docs/upgrade-guide/v0.2.2-rc.3/`.
2026-11-13 15:54:46 +08:00
fz 68805d989f fix(sdk): reject unknown session resume options 2026-11-13 15:41:57 +08:00
LegGasai f0bc702c5a Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers
# Conflicts:
#	apps/desktop-host/tests/file-drag.spec.ts
#	docs/capability-seams.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
#	docs/subsystems/worktrees.i18n.yaml
#	packages/api/session-controller/tests/session-skills.host.spec.ts
#	packages/api/workspace-files/tests/scope.spec.ts
#	packages/client/tsdown.client.ts
#	packages/deliverables/workspace-changes/tests/git.spec.ts
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/worktree/README.i18n.yaml
#	packages/experimental/worktree/src/index.ts
#	packages/sandbox/sandbox-policy/package.json
#	packages/session/working-directory/package.json
#	packages/test-support/agent-loop-testkit/tests/agent-loop-testkit.spec.ts
#	pnpm-lock.yaml
2026-11-13 13:30:22 +08:00
fz f44702cb40 feat(sdk): allow permission overrides when resuming sessions 2026-11-13 13:23:09 +08:00
LegGasai d1d553049c Merge remote-tracking branch 'origin/master' into feat/session-workspace-root
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
#	docs/subsystems/worktrees.i18n.yaml
#	docs/subsystems/worktrees.md
#	docs/subsystems/worktrees.zh.md
#	docs/tool-catalog.i18n.yaml
#	packages/acp/acp/tests/bridge.spec.ts
#	packages/acp/acp/tsconfig.json
#	packages/experimental/tool-worktree/tests/loader-composition.spec.ts
#	packages/experimental/worktree/README.i18n.yaml
#	packages/experimental/worktree/src/index.ts
#	packages/sdk/server/tests/server.spec.ts
#	packages/session/tool-working-directory/package.json
#	packages/session/working-directory/tests/working-directory.spec.ts
#	snapshots/sdk/tool-error-details/notifications.expected.jsonl
#	snapshots/sdk/tool-error-details/session.v4.jsonl
#	snapshots/session/advanced-toolchain/session.v4.jsonl
#	snapshots/session/ptc-python-turn/system-prompt.expected.md
2026-11-13 12:25:55 +08:00
Shigma fc1710a167 Merge remote-tracking branch 'origin/master' into chore/cordis-core-rc12 2026-11-11 22:09:14 +08:00
LegGasai 434ef15931 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers
Adapt the consumers to the Host-only workspace model of the base branch:

- sandbox-policy: a marked working-directory change, not an anchor, is the
  point that reads the entered root's Git layout again.
- working-directory: keep recordedRootOf on the reworked service and its
  test doubles.
- Tests that entered a checkout through relocate use set; tests that relied
  on a directory change inside the root append a change without the marker.
- SDK documents and the upgrade guide state that the workspace-write boundary
  follows setWorkingDirectory and a Host-chosen child start directory, and
  that exit_worktree leaves a worktree.
2026-11-11 22:08:19 +08:00
LegGasai ed30d274f1 refactor(working-directory): move the workspace only through Host operations
Remove the model-facing working_directory tool and the cwd parameter of the
subagent tools, so only Host operations move a Session's directory. Every
change the service records carries `workspace: true`, and the workspace root
is the directory of the last marked change, or the original project. The
anchor field, the anchor list, relocate, inherit, and anchorsOf are gone;
get, ensure, set, and rootOf remain.

A change without the marker, recorded while the model could move the
directory, moves only the current directory, so stored Sessions keep the
root they had.

- worktree: create enters the checkout through set; exit returns the Session
  to the source checkout of the recorded worktree that contains its directory,
  and exit_worktree exposes it to the model.
- subagent: a child starts in the parent's workspace root or a Host-chosen
  directory through set.
- SDK: the working-directory methods return { cwd } again and
  getWorkspaceRoot / get_workspace_root are removed.
- Recorded sessions: the worktree scenario leaves through exit_worktree and
  covers recovery from a removed worktree; the two scenarios that only drove
  the removed tool are deleted; three compaction scenarios lower their tuned
  context window by the removed tool-schema tokens.
2026-11-11 20:10:17 +08:00
_Kerman 3268ba0ccd refactor(llm): share extractTextContent across text consumers 2026-11-11 16:43:06 +08:00
imccyu 455f7a38a6 Merge pull request #8214 from deepseek-harness/split-exports-brand-strings
refactor(brand): migrate internal identity construction
2026-11-11 15:15:26 +08:00
Shigma 1511a6ed44 chore(cordis): upgrade core to 4.0.0-rc.12 2026-11-05 20:34:44 +08:00
LegGasai 215ed13d0b fix(working-directory): record canonical project directories and anchor the recovery destination
Producers record the Session header directory by its canonical spelling:
ACP session/new, the SDK server, and the Web controller resolve the
requested directory through the execution-world filesystem before
creating the Session, so the canonical paths later directory changes
record compare with the header lexically. The directory service registers
the deployment fallback as the first anchor of a Session without a
recorded project, on its first validation or before its first relocation,
and registers a recovery destination that no anchor contains. A root
therefore no longer stays on a checkout that disappeared, and a header
spelled through a symlink recovers onto the canonical project.

Review: https://github.com/deepseek-harness/deepseek-harness/pull/7817#discussion_r4454836433
Review: https://github.com/deepseek-harness/deepseek-harness/pull/7817#discussion_r4454836528
2026-11-04 13:54:03 +08:00
LegGasai a71975faf6 feat(working-directory): add Session workspace roots with anchored relocation
Each Session now has three directories: the immutable original project in
the header, the workspace root, and the current directory. `relocate`
registers an entered checkout as an anchor through the optional `anchor`
of one working-directory/change event, and the new workspaceRoot
projection selects the longest anchor containing the current directory,
so an ordinary cd inside a checkout moves only the cursor while entering
another checkout moves the root with it. A log without anchors keeps the
original project as its only anchor.

Worktree creation relocates instead of setting the directory; a subagent
that starts inside its parent's relocated root inherits that root; the
SDK working-directory methods return the root beside cwd; the user
context names the root while it differs from the current directory, and
a notice that selects another root ends with it. Consumers keep reading
the header or the current directory until a later change moves them.

Refs #2658
2026-11-03 17:24:29 +08:00
Dudu-0223 999f30aae9 fix(sdk): identify subagent ownership errors by name and code 2026-10-30 11:55:46 +08:00
Dudu-0223 11c02855e1 Merge master into subagent runtime stack base 2026-10-29 17:55:40 +08:00
LogosVeritas 74ff76d1ff refactor(sdk): simplify slash command input APIs 2026-10-29 12:33:11 +08:00
LogosVeritas 917cf6c267 fix(sdk): validate command lifecycles and normalize strict input 2026-10-28 21:39:54 +08:00
LogosVeritas 0c78c4c710 fix(sdk): return RunResult after native command activity 2026-10-28 21:14:21 +08:00
LogosVeritas ae334bd17e fix(sdk): align builtin routing and query error handling 2026-10-28 15:54:34 +08:00
LogosVeritas 2b9badbc37 docs(sdk): clarify native command input and ordering
Record empty-input migration and canonical-name limits. Verify strict
alias rejection and command notifications preceding query responses.
2026-10-26 14:41:20 +08:00
LogosVeritas dc311ba744 feat(sdk): route content blocks through native commands
Reuse the existing run input for command images and ordinary queue/steer delivery.
Align Unicode command separators, bound goal observation, preserve plan input encoding,
and handle explicitly expected Windows cancellation disconnects in runtime tests.
2026-10-26 12:23:58 +08:00
LogosVeritas 9c3971618a feat(sdk): support native goal slash commands 2026-10-25 21:55:27 +08:00
LogosVeritas d501108371 feat(sdk): support native plan commands and review dismissal 2026-10-25 21:55:27 +08:00
LogosVeritas 83a0867416 feat(sdk): support session permission commands 2026-10-25 21:55:27 +08:00
LogosVeritas 5cdd2aebed feat(sdk): support compact through unified query input 2026-10-25 21:55:27 +08:00
Dudu-0223 9c406a6325 refactor(subagent): derive membership from existing activations 2026-10-23 17:18:03 +08:00
Dudu-0223 b3d4933f39 refactor(subagent): own live lineage outside core agent registry 2026-10-23 16:07:11 +08:00
Dudu-0223 3dde36b5bb Merge master while preserving subagent lifecycle changes 2026-10-23 15:41:00 +08:00
Dudu-0223 b096659245 fix(session): make ordinary forks independent of source lineage 2026-10-23 14:48:07 +08:00
Dudu-0223 9581e13e78 refactor(subagent): name root wait for tree work 2026-10-22 17:19:33 +08:00
Dudu-0223 16ece34568 Merge master into subagent tree branch 2026-10-22 13:33:16 +08:00
fz 61a5014a74 Merge origin/master into feat/sdk-approval-rpc 2026-10-21 16:05:56 +08:00
fz 800805847d fix(sdk): route approvals by live runtime ownership 2026-10-21 16:03:18 +08:00
_Kerman a9c006f9c3 refactor(agent): own model selection on each agent 2026-10-20 21:09:09 +08:00
_Kerman 8b79a1ddcc Merge origin/master into xtr/session-model-selection 2026-10-20 17:22:59 +08:00
Dudu-0223 3331b91a52 Merge origin/master into refactor/agent-team-named-subagents 2026-10-20 15:10:31 +08:00