* 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
The base bundle mounts the authentication service, so the Plugins page
lists it and verify-locale-metadata requires its title and description in
every shipped language. The package exports and publishes locale/*.json as
its sibling plugin packages do.
The Python SDK runtime deploys an explicit dependency closure. The DeepSeek
routes, the web providers, and the SDK server it ships require the service,
so the closure names it; verify-runtime-closure rejected the manifest
without it.
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.
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.
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.
JobError and TerminalError only need the error base, so dsh-jobs and
dsh-terminal depend on dsh-error instead of the LLM runtime. The Python
SDK runtime closure includes the new package.
Refs #7869
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
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.