mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
A plugin owning a standalone open/close bracket cannot tell a dead marker from a live one: an unmatched `compact/start` reads identically whether the previous writer died mid-compaction or a compaction is running now. `Session.firstLiveSeq` already holds that answer exactly, but only in memory. Append the log-only `session/inherited` event at that seq from the seeded constructor — the single waist all six seeded-start paths pass through (resume, configured startup on a persisted id, `sessions.fork()`, a subagent fork child, `adopt()`'s live prefix, and a bare seeded `create`). Read it through the new `isInheritedSeq(events, seq)`. The constructor placement means persistence needs no changes: the marker is already in `events` when a backend captures the creation seed, so it rides the ordinary seed path with no load-time write. It also covers fork, where the inherited bracket's owner may still be running — the case a persistence-layer boundary could not reach. Activity ordering excludes the boundary through `lastActivityTime()`, since lazy resume makes browsing a pickup and the three call sites would otherwise float every opened session to the top of a picker or list.
session-persistence/ — persistence capability family
English | 中文
The durable session-persistence seam and its storage backends. The interface package owns the abstract SessionPersistence service and the shared write coordinator; the backends are concrete implementations that register on ctx.sessionPersistence. All product packages.
| Package | Role | ctx key |
|---|---|---|
session-persistence/ |
Persistence seam + shared write coordinator | ctx.sessionPersistence |
session-checkpoint-policy/ |
Semantic durability barriers for agent requests and tool execution | (wraps ctx.llm / ctx.tools, listens on agent events) |
session-persistence-jsonl/ |
JSONL-sidecar persistence backend | (registers ctx.sessionPersistence) |
session-persistence-sqlite/ |
SQLite persistence backend | (registers ctx.sessionPersistence) |
The interface lives at session-persistence/session-persistence/; backends are flat siblings. A new storage backend joins here and registers on ctx.sessionPersistence. See session persistence.