Commit Graph
400 Commits
Author SHA1 Message Date
LegGasai e24af31773 Merge remote-tracking branch 'origin/master' into feat/session-workspace-root-consumers 2026-11-18 11:46:53 +08:00
imccyu 7e7b604620 feat(client): retain recent sessions and skip conversation folding while unrendered (#8502)
* feat(client): retain recent sessions and skip conversation folding while unrendered

* docs(notes): state that attention-protected recent views are unbounded

* refactor(ui-workspace): derive recent views from visit order and make the limit configurable

Recent views now hold exactly the Sessions one idempotent sync() selects from
the visit order and current snapshots, so navigation reports the shown Session
once and the main-view Session never counts. A failed Conversation resumption
leaves the binding stale so the next window change rebuilds the whole window.

* refactor(session-controller): report facet counts through retainInfo instead of SessionBinding

SessionBinding stays unchanged; SessionRetainInfo gains optional retainedFacets
counts beside retainedBy, and owners derive their facet from retainInfo and the
current binding. Adds the upgrade guide for Client plugins that render a Session
they retain, and updates two web e2e expectations: a recently viewed Session now
keeps its right Sidebar view state when the main view returns to it.

* feat(client): keep drafts with a connectionless Session hold and fold only the last page on return

Session references gain connection (true by default). When no reference keeps
it, the Session disconnects and empties its window while keeping its scope.
When the last facet is released, the Session keeps only its last Turn-aligned
page visible and its event stream buffers the older records, answering page
reads from that buffer before the Host. BoundConversation folds only while the
conversation facet is retained and drops its fold on release. The input hub
holds a Session with { source: 'draft', connection: false } while its draft has
attachments, replacing the root-level draft-attachment ownership; reload marks
remain.

* refactor(session-controller): share retain-info counting with the test fixture

* fix(client): keep gap repair, disconnect, and recent-view counting correct while Sessions are buffered

- Only page reads before the window take buffered records; a live gap repair
  reads the Host.
- A resync whose teardown a disconnect interrupted stays cold.
- A Session the main view already retains takes no recent-view slot before
  show(), so losing its unread protection during retention evicts nothing.
- Buffering marks the window partial, so the start-of-history marker survives
  after the buffer runs out.

* fix(session-controller): consume an arrived older page before buffering the window

* feat(ui-workspace): sync the recent-view limit from the Host Config

recentViewLimit becomes a volatile field of the ui-workspace Host Config
(z.natural().default(10)). The browser receives it through synced plugin
configuration, and RecentSessionViews reconciles whenever it changes, so a
cordis.yml edit takes effect without a page reload. Until a value arrives,
every counted recent view is kept.

The package gains a Host compiler face: src/types.ts holds the shared
Config type, tsconfig.host.json and tsconfig.client.json replace the single
Client config, and every reference names the face it compiles against.
2026-11-17 20:51:42 +08:00
imccyu fff31dd57b fix(session-controller): consume an arrived older page before buffering the window 2026-11-17 20:01:33 +08:00
imccyu 24df14af28 fix(client): keep gap repair, disconnect, and recent-view counting correct while Sessions are buffered
- Only page reads before the window take buffered records; a live gap repair
  reads the Host.
- A resync whose teardown a disconnect interrupted stays cold.
- A Session the main view already retains takes no recent-view slot before
  show(), so losing its unread protection during retention evicts nothing.
- Buffering marks the window partial, so the start-of-history marker survives
  after the buffer runs out.
2026-11-17 20:01:33 +08:00
imccyu 33bf943702 refactor(session-controller): share retain-info counting with the test fixture 2026-11-17 20:01:33 +08:00
imccyu 4b01a4afda feat(client): keep drafts with a connectionless Session hold and fold only the last page on return
Session references gain connection (true by default). When no reference keeps
it, the Session disconnects and empties its window while keeping its scope.
When the last facet is released, the Session keeps only its last Turn-aligned
page visible and its event stream buffers the older records, answering page
reads from that buffer before the Host. BoundConversation folds only while the
conversation facet is retained and drops its fold on release. The input hub
holds a Session with { source: 'draft', connection: false } while its draft has
attachments, replacing the root-level draft-attachment ownership; reload marks
remain.
2026-11-17 20:01:31 +08:00
imccyu bf58ff25f4 refactor(session-controller): report facet counts through retainInfo instead of SessionBinding
SessionBinding stays unchanged; SessionRetainInfo gains optional retainedFacets
counts beside retainedBy, and owners derive their facet from retainInfo and the
current binding. Adds the upgrade guide for Client plugins that render a Session
they retain, and updates two web e2e expectations: a recently viewed Session now
keeps its right Sidebar view state when the main view returns to it.
2026-11-17 20:00:26 +08:00
imccyu 4f9ee56b8a feat(client): retain recent sessions and skip conversation folding while unrendered 2026-11-17 20:00:25 +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
Kexin Liu e50e24de40 feat(session): 等父前缀持久化后创建共享 fork (#8392)
* test(session): cover SQLite persistence and document the provider

* test(session): align coverage with the latest SQLite implementation

* test(session): adapt storage coverage to the current SQLite backend

* feat(session)!: pass fork source through agent creation

* refactor: prepare forks privately and append child segment events

* refactor: choose fork sharing in SQLite creation transaction

* fix(session): preserve caller-prepared fork seeds

* feat(session): flush fixed fork prefix before child creation

* fix(session): persist fork sources and await parent drain

* chore: remove test and documentation changes from fork PR

* refactor(agent-loop): reuse agent fork source type

* fix(session): retain SQLite handle and JSONL errors after rebase

* perf(session): create forks from the caller's history without reloading the parent

The fork source carries the complete child history from seq 0. A live
parent's log supplies the shared prefix; a cold parent's prefix is used as
persistence returned it to the caller. The factory no longer reopens the
parent, and the JSONL backend copies the supplied history instead of
decoding the parent log again. The SQLite backend drains a live parent
writer before sharing its persisted prefix, so the factory no longer flushes
the parent or tracks owner disposal during that wait; its fork creation
serializes child events without the read-side validation and reports
publication failures through the shared wrapper.

* refactor(session-query): report the persisted prefix length on live observations

A live observation reports its event count as the persisted prefix, so the
fork command's boundary fallback only covers observations from other
producers.

* test(session): exclude the SQLite POSIX lease from Windows coverage

The SQLite copy of the session write lease executes its POSIX face only off
Windows, matching the JSONL exclusion.

* test(session): report legacy opener failures on stderr

The two-process suite asserts only the error name; the message and cause now
reach the inherited stderr so a CI failure identifies the SQLite error.

* refactor(agent): keep seed as the constructor input and narrow the fork source

CreateAgentOptions.seed stays the only constructor history; source names the
parent and cut a seeded fork shares. The factory stores the constructed log
with that source at creation, so no fork-only seed selection remains in the
loop.

* test(session): complete fork regressions and documentation

* test(session): propagate current SQLite fixtures through fork regressions

* test(session): describe fork creation from the caller's history

The fork source now carries the complete child history and the factory no
longer reopens or flushes the parent, so the fake factories, source
expectations, and cancellation cases follow that flow: a sharing backend
drains the parent writer itself, JSONL copies the supplied history, and
observations always report the persisted prefix. Documentation, the upgrade
guide, and the generated catalogs describe the same behavior.

* test(session): cover fork creation without a factory flush

The in-process fork provider's cases no longer wait for a parent flush: the
live log supplies the completed prefix and cancellation is exercised while
child storage is pending. The Remote fork command's boundary fallback is
covered by an observation that omits its persisted count.

* test(session): drop redundant observation assertions in the fork fallback case

* test(session): describe fork creation with seed beside a parent source

The agent factory keeps seed as the constructor history and source names
only the parent and cut, so the fakes, source expectations, and documentation
follow that split; the case where a live parent replaced the supplied prefix
no longer applies.

* refactor(session): name the fork parent option parentSource

`CreateAgentOptions.source` and `SessionPersistenceCreateOptions.source`
become `parentSource`: the field names the parent Session a seeded fork
shares its prefix with, and the shorter name read as a generic origin.

* refactor(session-query): report persistedEventCount on cold observations only

A live observation holds the Session's own events, none of them read-time
repairs, so its stored prefix is its whole log and the field said nothing;
only a cold read appends interrupted-turn closers in memory and needs to
tell the fork cut where the stored prefix ends.
2026-11-17 17:28:59 +08:00
LegGasai 7f7033b9a4 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers 2026-11-16 22:43:54 +08:00
LegGasai 5dfdf834d7 fix(session-controller): adopt a named Session requested through a symlinked directory
`session.create` records the canonical spelling of the project directory in the
Session header, and compared a later request's own spelling with it. A second
request for the same explicit Session id through a symlinked path, such as a
macOS temporary directory, failed with `session/conflict`.

The check now accepts the recorded spelling or one whose canonical form the
header records. The ACP image-offload expectation compares the model-visible
directory with the canonical spelling of the scenario directory.
2026-11-16 22:43:00 +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 23734da2b6 Merge remote-tracking branch 'origin/master' into feat/session-workspace-root
master moved the `workingDirectory` projection-key declaration to
`src/types.ts`; this branch's `workspaceRoot` key follows it there. The three
recorded scenarios master added (`session-list-tools`,
`computer-use-cua-driver-mcp-ptc`, `sdk/subagent-dsh-sdk-empty-route`) drop the
removed `working_directory` tool and the delegation `cwd` parameter from their
sidecars.
2026-11-16 17:59:21 +08:00
Dudu-0223 a977522f4e Merge remote-tracking branch 'origin/master' into pr8238-review
# 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
#	docs/tool-catalog.i18n.yaml
#	packages/api/session-controller/tests/listeners.host.spec.ts
#	packages/api/session-controller/tests/state-controller.host.spec.ts
#	packages/api/session-controller/tests/transport.host.spec.ts
#	scripts/product-package-policy.ts
2026-11-16 12:34:08 +08:00
Dudu-0223 79015b174c refactor(session): move list metadata to sessionQuery and query Workspace headers
Address review on #8238:

- Replace the Workspace.sessionHeaders property with getSessionHeaders(). The
  public contract states only membership and order; the in-memory header index
  is documented on the implementation.
- SessionQueryEngine now injects sessionProjections, registers the
  sessionListMetadata projection in Service.init, and exposes
  getListMetadata(session). Disposing the service releases the registration.
  The Session API and list_session read metadata through ctx.sessionQuery;
  registerSessionListMetadata and the passed reader closure are removed.
- SqliteSessionQueryEngine injects sessionProjections and chains Service.init.
- Tests: a newly attached Session appears in a later getSessionHeaders()
  result; query-service disposal removes the projection; test query services
  run Service.init; projection-order expectations follow the new registration
  order.
2026-11-16 11:59:34 +08:00
Xu HanxiangandDeepSeek Harness da7f9b4c5a feat(liveshare): open the viewer capabilities a share can serve (#8304)
* feat(liveshare): open reader capabilities the share can serve

(cherry picked from commit 3c893b488900fff776a21eebee4eb2d95b878764)

* feat(liveshare): let a reader run the session's slash commands

(cherry picked from commit ae02bcc0f819e55ebf066de7581d4d89994930a4)

* fix(liveshare): allow a reader to list the workspace file references

(cherry picked from commit fffaa864b9d790a0aab30da639d5ef50ff8f303c)

* fix(liveshare): bind the job endpoints to their session resource

(cherry picked from commit 357d1f6efe5b161a4ce1b616e66599c4e75a6ab1)

* chore: refresh the Cordis surface catalog

(cherry picked from commit 88f88b225f0fcff0a5a88f09b0f555749dd62756)

* test(job-controller): read the Session resources the Remote methods declare

The job roster, the follow stream, and a kill each declare the request's
Session as the resource they touch, and an unowned job's follow names none.
Read those declarations off the mounted Controller and pin what they answer.

(cherry picked from commit fa3f92427a6bd56ad2a949dc74315505cb75533b)

* feat(liveshare): offer a shareable core component to viewers

The terminal controller reaches the catalog from a core profile bundle, which
the catalog excludes so no application plumbing is offered. Mark such a
component shareable: PluginMetadata gains the mark, and the host names the
packages that carry it, so a marked core component enters the catalog and
every other core component stays out.

The terminal namespace leaves the exclusion list for the same reason, and
the marked component carries the title its dialog row shows.

(cherry picked from commit b0e9e390719aab519fd82cf39c85c60e4f77b588)

* fix(liveshare): classify the terminal methods as owner-selected

The nine terminal methods leave owner-only for plugin-offered: the owner picks
them in the share dialog, no reader role grants one, and a share that names
none still refuses every terminal call.

(cherry picked from commit 718c1b45a1b01320cbe9be46ece9deca37225fe2)

* docs(liveshare): state that terminals open per method

Terminals are no longer unconditionally owner-only: the share dialog offers
the terminal controller's methods and opens none until the owner picks them.

(cherry picked from commit 505c1193571b16431731f69bd5ca1b59a1059a13)

* test(liveshare): cover a viewer reaching the Session's terminals

The end-to-end case mounts a real terminal controller beside the share host:
the catalog offers it as a shareable core component, a share that selects
nothing refuses every terminal call, and a selected terminal/create through
the reader's own Peer binds the shell to the Session its agentId names.

(cherry picked from commit 25955a936dc5b58ebfd8e1d24f495d62d59f7b70)

* fix(workspace-files): confine non-owner reads to the session workspace

A non-owner Peer now reads and watches files only inside the connected Session workspace. stat, read, readBytes (including baseFile) and changes resolve the target canonically and refuse an outside one with workspace-file/outside-workspace before reporting its kind. Owner and trusted in-process callers keep the filesystem read authority.

(cherry picked from commit 7ae855e12ba6c5bc99c7ae75d65d984661f3bbb5)

* refactor(workspace-files): name the file access confinement

Replace the contain boolean with a named FileConfinement carried by the service, and move the outside-workspace refusal into one helper shared by file reads and watches. No Remote interface or behavior changes.

(cherry picked from commit 1c4dbd68220df7c559f84cf2782f9626c5b2ef4b)

* refactor(workspace-files): name the path mode PathScope

Replace the FileConfinement/confinement vocabulary with PathScope, and rename its module and test. The values and behavior are unchanged.

# Conflicts:
#	packages/api/workspace-files/src/index.ts
#	packages/api/workspace-files/tsconfig.host.json

(cherry picked from commit 5d3f7b31dc6a1dbcf44c5fdd59295402bf40cf76)

* refactor(workspace-files): accept several workspace roots in the path check

The confinement helper and change feed now take several resolved roots; the current scope still supplies one. WorkspaceFileScope.workspaceRoot remains the primary root, so a future multi-workspace Session can add optional roots without changing endpoint signatures, path arguments, or the client address.

(cherry picked from commit 73fd59be92c421c378b7fe5606d8d7c5806b13cb)

* fix(workspace-files): keep the multi-root watch check covered

Pass the primary watch root separately and iterate the roots list, so the feed keeps full coverage for the multi-root preparation. Add braces to the multi-root test arrow for the lint rule.

(cherry picked from commit 1286aac6a6d93e693dbb33f2feaa71e6252424e0)

* test(workspace-files): assert a refusal never reports the target kind

The outside-workspace failure carries only the path, so a share reader learns
nothing about what it was refused. stat, read, readBytes, list, and a relative
escape are each asserted not to carry a kind.

(cherry picked from commit a9495de0ff63a1aac325d1cb62b8111c188ae8a5)

* test(workspace-files): keep the search caps in the shared harness config

Rebasing over the search endpoint left configOf() without the search limits
the master harness passed inline, so every search call reached the subprocess
provider with an undefined graceMs. configOf and peer() now take Caps and
supply the suite defaults.

(cherry picked from commit 70cecb9b352ce5c1e17482429b1539483e101d60)

* docs(workspace-files): describe the read confinement against the search-era structure

The master README added the search section and rewrote the file-read checks
without a workspace-containment check. Those paragraphs now state which
caller the check applies to, the change feed mentions the non-owner watch,
and the source map lists path-scope.ts. Bilingual hashes re-recorded with
verify-translation-pairing --write.

(cherry picked from commit e61fdabaf2fb9b0c0bc507ef5ceea0f213f70683)

* fix(liveshare): keep workspaceFiles/search in the reader session-read role

The classification table is the single source for POLICY_DECIDED_ACTIONS, so
the new search endpoint must also appear in the read role's actions.

(cherry picked from commit 665093b07cfee87be105fdc71a7d58fe25974788)

* docs(catalog): regenerate the client and config catalogs

Removing the viewer share-path tab drops its client slot entry, and the workspace file import shifts the Config source line.

(cherry picked from commit 7bb9295a18b011971b4338171a60d16ff82eebd1)

* docs(catalog): regenerate the config catalog source line

(cherry picked from commit 2d98a59afc8aa6e2a9ac268d4446bcd8cd5eeb26)

* fix(liveshare): let share readers preview workspace files

The served page keeps the shipped Sidebar and now reads the shared Session
workspace through workspaceFiles: stat, read, readBytes, list and changes join
the Session read role, while the file service confines every non-owner read to
that workspace root. The viewer tab type that answered each file address with
"a share hands over paths, not contents" is removed, so the shipped document
preview opens the file.

Refs #7901

(cherry picked from 5e0ceac3faa)(partial: liveshare files only)

* fix(ui-jobs): offer the stop control only with job/kill access

(cherry picked from commit 804956ece9c09b2fac6180cd78da7aa7393ae0de)

* fix(ui-chat): attribute a reader's steering row while it is pending

Chat declared the message-source seat on the user node registration, so an
admitted steering row rendered the shared bubble without asking for it and
a Host-pending steering occurrence carried no source to ask with. Move the
seat to the flow: it renders user rows, admitted steering rows, and pending
steering occurrences, and hands the same renderer to each.

Liveshare's selector now elects a share-viewer source of either kind, so a
reader's interjection states its author from the moment it is sent.

(cherry picked from c802aef8392)(partial: liveshare client files only)

* docs(liveshare): state when a reader's interjection shows its author

A local submission echo carries no source, so the author line appears once the
Host records the input in the Inbox, not when the reader sends it.

(cherry picked from 42001b1294d)(partial: liveshare client files only)

* docs(liveshare): describe the seat source arriving as row props

(cherry picked from commit 466e25328c5c42c792bfb30bba05ff790259bf99)

* fix(liveshare): refuse /permission to share readers

The commands executor runs a command handler inside the owner Host with no
reader-specific narrowing, so a reader line such as
`/permission danger-full-access` left the shared Session unconfined with no
approval. The read role's condition now parses the `commands/execute` line
and refuses the owner-only command names, starting with `/permission`, with
the new `command-owner-only` reason the viewer page classifies. Every other
command keeps following visibility.

* feat(permission-presets): add the permissionPresets/set Remote

The `/permission` command switches a Session's sandbox mode and approval
policy inside the owner Host's own handler, which gives a share reader that
reaches `commands/execute` no endpoint decision to meet. The switch now has
a Remote face: `permissionPresets/set` names the Session it writes as its
`session` resource, so the Gateway decides who may call it before any preset
is resolved or any knob changes.

The request carries the Session id and the preset name only. An unknown
preset and a Session this process does not hold live both refuse with
`gateway/bad-request` before writing. The call reports the selection the
Session reads back after the switch.

The command reaches the same switch, keeping its ordering and its `success`
and `error` text. Because a Remote parameter cannot carry an Agent, the
command supplies the approval write itself so its model-visible policy
notice still follows the switch.

Co-Authored-By: DeepSeek Harness <[email protected]>

* fix(liveshare): classify permissionPresets/set owner-only

The new preset endpoint writes the source Session's sandbox mode and approval
policy, so no share reader role may reach it at any tier. The viewer endpoint
classification records it as owner-only, and the viewer access policy spec
proves a reader is refused on the shared Session, on its own forks, and on a
Session outside the share, and that no reader grant carries the action.

The owner-only command whitelist stays as the second defense: the commands
handler runs inside the owner Host, so a reader line must not depend on that
handler continuing to route through the endpoint.

Co-Authored-By: DeepSeek Harness <[email protected]>

* test(liveshare): keep every permission preset endpoint owner-only

The classification table's completeness gate proves a new generated endpoint
has a row, but not that the row keeps a reader out. This case reads the table
and fails when any `permissionPresets/*` endpoint is classified as anything
other than owner-only, so an endpoint added there without its class checked
turns the suite red instead of widening a reader's reach.

Co-Authored-By: DeepSeek Harness <[email protected]>

* docs(catalog): regenerate for the preset set Remote

The new `permissionPresets/set` Remote adds its signature and its request type
to the generated service and type catalogs, maps the request type to the
permission presets subsystem page, and shifts the permission preset config
source line. The permission presets subsystem pages describe the write path
and its Remote face on both sides.

Co-Authored-By: DeepSeek Harness <[email protected]>

* test: construct SessionId values and keep the approval notice lock

The rebased specs called SessionId as a value while importing it as a
type, so every case threw ReferenceError. Construct the ids the way the
packages already do, and keep the /permission case that locks the single
model-visible approval notice.

* test(liveshare): load the terminal controller without a built artifact

The spec resolved a generated typert artifact at module load, so a clean
checkout failed before any case ran.

* docs(liveshare): state the reader limits the review asked about

Marks the answer path's dependence on timed asks, records that @ mentions
list every host session, and explains which commands stay owner-only.

* feat(liveshare): let a viewer manage the goal of a visible Session

The goal is Session data, not the workspace sandbox, so the same visibility
rule that already covers goals/get and goals/edit applies to create, pause,
resume, complete and clear. The /goal command reaches the same service, so
the endpoint and the command now agree.

# Conflicts:
#	packages/experimental/liveshare/README.i18n.yaml

* fix(liveshare): keep the terminal component titles

The shareable mark's localized titles were spread onto the metadata record, which
put `en` and `zh` at the top level instead of in the `titles` field the catalog
reads. A core bundle without display metadata therefore offered the terminal
with no product name at all.

* fix(workspace-files): decide the path scope before stat

A non-owner read probed the path with `lstat` before it checked containment, so
reading an absent path outside the workspace answered `not-found` while an
existing one answered `outside-workspace`. That let a share reader probe whether
any path on the owner's machine exists.

Every confined read now resolves and confines its target first: `read`, `stat`,
`readBytes` (including a path relative to a base file) and `list`. The final
`lstat` still reports the component's own kind, and the owner keeps the
filesystem's authority, including its previous answer for an absent path.

* docs(liveshare): drop the queue-verb mention

`session/updateQueue` is not in the viewer Session read role, and viewer queue
management is not part of this change. The role's rationale now names the
reach it actually carries, and the workspace file actions no longer leak
whether a path outside the workspace exists.

* test(liveshare): describe the terminal suite's actual coverage

* chore: regenerate the catalogs the viewer capability change moves

session-reference, user-questions and the permission presets all feed the
Cordis, persistence and doc-graph generators, so their artifacts were stale.

* fix(liveshare): keep the command refusal copy paired and cover the file paths

The English notice read "/permission on", which the locale gate tokenised
together while the translations kept the command alone. The workspace-file
and preset paths the coverage lane flagged now have cases of their own.

* test(workspace-files): accept either refusal code for a UNC base

Windows resolves an unreachable UNC host through the local backend's ancestor
walk, which reports an IO failure instead of the not-found POSIX reads. Both
refuse the read; the code belongs to that backend, not to the path-scope
decision this case covers.

* refactor(liveshare): leave the command surface to its own change

Running a slash command is a separate decision from what a reader may read:
the executor wraps several capabilities in one opaque call, so the endpoint
that admits it is not the place to decide them. This change keeps the reader
capabilities and the preset endpoint, and returns the command wiring when the
command surface itself is reshaped.

* refactor(liveshare): leave the workspace file preview and terminal grant out

Reading a Session's data and reaching into the owner's workspace or shell are
different promises: the first follows visibility, the second changes what the
owner's machine does. This change keeps the reader capabilities that describe
Session data and returns the other two for their own discussion.

* refactor(jobs): let the session resolver name the job endpoints' Session

The session resource resolver already reads a top-level sessionId, so the
explicit readers restated what it derives. Removing them keeps one rule for
how a Session resource is named.

* test(liveshare): drop the workspace preview stubs the strip left behind

The viewer shell no longer opens workspace files, so the fixture route and
the assertion about it no longer describe anything.

* fix(jobs): bind the job endpoints to the Session they name

The session resolver reads a top-level sessionId, but these methods take a
request object and no lookup parameter, so the request fell through to the
global resource and a reader was refused. The explicit readers state the
Session the Gateway must authorise.

* refactor(jobs): let the session resolver name the job endpoints' Session

The session controller's resolver already reads the sessionId of the first
object argument, so an explicit reader on these methods restated a rule the
Gateway already applies. The tests now install the session controller and
assert the resource the production composition produces.

* refactor(session-controller): take the resolve input as one argument

An exported function cannot destructure its parameters, because the JSDoc
gate names them one by one.

* docs(liveshare): describe the capabilities this change actually opens

The workspace file preview, the terminal grant and the command surface
moved out of this change, so the package reference and the PR description
now state what remains.

* docs(persistence): refresh the catalog after the preset JSDoc edit

The permission-presets module doc grew a line, so the recorded source
line for its persisted event moved from 60 to 61.

---------

Co-authored-by: DeepSeek Harness <[email protected]>
2026-11-14 15:41:52 +00: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
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
a39d44b5dc feat(session): add host reading status to SessionStatus (#6858)
* ✨ feat(session): persist and synchronize read state

* 🌐 fix(client): complete Japanese labels after base update

* 📝 docs: refresh session read-state dependency graph

* 🧪 test(web): align session menu and read-state snapshots

* 🌐 fix(session): complete Japanese plugin metadata

* 🧪 test(web): distinguish unread from pending user input

* 🐛 修复会话阅读状态的故障隔离与生命周期

* 🐛 修复阅读状态依赖检查并补齐自动已读覆盖

* 🐛 恢复会话绿点并移除未读标题加粗

* ♻️ Keep shared session reading state in Host memory

* 🌐 Complete reading-state metadata for supported locales

* 📝 Refresh module graph after removing storage dependency

* 🧹 Move storage dependency policy out of memory-only reading

* 🐛 Wait for sidebar catalog before replay navigation

* 🔧 Give Host TypeScript checks 8 GiB of heap

* ✅ Align Host heap checks and Windows diagnostics

* ♻️ Keep CI repairs outside the session reading PR

* 🐛 Show failed unread turns with an error indicator

* 🔧 Adjust npm layout budget for the reading package

* 🧪 Scope projection stream assertions to observed units

* 🧪 Scope permission and title assertions to their projections

* ♻️ Simplify session reading updates to explicit positions

* 🐛 Align session reading package with release version

* 🧪 Load reading state in LiveShare viewer fixtures

* 🧹 Remove persistence-only type link from memory PR

* 🧪 Align context menu expectations with reading actions

* 🐛 Sync reading package with the release version

* 🧪 Include turn boundaries in session summary expectations

* ♻️ Derive reading failure facts from Host events instead of a projection

The reading service took each completion from the Agent turn-boundary
projection, which forced a stateVersion bump and put that projection's whole
internal state on the wire for every Session list row. The service now records
`turn/end` itself, so `core/agent` and the persisted projection schema are
untouched.

History that ended before the service started raises no reminder, which keeps
"existing history reads as read" without a startup scan. The failure flag
therefore describes only turns this Host observed: marking a Session whose last
turn failed before a restart shows the ordinary unread reminder.

* 🐛 Preserve manual unread until explicit Session interaction

* 🧪 Align cold Session reading snapshot with unloaded title

* 🔖 chore(session): align session-read-state with 0.2.2-rc.2

Master moved the root and every released manifest to 0.2.2-rc.2, but the
new dsh-session-read-state package still declared 0.2.2-rc.1, failing
constraints, verify-version-sync, verify-npm-install-layout, and
release:verify after the master merge.

* ♻️ refactor(gateway): recognize Remote stream carrier loss by error code

RemoteStream now decides whether a generation end or failure is a
retryable carrier loss by the stable code 'gateway/carrier-lost' instead
of `instanceof RemoteStreamCarrierError`. RemoteStreamCarrierError keeps
working and carries that code, so existing callers are unchanged, while a
Client feature package can return a coded Error from `ended` without
importing the class. The new RemoteStreamCarrierFailure type describes
such errors; terminal-controller classifies disconnects the same way.

* ♻️ refactor(session): move Session reading into ui-session-status

Fold the reading feature into the single package
packages/client/ui-session-status and delete session-read-state.

- Host face: SessionStatusService keeps in-memory reading records and
  serves the sessionStatus Remote namespace (mark, follow) with
  session-status/* error codes; its service key is registered only for
  Gateway discovery and is not declared on Context.
- Client face: a package-internal reading model follows the Host stream
  through RemoteSnapshotStream; ctx.uiSession.sessionStatus folds the
  records into completionUnread and completionFailed and exposes mark and
  readingReady; main-view acknowledgement and the
  session-status/read-intent event live here. No reading service or type
  is exported.
- verify-client-packages lets a packages/client feature package request
  packages/api rows through dsh.client.external; feature-to-feature
  requests stay rejected.
- ui-workspace, ui-conversation, bundles, remotes, LiveShare, the client
  test runtime, docs, Agent Notes, and the upgrade guide follow.

* ♻️ refactor(session): clear manual unread only when the main view switches to the Session

Remove the session-status/read-intent event. ui-session-status now clears an
existing manual unread mark when the main view switches to a different
Session, including the first selection after a page load, once the reading
baseline is ready and the body arrives. Window focus, visibility changes,
a replaced binding for the same Session, and activity in the open Session
preserve manual unread.

ui-conversation returns to master (only the ui-session-status client
tsconfig reference remains), and ui-workspace navigation no longer emits
the event. Tests, the session-reading Web e2e case, READMEs, and the
reading Agent Note follow the new rule.

* 🐛 fix(session): address the Session status review findings

- Open the reading stream only while ctx.remoteAccess allows
  sessionStatus/follow, so a LiveShare viewer opens no owner-only stream,
  keeps readingReady false, and logs no synchronization failure; access
  changes start or stop the stream.
- Hide the unacknowledged completion of the Session the visible, focused
  main view retains; manual marks stay visible, completionFailed follows
  completionUnread, and the reminder returns on blur, hiding, or a switch.
- Declare ctx.sessionStatus on Context and restore its SERVICE_PAGE and
  SERVICE_ROLES entries; the service and SessionRead* types document on
  docs/subsystems/web-client.md, which now owns the reading section with
  the failed field.
- Document that a Host plugin reload can leave the Client with a terminal
  error until a page reload; drop the redundant types import and the
  unused publish() result.
- Archived Sessions read as read and offer no reading mark in the row
  menu or the toggle-read shortcut.
- session.toggleRead names the open dialog, open panel, or archived
  Session that blocks it instead of asking to select a Session.
- isRemoteStreamCarrierFailure rejects a RemoteError from the Host even
  when it carries gateway/carrier-lost; the code is Client-local.
- ./types is types-only like ui-trajectory, and files no longer ship
  lib/types JavaScript.

* 🐛 fix(session): close the remaining Session status review gaps

- The Gateway Client exports isRemoteStreamCarrierFailure, and the
  terminal view uses it, so a Host RemoteError carrying the carrier code
  shows as failed rather than disconnected.
- Each access grant's reading stream carries a token: frames a revoked
  or superseded stream still delivers are discarded, and cleanup waits
  for disposal before leaving reading unavailable unless a newer grant
  is active.
- The status table hides the viewed Session's natural reminder only
  while that Session is open; the panel case is a documented limitation.
- The README limitation and the upgrade guide state that only the
  main-view switch rule, including a reload restore, clears manual
  unread automatically.
- Add the missing blank line before the next heading in the web-client
  reading section.

* ♻️ refactor(session): install reading under the Session status table

- apply returns to master's form plus one line: UiSessionStatus is the
  root, published as the useSessionStatus source, and installReading()
  from the new src/client/read.ts follows Host reading records into it.
  UiSessionStatus takes master's three constructor parameters and
  creates its own SessionReadModel as the package-internal `reading`
  member; installSessionStatus is removed and acknowledge.ts stays a
  separate file.
- The viewed Session's snapshot subscription republishes the table only
  when its openState changes, so streamed events do not rebuild it.
- Remove the obsolete Dev Note sentence about failure outcomes.
- session.toggleRead passes when the Peer may not mark reading, matching
  the row menu, and reports readingUnavailable only while unsynchronized.

---------

Co-authored-by: imccyu <[email protected]>
Co-authored-by: imccyu <[email protected]>
2026-11-12 05:35:57 +00:00
imccyu 5e7206f6c6 refactor(exports): retire obsolete subpaths with compatible brand APIs (#8215)
* refactor(exports): consolidate type entries and remove obsolete subpaths

* fix(exports): preserve constructors while retiring brand subpaths

* fix(exports): retain guide relocation after parent squash
2026-11-11 08:39:14 +00: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
Dudu-0223 c41f0d1d10 feat(session): add read-only workspace and session list tools 2026-11-10 16:03:51 +08:00
LegGasai fd305cb903 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	packages/api/workspace-files/README.i18n.yaml
#	packages/api/workspace-files/README.md
#	packages/api/workspace-files/README.zh.md
#	packages/api/workspace-files/package.json
#	packages/api/workspace-files/src/index.ts
#	packages/api/workspace-files/tsconfig.host.json
#	packages/client/ui-open-in-app/src/client/context-menus.tsx
#	packages/client/ui-sidebar-files/README.i18n.yaml
#	packages/client/ui-sidebar-files/README.md
#	packages/client/ui-sidebar-files/README.zh.md
#	packages/client/ui-sidebar-files/src/client/FileNavigator.tsx
#	packages/client/ui-sidebar-files/src/client/FilesBody.tsx
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	pnpm-lock.yaml
2026-11-07 12:31:27 +08:00
LegGasai b0b991e968 Merge remote-tracking branch 'origin/master' into feat/session-workspace-root 2026-11-07 12:04:38 +08:00
imccyu 0a228f0a6a feat(ui-chat): load earlier history with explicit consumption intent 2026-11-06 23:37:20 +08:00
LegGasai d6775c2d87 fix(workspace-root): validate the LSP root, drop the unread original directory, and repair CI inputs
Code Entropy review: SessionDirectories.original had no reader, and tool-lsp
read rootOf without the ensure validation its sibling consumers keep.

CI: the upgrade guide moves to the current v0.2.2-rc.1 directory; the
sandbox-policy test supplies a Git identity through the environment, since
its disabled global configuration left the CI runner none to infer; the
testkit directory fixture is exercised by its own spec; the sidebar-terminal
e2e expects new user terminals to start in the workspace root and to follow
a relocation, which is the behavior this stack ships.
2026-11-06 17:20:14 +08:00
LegGasai e7a1c26e04 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers
# Conflicts:
#	apps/desktop-host/package.json
#	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/subsystems/sandbox.md
#	docs/subsystems/sandbox.zh.md
#	packages/api/terminal-controller/README.i18n.yaml
#	packages/api/terminal-controller/README.md
#	packages/api/terminal-controller/README.zh.md
#	packages/api/terminal-controller/src/index.ts
#	packages/client/tsdown.client.ts
#	packages/client/ui-open-in-app/src/client/index.ts
#	packages/client/ui-open-in-app/src/client/session-reveal.tsx
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/worktree/src/index.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
#	packages/sandbox/sandbox-local/README.i18n.yaml
#	packages/sandbox/sandbox-local/README.md
#	packages/sandbox/sandbox-local/README.zh.md
#	packages/sandbox/sandbox-local/src/index.ts
#	packages/sandbox/sandbox-local/tests/local.spec.ts
#	packages/sandbox/sandbox-policy/README.i18n.yaml
#	packages/sandbox/sandbox-policy/README.md
#	packages/sandbox/sandbox-policy/README.zh.md
#	packages/sandbox/sandbox-policy/src/index.ts
#	packages/sandbox/sandbox/README.i18n.yaml
#	packages/sandbox/sandbox/README.md
#	packages/sandbox/sandbox/README.zh.md
#	packages/sandbox/sandbox/tests/roots.spec.ts
#	pnpm-lock.yaml
2026-11-05 20:34:00 +08:00
LegGasai 848f44ed06 Merge remote-tracking branch 'origin/master' into feat/session-workspace-root
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
#	packages/experimental/worktree/README.i18n.yaml
#	packages/experimental/worktree/src/index.ts
#	packages/experimental/worktree/tests/worktree.spec.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
#	snapshots/session/compaction-output-reserve/session.v4.jsonl
#	snapshots/session/compaction-summary-headroom/session.v4.jsonl
#	snapshots/session/model-switch-compaction/session.v4.jsonl
#	snapshots/session/working-directory-admission/session.v4.jsonl
#	snapshots/session/working-directory-consumers/session.v4.jsonl
#	snapshots/session/working-directory/session.v4.jsonl
#	snapshots/session/worktree/session.v4.jsonl
2026-11-05 20:10:37 +08:00
liukx0205 78167faa4f Merge remote-tracking branch 'origin/master' into fix/web-prompt-retry 2026-11-04 15:34:17 +08:00
liukx0205 a186602dc3 Merge remote-tracking branch 'origin/master' into fix/web-prompt-retry
# Conflicts:
#	packages/api/session-controller/README.i18n.yaml
#	packages/api/session-controller/src/commands.ts
2026-11-04 15:29:20 +08:00
Turtleandimccyu 4731be7515 Merge origin/master into turtle/fork-name-suffix-5f3435925211
Co-authored-by: imccyu <[email protected]>
2026-11-04 14:16:25 +08:00
LegGasai dfff0da675 Merge branch 'feat/session-workspace-root' into feat/session-workspace-root-consumers
# Conflicts:
#	.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.i18n.yaml
#	.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.md
#	.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.zh.md
#	docs/subsystems/working-directory.i18n.yaml
#	packages/session/working-directory/README.i18n.yaml
#	packages/session/working-directory/README.md
#	packages/session/working-directory/README.zh.md
2026-11-04 13:56:03 +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
liukx0205 8706daa679 fix(web): deduplicate prompt retries after input acceptance 2026-11-04 13:37:53 +08:00
LegGasai b6aa7b437c feat(working-directory): route sandbox, file views, and discovery through the Session workspace root
Every consumer that describes the project to the user or draws the write
boundary reads rootOf(session) instead of the header directory: the sandbox
workspace-write policy, the workspace file service and desktop file drag, the
change recorder, the client Files tree, deliverables, open-in-app actions and
Session rows, new sidebar terminals, @ file candidates, the skill catalog,
project-instruction discovery, and the LSP workspace. The model's relative
paths keep resolving from the current directory.

The sandbox policy derives a linked checkout's Git administration directory
and common directory from its .git pointer and grants them as extra writable
roots; tool executions wait for that derivation through prepare(), and
Session creation and directory changes start it early. Windows ACL
confinement grants each extra root a standing ACE through a repeatable
--writable runner argument instead of refusing the policy.

Refs #2658
2026-11-03 18:49:34 +08:00
Yichen Jiang 2fb4ea0bec Merge origin/master into worktree/continue-generation-after-failure 2026-11-03 14:08:46 +08:00
imccyu ef5f28d0fb Merge master into worktree-sync-dsh-0.2.2-to-master 2026-11-03 11:47:40 +08:00
imccyu d3f7b8abe7 Merge pull request #7701 from deepseek-harness/fix/empty-session-sidebar-0.2.2
[0.2.2] fix(session-projection): compute exactly the requested projections for hot session summaries
2026-11-02 17:05:09 +08:00
Yichen Jiang fa9f77cc42 Merge remote-tracking branch 'origin/master' into worktree/continue-generation-after-failure
# 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-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
#	packages/api/session-controller/src/types.ts
#	packages/api/session-controller/tests/session-projections.host.spec.ts
#	packages/client/ui-conversation/README.i18n.yaml
#	packages/client/ui-conversation/README.md
#	packages/client/ui-conversation/README.zh.md
#	packages/client/ui-conversation/package.json
2026-11-02 16:02:18 +08:00
Yichen Jiang 818e8eced2 refactor(web): use empty retry user messages without loop changes 2026-11-02 15:58:09 +08:00
Dudu-0223 71676cbc21 Merge master into the ID-only subagent and Team core 2026-10-30 14:57:57 +08:00
imccyu 945006c984 perf(session): send one projection frame per committed event (#7587)
* perf(session): send one projection frame per committed event

* fix(session): deliver keys changed before a drive failure; address review

* perf(session): carry projection frame changes as key and val entries
2026-10-30 14:14:03 +08:00
Dudu-0223 11c02855e1 Merge master into subagent runtime stack base 2026-10-29 17:55:40 +08:00
Turtleandimccyu 8818fdd2e0 docs(session-controller): document fork title limits
Co-authored-by: imccyu <[email protected]>
2026-10-28 15:35:43 +08:00
Turtleandimccyu 3be7d56c6d fix(session-controller): give repeated forks distinct titles
Fixes #7471

Co-authored-by: imccyu <[email protected]>
2026-10-28 15:22:54 +08:00
imccyu 873c68c15b feat(models): show model selector badges from the /models listing (#7027)
* refactor(llm-deepseek): share the /models listing machinery

Move the account route's `/models` request and decoding, its
credential-scoped listing cache, and listed-catalog resolution with the
version gate into the shared DeepSeek Messages library, so a second
route can follow the same listing. Names drop the account prefix, the
cache takes each access's endpoint settings with the call, and it gains
`invalidate()` for a forced reload. `isBuiltInCatalog()` recognizes the
catalog an uncustomized `models` setting resolves to.

The account route keeps its behavior; only its imports and the
override diagnostic wording ("model listing") change.

* feat(llm-deepseek-api-key): follow the official /models listing

While `models` equals the built-in catalog and the Messages origin is
https://api.deepseek.com, `deepseek-official` serves the official
`GET /models` listing, authenticated with the API key in `x-api-key`.
Loading, refresh, fallback, merging, and the client-version gate match
the account route: the first access waits up to `modelsTimeoutMs`, a
listing older than `modelsMaxAgeMs` refreshes in the background on the
next access, a failure keeps the last good listing or the built-in
catalog, and listed models this build cannot serve are refused before
network I/O.

A customized `models` list replaces the catalog and requests nothing.
Switching between a customized catalog and the listing discards the
cached listing, so Restore defaults reloads it on the next access.

Suites that boot the route on the official endpoint now answer the
listing themselves instead of reaching the network.

* docs: describe the official route model listing

Document when `deepseek-official` follows the official `/models`
listing, its timing fields, customization precedence, and the forced
reload after Restore defaults in the API-key README, the shared
transport README, and the provider guide. Record the decision in a new
Agent Note, keep the account note's statement of where the shared
listing code lives current, and regenerate the configuration catalog.

* test(llm-deepseek-api-key): pin the once-per-listing hidden-entry diagnostic

* docs: regenerate module and event graphs for the shared listing

* fix(llm-deepseek-api-key): report credential failures on the model request

On the official endpoint, `connect` waited for the listing view, whose
credential lookup rethrew a malformed key or a credential-store failure
before the agent loop recorded the prompt. A failed lookup now resolves
the connection from the current listing view, so `resolveAuth` reports
the failure on the model request and the turn keeps the prompt and the
failed attempt. A caller abort still rejects.

* docs(llm-deepseek-api-key): name which hidden listing entries are logged

* test: keep unit suites off the official model listing

Suites that boot the DeepSeek routes with a dummy or inherited key now
request `GET https://api.deepseek.com/models` on the official endpoint.
A unit-lane setup file rejects that request at once, so such a suite
serves the built-in catalog instead of reaching production or waiting
out the listing deadline on a network that never answers; suites that
exercise the listing answer `fetch` themselves. Other requests pass
through unchanged.

* feat(llm-deepseek): read tool_update from the model listing

Both DeepSeek routes now take a listed model's Messages tool update mode
from `api_capabilities.anthropic_messages.tool_update`, alongside the
system prompt mode. `in-history` and `addition-only` replace the
bundled mode; any other value reads as `leading-only` and removes it.
An absent or `null` mode keeps the bundled one, so a listing that does
not declare the field leaves `deepseek-flash` on `addition-only`.

`system_prompt_update: null` likewise keeps the bundled mode now; it
previously read as `leading-only`, which a serializer writing empty
values as null would have turned into a cache-unfriendly downgrade.

* fix(llm-deepseek): sync the built-in context window with the official listing

The official `/models` listing declares a 1,048,576-token context window
for `deepseek-flash` and `deepseek-v4-pro`; the built-in catalog said
1,000,000, a decimal-versus-binary mismatch. Both built-in entries now
carry the listed value, so offline starts and listing failures size the
context the same way the listing does. The Models page shows the exact
count for these rows, since 1,048,576 has no decimal K/M spelling.

`defaultContextWindow`, the fallback for model ids the catalog does not
describe, stays 1,000,000.

* test(llm-deepseek-api-key): reject the stubbed listing request with an Error

* test(cli): keep the built SDK smoke off the official model listing

The SDK profile's initialize now resolves the deepseek-official catalog,
which requests GET https://api.deepseek.com/models on the official
endpoint. With the smoke's fixture key that request answers 401 and the
route warns on stderr, so the test's empty-stderr assertion failed in the
e2e and snapshots lanes. Point the run at a loopback mock and assert it
received no model call.

* feat(llm): carry /models badges into the model catalog

The shared DeepSeek listing decoder reads an optional per-entry
`badge: { text, tone }`. Text is one literal or translations keyed by
lowercase language id with a required English entry, each trimmed to 1
to 12 characters on one line; tone is neutral, info, success, or
warning, and an absent or unrecognized tone reads as neutral. An absent
or null badge declares none; an unreadable one is dropped with a listing
problem and never hides its model.

resolveListedCatalog keeps the badges of offered models, both DeepSeek
routes attach them through catalogModelInfo, LlmRuntime.listModels
detaches them, and the Host model catalog forwards them as
ModelCatalogModel.badge. resolveModelInfo omits the badge, so no model
request, Session event, or model-facing tool carries it.

* feat(client): render catalog badges in the model selector

The composer model seat shows a catalog model's badge after its name in
the trigger, the root-menu value, and each option: a Tag in the badge's
tone whose text is resolved for the active locale through
ctx.locale.resolveText. A conversation.input.model.label contribution
replaces the name and badge together and receives the badge in its
owner props.

Remove ui-deepseek-model-label-1017, which hard-coded `1017` beside
DeepSeek-V4.1-Flash for two providers, and its Web bundle row. The badge
now comes only from the model listing, so the build ships none of its
own; the upgrade guide covers profile patches that still target the
removed row. The Web e2e replaces the fixed-badge case with replay
catalogs that declare literal and translated badges, and the replay
adapter validates and advertises a configured badge.

* feat(llm-deepseek): read model badges from client_metadata

Each /models entry now declares its selector badge under
client_metadata["deepseek-harness"].badge, keyed by the User-Agent product
token like client_requirements, so the public model fields stay unchanged
and later DeepSeek Harness fields join the same object. Every field under
client_metadata is ignorable: null at any level shows no badge, and a level
that is not an object drops only the badge with a diagnostic naming it.

* docs: record why the listing badge container is client_metadata

* fix(models): refresh listed badges in open selectors

* refactor(models): share listing cache lifecycle wiring

* docs(models): refresh listing event producer catalog

* fix(models): retain badges when listing refresh fails

* fix(models): validate badge text and preserve tags beside long names

* test(models): cover account listing automatic badge removal
2026-10-27 23:18:07 +08:00
imccyu a1659120a3 fix(session-controller): retire a queued echo when its Inbox row is canceled
A queued echo now records its Inbox position like transcript and steering
echoes. Later splices move that position, so a canceled splice that removes
the row retires the echo even when no Inbox projection ever showed it, for
example when the Turn is stopped right after queueing. A claimed row still
waits for its admitted message, and the queue dock still hands the echo over
to the Host row it renders.

The fold-room e2e no longer samples the running status slide or the
`data-chat-tail-pinned` mark that this branch removed. It asserts that fold
room below a short answer takes the new Turn's growth without scrolling
through Turn end, that the room never grows back, and that the running
status only moves down.
2026-10-27 21:36:10 +08:00
imccyu ae07093132 fix(chat): keep the transcript steady at Turn end and when steering lands
Measured against 0.2.1-rc.4 and master with the frame-sampled motion matrix,
the transcript moved back and forth at Turn end and around input landing.
This keeps rc.4's landing behavior, master's steering layout, and fixes the
reversals that remain.

- Completion-time folding keeps the first visible surviving row still when
  work rows close at once, filling the gap with bottom space capped at half
  the scrollport, instead of letting the browser clamp the position.
- After the Session stops running, the running status keeps its tail slot
  hidden and silent until the Turn's actions row replaces it, so the tail
  does not shrink and grow back.
- A Turn's duration control takes its gap in one frame instead of sliding.
- A fold batch that takes over following for a content change absorbs
  growth outside the batch before its first frame.
- Steering lands at once under either fold timing: the running Turn keeps
  streaming above its echo, which a native animation would push down.
- The running status no longer slides below a Step's first output, and the
  column no longer carries `data-chat-tail-pinned`; the steering entrance
  keeps its animation.
- A queued prompt is accepted by its Inbox row as well as by its receipt,
  so the composer clears the draft in the frame the queue dock shows it.
- A queued echo waits for the Inbox projection instead of retiring on the
  durable splice, so the queue dock does not empty for a frame.
2026-10-27 20:44:52 +08:00