Commit Graph
352 Commits
Author SHA1 Message Date
imccyu 35602063d7 refactor(typert): name the client stream handle RemoteStreamHandle everywhere 2026-09-20 17:53:17 +08:00
imccyu 021bd03b70 feat(gateway): let every Remote stream carry a client uplink
Every Typert Remote stream accepts client-to-Host items on the same
logical stream. A method declares the uplink item type in its return
type, RemoteStream<Out, In>, and reads the items through
this.ctx.invocation.uplink(); the invocation also carries the calling
Peer. Client generated methods return a handle that iterates the
downlink and exposes send/end/dispose for the uplink.
2026-09-20 17:53:16 +08:00
Dudu-0223 e848b6226f Merge remote-tracking branch 'origin/master' into codex/fix-migration 2026-09-20 15:45:12 +08:00
liukx0205 b882e7fc20 docs(session): record the client-local engagement memory limits 2026-09-20 14:54:27 +08:00
liukx0205 d8480db9f0 refactor(web): read engagement retention from one identity set
Address review: retention now has a single definition (retainedIds) shared by
the list-refresh sweep and the single-id prune, an already-engaged identity
skips the redundant row mutation, and the ledger documents why Host-asserted
running is recorded before any holder exists while the client-local acceptance
callback requires one.
2026-09-20 14:54:20 +08:00
liukx0205 e3f0d3fb6e fix(web): preserve session engagement across blank list refreshes 2026-09-20 14:43:46 +08:00
Dudu-0223 6f3140d7cf Merge origin/master into fix/lazy-subagent-migration 2026-09-20 14:37:01 +08:00
Dudu-0223 17a52a8fe3 fix(subagent): retain unreadable children in migrated catalogs 2026-09-20 14:30:02 +08:00
Dudu-0223 f44b78a622 fix(session): complete parent catalogs while isolating child failures 2026-09-20 12:09:57 +08:00
Dudu-0223 c08ead6900 Merge remote-tracking branch 'origin/master' into fix/lazy-subagent-migration
# Conflicts:
#	packages/client/ui-plugin-manager/tests/components.client.spec.tsx
#	packages/client/ui-workspace/README.i18n.yaml
#	packages/client/ui-workspace/README.md
#	packages/client/ui-workspace/README.zh.md
2026-09-20 11:58:21 +08:00
imccyu 4b02d03ed5 test(session): compare the forked cold row's recency with the list formula
The cold row's updatedAt is the later of the header's creation time and the cached last prompt; the fork's creation time is wall-clock and can trail the inherited prompt by a millisecond, so the restart test asserts the same maximum instead of the prompt time alone.
2026-09-20 10:54:20 +08:00
imccyu de055efa9a test(session): list a forked Session's cached title after a Host restart
A real fork made through sessions.fork is checkpointed into the projection cache, the Context is disposed, and a Host booted over the same storage root serves the fork's title and list metadata from the header alone, as a kind: 'cached' block, without inspecting or opening the log.
2026-09-20 02:04:37 +08:00
imccyu fd76c9534f docs(session): sync the client merge-rule prose with cached and sequenced rows
The session-controller README, the per-session store JSDoc, and the projcache predecessor-recovery and durable-web-queue-recovery notes described one higher-seq-wins rule and the asOfSeq -1 title hint. They now state that higher-seq-wins applies among Host-sequenced values, that cached list blocks yield to the connected Session's baseline, and that the predecessor title carries its stored row's watermark under kind: 'cached'.
2026-09-20 01:48:34 +08:00
imccyu c4d40864fd fix(client): route list projection blocks by kind
A `sequenced` list block merges key by key under higher-seq-wins like any Host-computed value, so a delayed control baseline at a lower cut can neither overwrite nor clear a newer live-session list value. Only a `cached` block goes through applyCached and yields to every sequenced write. The projection store's module docs describe the two row kinds.
2026-09-20 01:31:52 +08:00
imccyu 1b51a1ad2d fix(session): label list projection blocks with their sequence space
SessionProjectionHints gains a required `kind`: `sequenced` when the Host's live registry computed the block for an attached Session, `cached` when a header-only listing viewed it from the persisted projection cache. `asOfSeq` stays the producer's own watermark in that space, so the cache read faces report the lowest served row seq again instead of the -1 sentinel. The two fields are independent: `kind` names the sequence space, `asOfSeq` the position in it.
2026-09-20 01:31:52 +08:00
imccyu 9ff8f26450 fix(client): keep list-cached projection rows below sequenced writes
ProjectionValueStore rows are either cached (viewed from the persisted checkpoint by the session list, no comparable seq) or sequenced (computed by the connected Host, seq comparable within the connection). Cached values fill empty keys only; every baseline discards cached rows before seeding, and every frame replaces them regardless of seq, so a connected Session's values always supersede list hints. The list response and api-session/added blocks write cached rows.
2026-09-20 01:31:52 +08:00
imccyu 86ca9de07e fix(session): read cold seeded rows from the projection cache by header
The projection cache read-only face (cachedSnapshot, cachedPredecessorTitle) now matches the lifecycle identity a header witnesses (formatVersion, createdAt, cwd, isSeeded) and serves its rows as a cached block with asOfSeq -1. The fold face (hydratePrepared, write, coldSnapshot) keeps the full identity including the inherited cut. The session list and @ completion drop their isSeeded guards, so forked sessions keep their cached title and list metadata across a Host restart; list-children keeps its body fallback.
2026-09-20 01:31:52 +08:00
Tianyi Cui 85c6e80e0c Merge remote-tracking branch 'origin/master' into worktree/session-attachment-carriers-20260919 2026-09-20 00:27:54 +08:00
imccyu d67545f367 docs: sync catalogs and contracts for session fixes 2026-09-19 23:05:40 +08:00
imccyu 8771607f8b test: cover sidebar fork and persistent shell cancellation regressions 2026-09-19 23:05:40 +08:00
imccyu 1e48dae2aa fix(web): keep sidebar forks from switching sessions 2026-09-19 23:05:39 +08:00
Dudu-0223 a9985b49ae fix(session): migrate historical subagents only when opened 2026-09-19 22:47:01 +08:00
Tianyi Cui 0c44e5461d fix(session): restrict attachment discovery to declared event content
Attachment reads and ZIP export previously inferred ownership from common
field names on arbitrary events. Opaque ignorable plugin payloads could
therefore cause storage reads, while declared compaction content was missed.

Select attachment-bearing fields by current built-in event type in both
readers. Read direct image and file blocks, including flat V4 tool results
and developer messages, without interpreting extra block fields. Leave
unknown payloads and malformed inbox entries opaque. The archive preserves
the complete logical log even when its payload does not authorize a read.

V4 validates title requests as one text block, so do not treat them as an
attachment carrier. Compaction keeps its declared ContentBlock fields for
valid custom producers; the basic producer's text-only output is documented.
Historical wrappers remain the adjacent converters' responsibility rather
than a second compatibility path in attachment readers.

Adapt the original policy change to master after V4 landed, retaining its
author credit and scope. Cover tool-result export explicitly, keep Team
fixtures free of invented message roles, and verify that denied carriers
never read storage. The 889 owning tests pass with 100% statement, branch,
function, and line coverage for both changed runtime files.

Co-authored-by: Tianyi Cui <[email protected]>
2026-09-19 21:08:29 +08:00
Tianyi Cui 580bdc7258 refactor: remove redundant unknown casts 2026-09-19 20:13:58 +08:00
Yixiang TuandTianyi Cui e0bd7e1960 feat(session): add developer changes using historical tool schemas
Session V4 reserves developer-role messages for incremental model-visible
session changes. The role, tool addition/removal blocks, and deferred-loading
marker need a durable representation before independent provider and UI
integrations can emit or consume them. Known developer events must match an
open turn and step; unsupported providers and UI consumers fail explicitly.

Request headers already capture full tool definitions. Persisting another
ToolSchema in each addition would duplicate Session information and create
two definitions that could drift. Additions therefore store toolName, and
the containing developer event uses headerSeq to select one earlier known
request/header for all its additions. A same-name replacement keeps its
historical definition identity through restart, fork and surface changes.
Removals require no definition copy, and ordinary developer messages omit
headerSeq. Generic sourceEventSeqs remains independent derivation metadata.

The rejected inline tool field is optional never with @persistenceReserved.
The schema extractor retains that uninhabited slot, so permitting a future
value requires a format bump instead of being mistaken for compatible
optional metadata. Unrelated optional fields remain additive and readable.

Native and Session admission reject missing, forward, non-header, unknown,
ambiguous and incomplete referenced definitions, and reject the retired
inline tool field. Validate complete schema fields only for referenced
definitions, preserving unrelated header behavior and extra JSON metadata.
Unknown ignorable records remain opaque. Empty developer nodes retain their
surface position without producing a message or shadowing the system head.
No automatic emitter, provider activation, UI implementation, or speculative
public resolver is added.

Keep the core-owned developer source binding beside the introduced role,
including the request-only type rejection and attribution round trips. Update
consumer guards, SDK/snapshot handling, bilingual owner documentation, and
the same unreleased V4 acknowledgement. Keep earlier tool/source migration
work and its documentation in the parent. Preserve the existing recorded
Cordis inspection generation from the original developer change.

Integration keeps the final source layer as the sole parent and preserves
master's Messages input filtering, empty-user omission, empty tool results,
and system-update placement. Developer/deferred guards still run before
conversion. Native V4 admission, header references, reservation declarations,
and generic tooling match the validated marker candidate. Parent-owned
fixture and generator fixes remain in the parent.

Earlier feature validation passed full build, full lint, 41 doc-sync gates,
and 16 hygiene gates. The unchanged native implementation retains that evidence.
The focused Session/V4/request-input run passes 884 tests across 38 files with
100% statement, branch, function and line coverage for the V3-to-V4 package
and Session surface. Consumer tests pass 482 with one existing skip; tool,
message and optional-field tests pass 146. Cordis inspection and compaction
replays pass in both source and built modes (two cases per mode). Ten invalid
referenced-definition/unknown-header controls failed before their scoped
guards and pass after them.

Reservation validation: the actual generated developer root records tool as
optional primitive never. Widening it requires a bump, while traceId remains
additive and preserved; all 85 focused reader/classifier tests pass.

Final-parent validation: 205 tests across eight provider, type, catalog,
Session and native-format files pass. The preserved parent fixture verifies
Messages input-history replay; runtime/declaration and parent-owned-file
comparisons show no loss during the final rebase.

Co-authored-by: Tianyi Cui <[email protected]>
2026-09-18 19:08:11 +08:00
_KermanandTianyi Cui fb79a944f5 refactor(llm): separate durable producer sources from request inputs
Give durable user context its producer-owned source kind instead of a generic plugin wrapper. The V3-to-V4 conversion preserves the frozen rename and collision rules, all own JSON metadata, event coordinates, and historical request-only kinds. Native catalog and JSONL admission retain source validation so unknown attribution can survive without its producer while malformed owned sources are refused.

Use an explicit user-only RequestUserInput for auxiliary LLM prompts that do not own durable message identity. Auto Review and compaction remove their request-only source registrations while retaining prompt content and freezing; provider serializers and projections keep the same wire data, assistant replay isolation, image ordering, and tool correlation. Session writes, Agent delivery, and recorded title requests continue to require identified durable messages.

Bind the saved compatibility policy only to user sources and qualify tmux location attribution without weakening fixed system, model, or tool semantics. Rebuild the current inventory and unpublished V4 acknowledgement on the actual tool-role parent, preserving its rationale and all accepted historical records. The catalog format version records tooling metadata; Session remains V4. Developer-role policy and activation belong to their own feature.

The latest-master Messages adapter, serialization, request-input typing, EpochHeader reservation, and attribution checks pass 103 tests across five files. The retained V3 Messages input-history snapshot passes through the source profile; Host/Client typechecks and all 41 documentation gates pass. The generated comparison records four changed roots and 447 unchanged type fingerprints. Latest-master ARIA changes are retained, with producer source labels applied independently; new Messages fixtures retain their producer names as declared source kinds and use the fixed system-message helper; recorded Session generations are unchanged by this regrouping.

Co-authored-by: Tianyi Cui <[email protected]>
2026-09-18 19:07:12 +08:00
_KermanandTianyi Cui f4a32dbd0a refactor(llm): flatten tool results and validate native V4 sessions
Represent tool results as tool-role messages and migrate released wrappers
without losing outer own JSON fields, call identity, error state, or writer
field order. Refuse nested or wrapper-only information that has no lossless
current representation before successor publication.

Validate current event relationships directly instead of projecting V4 data
back into V3. Keep lifecycle, PTC, title/command, compaction, system-field and
retired-syntax checks on catalog restoration and ordinary JSONL opens. The
Worker JSON equality helper must inspect own keys so it cannot admit PTC
arguments that Node rejects.

Keep the source role change, required native admission and consumer fixture
updates in one complete review layer. Explain shared-type changes in the
persistence record and the native reader rationale in its existing note.
Use checked branded fixture identities and discriminant narrowing instead
of unknown double casts; fixture values and assertions remain intact.

This recomposes the original tool-role work by _Kerman with the independently
validated migration and admission repairs by Tianyi Cui. Frozen generations
and snapshot input version selection are retained.

Co-authored-by: Tianyi Cui <[email protected]>
2026-09-18 19:05:32 +08:00
Tianyi Cui 044cd4fb49 merge: integrate pinned master into session-log-v4 base
Merge master 01d96c168a84227374e3aa741e94ddfbb498e27e, observed when
this integration started, after the published 6de3db41 checkpoint. Keep
master's author history and preserve the release writer, adjacent
migrations, historical Session generations, and parent-owned catalogs.

Combine blank Session writer acquisition and superseded-startup
cancellation with the release branch's projection refresh and panel
preservation. A startup acquisition may finish after a later navigation,
but must not retain a stale main Session or reveal its Conversation.
Update the existing regression's retention expectation while preserving
its panel and active-navigation assertions.

Keep the release catalog loading, known-leaf, and parent availability
behavior alongside master's completed-turn status and aligned sidebar
icons. Regenerate the config locations and pair the combined README
contracts. Preserve upstream's Linux process-state assertion repair.
2026-09-18 18:21:47 +08:00
Turtle 5c8933fbe3 fix(session): acquire blank Session writers before reuse (#4392)
* fix(session): keep blank session discovery local to each host

* fix(session): acquire blank writers before reusing sessions

* refactor(workspace): separate saved selection restoration from blank lookup

* fix(workspace): create after the selected blank writer is held

* test(web): align blank reload snapshot with current icons
2026-09-18 17:19:40 +08:00
Tianyi Cui c3cfe83d2e merge: update the session-log-v4 integration base from master
Merge a2acc7d3eb620bb52f09f7ea3b5a3a1c23353e18 after preserving the earlier
master checkpoint and its successful CI. Carry current provider input-history
handling, UI controls, agent targeting, and runner-concurrency changes into
the integration base without changing the Session migration feature layers.

Keep durable direct-child catalog semantics alongside the upstream running /
inactive vocabulary. Resolve the snapshot description conflicts by retaining
that upstream status text and the existing descendants-only diagnostic rule;
the source and all 53 JSON tool descriptions agree. Preserve parent-session
availability handling with the upstream stale-blank and batched-history fixes.

The merged application builds, all 41 documentation gates pass, and focused
provider, tool-control, and Session Controller tests pass (98, 29, and 125).
Recorded input changes come from master: one refreshed v3 list-agents sample
and three new v3 scenarios; no migration bumps an existing snapshot generation.
2026-09-18 15:52:56 +08:00
creatixchu 363343fb83 Refresh config locations and satisfy typed fixture lint 2026-09-18 15:36:56 +08:00
creatixchu 04d0235673 Verify local file opening and address sidebar review findings 2026-09-18 15:31:50 +08:00
Yichen Jiang 27eec0a247 Merge remote-tracking branch 'origin/master' into worktree/fix-new-session-stale-blank
# Conflicts:
#	packages/api/session-controller/README.i18n.yaml
#	packages/api/session-controller/README.md
#	packages/api/session-controller/README.zh.md
#	packages/api/session-controller/src/client/sessions/manager.ts
#	packages/api/session-controller/tests/manager.client.spec.ts
2026-09-18 15:05:52 +08:00
imccyu 3d360e7fdb perf(session-controller): publish historical jump pages as one batch 2026-09-18 14:13:47 +08:00
Tianyi Cui d66b21894c merge: integrate latest master into session-log-v4
Merge master 62b700bba7bb71e66d2d5a3b850ba8f4dd0fd6b4 into release/session-log-v4 at 4825bc01a999f564e79172a6af28e34fc757c540. Preserve this pinned integration checkpoint before any later upstream movement so the dependent session-format repairs have an immutable rebase base.

Keep release projection-backed child catalogs, independent Session references, exact fork behavior, V4 writer, and existing migration data. Adapt the incoming subagent sidebar chat to refreshProjections rather than the removed dedicated catalog API, preserve title projections in complete projection fixtures, and retain both sidebar actions and release lineage/status behavior. Remove the duplicate SessionProjectionMap import introduced by automatic merging.

Preserve both disjoint archive seals without changing any existing hash. Regenerate current Cordis and documentation catalogs from the combined source, retaining release session methods plus master slot factories. The frozen V0-V3 runtime paths are unchanged. Initial validation passed the full build, 93 focused Client tests, and all 1905 archived artifact seals; remaining integration and snapshot checks follow on this checkpoint.
2026-09-17 23:23:48 +08:00
creatixchu 6b1808f432 release(dsh): 0.1.6-alpha.2 2026-09-17 21:11:19 +08:00
imccyu e62587c163 feat(client): open subagent chats in sidebar 2026-09-17 18:03:57 +08:00
Tianyi Cui c840ac431d fix(client): settle preset selections and isolate generation stores 2026-09-17 10:43:21 +08:00
Tianyi Cui fa3e5cbaf6 fix(client): preserve state across Session reference updates 2026-09-17 09:38:24 +08:00
Tianyi Cui 5c25efba91 merge: integrate Client Session references into session-log-v4 2026-09-17 08:59:42 +08:00
imccyu 2438bdd4d6 docs(client): document explicit Session ownership 2026-09-17 05:28:58 +08:00
imccyu 6d3b5d4526 test(client): migrate Session reference coverage 2026-09-17 05:28:19 +08:00
imccyu 6830e1460d refactor(session-controller): own Client Session generations 2026-09-17 05:27:26 +08:00
Tianyi Cui 038c36b138 merge: update master integration with released fork support 2026-09-17 00:40:09 +08:00
Tianyi Cui 0a1e2691ab merge: integrate master into session-log-v4 2026-09-17 00:12:27 +08:00
Tianyi Cui 8696ec6cef feat(session): fork exact event prefixes with synthetic tail results 2026-09-17 00:00:44 +08:00
Dudu-0223 e55093b47d feat(subagent): migrate direct catalog consumers to parent projections 2026-09-16 22:05:17 +08:00
Yichen Jiang 55d57d33b6 fix(session): initialize blankness from retained metadata 2026-09-16 20:22:14 +08:00
Yichen Jiang f65799a236 docs(session): clarify blank-state projection guarantees 2026-09-16 20:05:48 +08:00
Yichen Jiang fa2abdd6f1 fix(web): reconcile stale blank session hints from projections 2026-09-16 16:39:53 +08:00