Commit Graph
257 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 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
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
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
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
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
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 4514b99d9c Merge master into feat/subagent-names 2026-10-29 17:43:46 +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
Yichen Jiang 2e0c73a895 refactor(agent): record continuation as retry control input 2026-10-27 12:07:24 +08:00
Yichen Jiang 4a4aabaa57 fix(core): align empty continuation checks and generated references 2026-10-26 22:16:24 +08:00
Yichen Jiang d8254627fe feat(core): continue failed turns through empty prompt input 2026-10-26 22:12:13 +08:00
Yichen Jiang b0e41f74ad Merge remote-tracking branch 'origin/master' into worktree/composer-host-confirmed-echo
# Conflicts:
#	packages/api/session-controller/README.i18n.yaml
#	packages/api/session-controller/src/client/sessions/session.ts
#	packages/client/ui-conversation/README.i18n.yaml
2026-10-26 13:29:33 +08:00
imccyu 7c7b021766 docs(session): document events, deprecated page and activation order
Sync the Session README, implementation notes and follow upgrade guide,
then regenerate the API, subsystem, persistence and event-graph catalogs.
2026-10-25 18:14:32 +08:00
CreatixChu 7bc30c4cba fix(attachments): 复用完整图片引用,取消 Session 历史扫描 (#7021)
* test(api): measure historical image read costs

* fix(test): resolve image benchmark paths from its config

* fix(attachments): read stored images without scanning sessions

* test(attachments): complete by-id fixtures and access assertions

* fix(docs): implement image-id read on catalog fixture

* docs(attachments): refresh generated read contracts

* test(web): verify stored images across history and forks

* docs(api): clarify image read metadata and permission scope

* test(api): type benchmark instrumentation without unsafe returns

* test(api): retire unknown-cast allowances with removed history fixtures

* test(attachments): isolate browser cases and document store-wide access

* test(web): intercept the by-id thumbnail read path

* docs(perf): run generated diagnostic from its owning package

* refactor(attachments): reuse reference reads for conversation images

* docs(api): refresh complete image reference client contract

* test(ui-chat): assert complete image reference forwarding

* test(perf): measure image reads against current Session observations
2026-10-25 09:40:53 +00:00
Yichen Jiang 3764b60205 Merge commit '3dd445fe163' into worktree/composer-host-confirmed-echo
The session-controller README pairing is recorded again for the merged
sections.
2026-10-24 21:39:51 +08:00
Dudu-0223 f09648ddca Merge published subagent activation ownership changes 2026-10-23 18:28:46 +08:00
Dudu-0223 00a2e76b87 Merge master and reconcile translation records 2026-10-23 18:19:07 +08:00
imccyu b2b3bf4568 fix(typert): reject ambiguous and multiple default resource identities 2026-10-23 16:13:38 +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 ad7c75c798 Bind subagent providers and preserve archived ancestor checks 2026-10-23 15:10:11 +08:00
Dudu-0223 b096659245 fix(session): make ordinary forks independent of source lineage 2026-10-23 14:48:07 +08:00
Dudu-0223 e914c285d2 Merge master into subagent refactor 2026-10-23 14:45:13 +08:00
Yichen Jiang 89538fb115 Merge remote-tracking branch 'origin/master' into worktree/composer-host-confirmed-echo
- The composer's primary button keeps master's rule that hides a denied
  action and draws the sending state inside it; a sending prompt stays
  interruptible through master's stopAction.
- The ui-conversation README pairing is recorded again for the merged
  sections.
2026-10-23 14:31:30 +08:00
Dudu-0223 ea009821d6 Simplify subagent user controls and authorize target sessions 2026-10-22 17:06:13 +08:00
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
Dudu-0223 16ece34568 Merge master into subagent tree branch 2026-10-22 13:33:16 +08:00
Yichen Jiang da864e3377 Merge remote-tracking branch 'origin/master' into stack/pr-6426 2026-10-22 10:30:26 +08:00
Yichen Jiang 6dafa66dc6 docs(attachment): state the relaxed default image limits
The default per-image limit is 50 MiB and the default per-side limit is
65,535 pixels, but the admission summaries in the attachment subsystem
page and the attachment-local README still named 20 MiB and 8192 pixels.
The session-controller note on the /api/file byte limit and the tool-fs
note on read_image source caps also named the old 20 MiB maxImageBytes
default.
2026-10-21 18:02:38 +08:00