Commit Graph
400 Commits
Author SHA1 Message Date
Turtle b908e13271 Merge remote-tracking branch 'origin/master' into turtle/image-cache-stale-0a243f674e12
# Conflicts:
#	packages/api/session-controller/README.i18n.yaml
#	packages/api/session-controller/README.md
#	packages/api/session-controller/README.zh.md
#	packages/client/ui-primitives/README.i18n.yaml
2026-10-22 14:57:42 +08:00
Yichen Jiang dd568f76de Merge remote-tracking branch 'origin/master' into worktree/composer-image-preupload
# Conflicts:
#	packages/test-support/client-runtime/README.i18n.yaml
2026-10-21 23:17:57 +08:00
Turtle 16cf3316e6 Merge remote-tracking branch 'origin/master' into turtle/image-cache-stale-0a243f674e12
# Conflicts:
#	packages/api/session-controller/README.i18n.yaml
#	packages/client/ui-primitives/README.i18n.yaml
2026-10-21 17:58:20 +08:00
Yichen Jiang b22cf68e50 fix(web): explain refused image uploads and tighten image staging
Address the review of this pull request:
- A failed image upload keeps the Host's attachment refusal reason. The
  thumbnail of a refused image names the reason instead of offering a
  retry that cannot succeed, and Enter while uploads hold the send names
  the first failure; a transport failure still offers retry, and an
  image without a file name uses the pending-image label.
- An image upload stops reading at the smaller of the per-image and
  per-message byte limits.
- A carried image draft moving to a Session that sends images inline
  drops its upload instead of staging it again.
- The image upload ready state no longer carries an unread image ref.
- Docs describe stored-image admission and the command image path, and
  the attachment rail test builds typed props instead of casting through
  unknown.
2026-10-21 16:48:01 +08:00
Yichen Jiang a2d35f381a fix(web): bound image receipts by the message limits and cancellation
Prompt admission counted stored images only toward the image count, so
two uploads that each fit alone could exceed maxMessageImageBytes once a
prompt cited both receipts. A staged image now records the byte length
of its upload, and admission counts stored and encoded images together
against both per-message limits before storing anything.

An image upload cancelled after its last chunk, or while its image was
stored, still received a receipt. The upload now checks cancellation
after the read and again before staging, as the file stream path does;
an image whose storage began stays stored, but no receipt is issued.
2026-10-21 15:43:55 +08:00
Yichen Jiang 1b608982cc Merge remote-tracking branch 'origin/master' into worktree/composer-image-preupload
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
#	packages/client/ui-conversation/README.i18n.yaml
2026-10-21 15:02:15 +08:00
_Kerman d6dc8890b9 Merge github/master into xtr/session-store-write-lifecycle 2026-10-21 15:01:22 +08:00
lsdsjyandlsdsjy 0e49f443dd feat(ui-conversation,ui-chat): 基于 user-text 支持富文本引用与草稿恢复 (#3206)
* feat(ui-chat,ui-conversation): 通过通用文本交互支持原文引用

* refactor(message-quotes): 插件化引用交互与文本扫描豁免

* test(message-quotes): 补齐插件装配预期与交互分发覆盖

* refactor(ui-conversation): 移除引用删除文案的语言切换刷新

* refactor(message-quotes): 移除引用扫描豁免并收窄文本交互接口

* fix(ui-chat): 修复引用浮层的滚动遮挡与恢复

* fix(ui-chat): 对齐 master 的聊天流注入与界面快照

* test(message-quotes): 补齐 Host 入口覆盖并固定子会话回放时序

* refactor(message-quotes): 清理文本依赖特例并修正引用按钮

* fix(ui-primitives): 让引用原文弹层按内容收缩

* fix(ui-primitives): 修复相邻引用悬停弹层重叠与误切换

* fix(message-quotes): 为引用悬停样式限定设备能力

---------

Co-authored-by: lsdsjy <[email protected]>
2026-10-21 14:41:41 +08:00
_Kerman 6bfe05c6f5 refactor(agent): name captured step selection modelSelection 2026-10-21 14:08:11 +08:00
Yichen Jiang 9be99a0e28 feat(web): upload composer images when they are added
An ordinary Session's composer now uploads each image draft through the
background upload queue as soon as it is added. The raw upload route stages
the body as a prompt image when the request names its media type: the Host
reads at most the per-image byte limit, then validates, normalizes, and
stores the image as prompt admission would. The prompt cites the receipt in
a file part; prompt admission resolves it to the stored image, applies the
image-input check, and counts stored images toward maxImagesPerMessage.

Send waits for every image receipt, and a failed image upload turns its
thumbnail into a retry control. Commands and subagent continuations keep
encoding images inline.
2026-10-21 13:50:19 +08:00
_Kerman a8013ddc35 Merge remote-tracking branch 'github/master' into xtr/session-store-write-lifecycle
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/persistence-schema.json
2026-10-21 13:45:24 +08:00
_Kerman cdb3a76b6a test(agent): complete model ownership migration coverage 2026-10-21 10:43:20 +08:00
_Kerman 200dedd494 chore: trim unrelated model-selection changes 2026-10-20 22:13:30 +08:00
_Kerman ba50aec4de fix(session): preserve automatic reasoning effort on selection 2026-10-20 21:09:29 +08:00
_Kerman a9c006f9c3 refactor(agent): own model selection on each agent 2026-10-20 21:09:09 +08:00
_Kerman 639602e63a Merge origin/master into xtr/session-model-selection 2026-10-20 20:57:11 +08:00
Turtle aa8bdfc79e Revert "feat(agent): admit Web prompts through the agent controller" 2026-10-20 19:09:02 +08:00
Turtle 450e81bbf3 Merge remote-tracking branch 'origin/master' into turtle/image-cache-stale-0a243f674e12
# Conflicts:
#	packages/client/ui-primitives/README.i18n.yaml
#	packages/client/ui-primitives/README.md
#	packages/client/ui-primitives/README.zh.md
#	packages/client/ui-primitives/tests/markdown-path-images.client.spec.tsx
2026-10-20 18:00:57 +08:00
_Kerman 8b79a1ddcc Merge origin/master into xtr/session-model-selection 2026-10-20 17:22:59 +08:00
_Kerman e7ffab7902 Merge remote-tracking branch 'origin/master' into xtr/session-store-write-lifecycle
# Conflicts:
#	apps/web/tests/new-session-refused.e2e.ts
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
2026-10-20 15:31:09 +08:00
_Kerman cc0e980e48 fix(session): align store-owned writes with lifecycle notifications 2026-10-20 11:33:44 +08:00
Yichen Jiang 43d6585375 refactor(agent-controller): recognize admission refusals by code
AgentAdmissionRejected now extends HarnessError with the fixed code
AGENT_ADMISSION_REJECTED. The Session Remote recognizes a refusal by that
code and imports only agent-controller types, so its mapping also holds for
an error from another copy of the module; its literals are typed by the
agent-controller constants, so a changed value fails the build.
2026-10-20 10:40:31 +08:00
Yichen Jiang 8f487bbb61 test(agent-controller): register session projections before the Agent registry
Master's async activation makes AgentRegistry inject sessionProjections and
makes createSessionTestRemote async. Install SessionProjectionRegistry in the
agent-controller and prompt-admission harnesses and await the test Remote in
the image admission tests.
2026-10-19 22:31:31 +08:00
Yichen Jiang 1d51715aca Merge remote-tracking branch 'origin/master' into worktree/session-agent-controller-refactor-ff892d
# Conflicts:
#	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
#	packages/api/session-controller/README.i18n.yaml
#	packages/api/session-controller/tests/commands-upload-file.host.spec.ts
#	scripts/gen-cordis-catalog.ts
2026-10-19 22:25:55 +08:00
turtle1999 67a4ab78be fix(file-upload): release the Agent resolver when its owner reloads
session-controller registers its resolver through `ctx.fileUploads`. Inside
that call Cordis returns a new proxy for every function-valued property read
from `this`, so the disposer's identity check never matched and the slot was
never cleared. Any restart of session-controller, such as a profile patch that
changes session-query-sqlite, then failed with "Agent resolver is already
registered" and left every sessionController dependent pending.

Store the resolver in a plain holder object, as the commands receipt resolver
already does, and test registration and disposal through a plugin fiber.
2026-10-19 16:59:18 +08:00
Yichen Jiang a472820428 fix(agent): wait for deliveries on disposal and keep image prompts in order
The Agent controller now finishes disposal only after every delivery it
stopped has settled, and a sender that cancels stops waiting at once, also
while its message waits behind a held one; the message keeps its place and
is dropped at its turn.

An image prompt takes the Session's image admission turn when its
preparation starts, in the Agent's delivery order, and keeps it until the
prompt settles. Image and text prompts therefore enter the inbox in arrival
order, and a model selection waits only for the image prompt being
admitted, not for one still queued.

The core page documents the delivery types, and the architecture overview
lists the controller and its admission event.
2026-10-19 16:58:59 +08:00
Yichen Jiang 47d947d8b1 Merge remote-tracking branch 'origin/master' into worktree/session-agent-controller-refactor-ff892d
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	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
2026-10-19 15:07:35 +08:00
_Kerman c18f5bd3c0 Merge remote-tracking branch 'origin/master' into xtr/session-model-selection
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/capability-seams.md
#	docs/capability-seams.zh.md
#	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
#	packages/api/session-controller/src/types.ts
#	packages/bundle/base/package.json
#	packages/bundle/headless/README.i18n.yaml
#	packages/bundle/headless/README.md
#	packages/bundle/headless/README.zh.md
#	packages/bundle/headless/package.json
#	packages/bundle/headless/tsconfig.json
#	packages/subagent/tool-subagent/tests/model-selection-settings.spec.ts
#	scripts/type-equiv.manifest.json
2026-10-19 11:30:55 +08:00
_Kerman 955e600031 Merge master into session projection registration handles 2026-10-19 11:21:16 +08:00
imccyu 6292808bf9 fix(session-controller): keep the list summary contract honest 2026-10-19 10:20:10 +08:00
imccyu f230fc2fc2 refactor(session-projection): review fixes for the summary key set
- Export `ProjectionKeySelection` (the read faces' key selection) and reuse it
  from the projection cache instead of restating the union twice. The Cordis
  catalog can now resolve the type its generated signatures reference.
- Make `wire.summary` a plain boolean: omitted means `true`, and a key whose
  map entry carries the summary mark declares `false` so the runtime key set
  and the client view type agree. The type no longer forbids a declaration.
- Describe the mark accurately: it has no runtime representation; `wire.view`
  and `viewSchema` are typed with `SessionProjectionViewValue`, which strips it,
  so the registration erase only widens the state type.
- Say plainly in the package README, the subsystem page, the client field
  comments, and the Agent Note that a list row carries the summary projection
  and never the full projection: a connected Session's store may hold more
  values, but those are outside the list contract.
- Document the summary vocabulary on the subsystem page with `ts type-equiv`
  blocks for the mark, its stripping, the excluded-key test, the summary value
  type, and the key selection; split the prose paragraph.
- Revert the behavior-neutral cache-double refactors in three specs, and record
  in the Agent Note why no upgrade guide accompanies the wire change and how a
  consumer migrates.
2026-10-19 01:13:24 +08:00
imccyu 8e2dd67de8 perf(session-controller): exclude the shared image limits from session summaries
`imageLimits` is a boot constant every Session shares: the unit stores no
per-Session state (`stateSchema: z.null()`, `apply: state => state`) and its
view returns `ctx.attachments.imageLimits`. A list row therefore repeated one
host-wide capability fact on every row. It now carries the summary mark like
the three log-derived units, so a summary read skips it while an opened Session
still receives it through `session/follow`, the control baseline, and
`session.projections`.

No other logic changes: the registration, its schema, its constant view, and
the host-side prompt validation keep reading `ctx.attachments` directly.
2026-10-18 23:04:29 +08:00
imccyu 92f9e79fac perf(session-projection): serve session-list rows from a summary key set
A Session-list row no longer carries every registered client view: the three
units whose values a list row never renders (`turnOutline`, `sessionStats`,
and `todos`) are excluded, which removes the whole-log turn outline and the
figure and todo payloads from every row. An opened Session is unchanged —
`session/follow`, the `session/control` baseline, and `session.projections`
still serve every projected key.

The exclusion is one type-level mark plus one registration interlock:
`SessionProjectionSummaryExcluded<T>` marks a map entry, and
`ProjectionDefinition.wire` requires `summary: false` exactly on a marked key
and rejects it everywhere else, so the mark and the declaration cannot drift.
A nullable entry keeps `null` outside the wrapper, so `todos` stays
`TodoItem[] | null`. `summaryKeys()` returns the derived set, stable until a
registration or its disposal changes the key table, and the existing
key-taking read faces (`cachedSnapshot`, `viewCheckpoint`) accept that set
directly, so summaries need no separate read face and no per-read key copy.
`packages/api/session-controller/src/list.ts` passes the set to the live and
cold cached faces; `cachedPredecessorTitle` is untouched.

Client types only: `SessionSummary.projectionValues` narrows to
`SessionProjectionSummaryValues`, `SessionProjectionSnapshot.values` keeps
every view value with the mark stripped, and no wire field or client name
changed. The cache, subsystem page, and package README document the summary
rule and the two read faces.
2026-10-18 22:13:18 +08:00
Turtle ef0a2b2e3d Merge remote-tracking branch 'origin/master' into turtle/image-cache-stale-0a243f674e12
# Conflicts:
#	packages/client/ui-primitives/README.i18n.yaml
#	packages/client/ui-primitives/README.md
#	packages/client/ui-primitives/README.zh.md
2026-10-18 14:49:15 +08:00
Yichen Jiang f34eaf7601 feat(agent): admit Web prompts through the agent controller
Add @deepseek-ai/dsh-agent-controller, composed in the base bundle, as the
entry through which a sender delivers a message from outside an Agent into
its inbox. deliver() runs the sender's content preparation in the Agent's
delivery order, asks the agent-controller/admission waterfall for a
decision, rechecks cancellation and registration, and appends the message
with followup() or steer(). dsh-agent and agent-loop are unchanged.

The Web session/prompt Remote delivers through it: the image model check,
upload receipt resolution, and attachment storage run as prepare, the
receipt binding runs as beforeInsert, and refusals map to
session/prompt-rejected. The Web client keeps its existing echo.

This replaces the Host half of deepseek-harness/deepseek-harness#6178,
whose admission stage lived in dsh-agent.
2026-10-17 17:09:29 +08:00
_Kerman 7b112942ab refactor(agent-model): move Session model selection into its own package
Add @deepseek-ai/dsh-agent-model. It provides ctx.agentModel
(resolveForNextStep, select, applyConfiguredRoute) and owns the
modelSelection projection, which the Agent registry no longer registers.
dsh-agent-loop now injects agentModel; the base and SDK-minimal bundles
and the Python SDK runtime include it.

The provider keeps the projection registered until consumers that are
still unloading finish their cleanup. The model-switch notice becomes an
opt-in per-Agent plugin at @deepseek-ai/dsh-agent-model/notice, and
agent/request now also rejects reasoning-effort changes after step
preparation.

Mount the provider in every composition that loads dsh-agent-loop, and
update consumers, the switch-notice snapshot driver, docs, and the
upgrade guide.
2026-10-16 15:28:59 +08:00
_Kerman ff731c72de refactor(session-projection): remove the host state map 2026-10-15 21:01:00 +08:00
_Kerman 8151a0271d fix(agent): persist explicit choices matching deployment defaults 2026-10-15 20:21:35 +08:00
_Kerman e39b5f58c2 refactor(agent): persist model selection in session state 2026-10-15 19:05:09 +08:00
_Kerman 90014a7508 Merge remote-tracking branch 'origin/master' into xtr/session-projection-registration-handles
# Conflicts:
#	docs/tool-catalog.i18n.yaml
2026-10-15 18:26:22 +08:00
_Kerman c3efd4bff8 refactor(session-projection): keep state reads inside owning services 2026-10-15 18:18:58 +08:00
imccyu 10672c4c24 Integrate Peer interaction scope with Remote access 2026-10-14 14:44:01 +08:00
_Kerman 307d63792e Merge remote-tracking branch 'origin/master' into xtr/session-projection-registration-handles
# Conflicts:
#	benchmarks/session-corpus/projection-list.worker.ts
#	benchmarks/session-corpus/session-corpus.worker.ts
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	packages/api/session-controller/README.i18n.yaml
#	packages/api/session-controller/src/index.ts
#	packages/api/session-controller/tests/list-scheduling.host.spec.ts
#	packages/client/ui-chat/README.i18n.yaml
#	packages/client/ui-chat/README.md
#	packages/client/ui-chat/README.zh.md
#	packages/client/ui-chat/src/client/chat/use-chat-viewport.ts
#	packages/experimental/client-ui-cot-translation/tests/activation.host.spec.ts
2026-10-14 11:12:24 +08:00
imccyu a4426261ab fix(ui-chat): fold next-message work details on one frame clock
Folding on the next message reserved the whole closing height as bottom
room and kept scrollTop whenever the input had no transcript echo on this
page: a message from another tab, a queued message delivered after the
previous Turn, or a send from a subagent child in the right Sidebar. A
reader below the fold was left on an empty viewport.

Every batch of closing rows now runs on the viewport's frame-clock driver.
It lands at the tail for this client's own input or a following reader and
otherwise keeps the reader's content still, installing only the room the
landing lacks. Subagent child sends register a local echo and pass its
request id to subagents.prompt, so the child's recorded message retires it.
2026-10-14 00:31:59 +08:00
imccyu 529706d163 fix(remote-access): drop buffered events on revoke, filter search, declare workspace file resources 2026-10-13 23:55:05 +08:00
imccyu 2640d3df82 feat(api): resolve endpoint resources and filter lists by access 2026-10-13 23:01:38 +08:00
imccyu d6e408d957 feat(session-controller): record non-owner principals on user message sources 2026-10-13 23:01:37 +08:00
_Kerman f8a84280aa Merge remote-tracking branch 'origin/master' into xtr/session-projection-registration-handles 2026-10-13 11:27:47 +08:00
Turtle f34e5cc59b Merge pull request #5938 from deepseek-harness/fix/persistence-disposal-order
fix(session): retain JSONL resources through provider-triggered teardown
2026-10-12 14:14:36 +08:00
_Kerman 2bdbdb4ae9 merge: integrate latest master with projection registration handles 2026-10-12 12:51:32 +08:00