Files
deepseek-harness/packages/context
imccyu eb1713f856 fix(session-projection): keep released units in checkpoints (#7754)
* fix(session-projection): keep released units in checkpoints

Since the Cordis rc.11 teardown order unloads the Web layer before the
base layer, Session Controller and harness-dev-context release their
projection units before their live Sessions detach. The projection
cache is still alive at that point and wrote a checkpoint holding only
the units that were still registered, replacing the complete record.
A blank Session then lost sessionListMetadata and listed as an untitled
conversation after every graceful restart.

A released unit now stays in the registry as a predecessor: it leaves
event drives, snapshots, restores, and change notifications, while
checkpoint() keeps each Session's last cell of it without advancing it.
Registering the same key again replaces the predecessor and refolds
the log. The projection cache keeps replacing whole records.

* test(session-projection): assert frozen released units across unload tests

Update the remaining unload tests that still expected a released unit
to vanish from checkpoint(): user-approval, agent-loop inbox and scope
lifecycle, time-context, and the agent registry now assert that the
same Session keeps its pre-unload row, that a later event does not
advance it, and that a Session created after the unload has no row.
The token-meter and goal unload tests also append an event after the
unload.

Document that a retained handle read still advances a released cell
that checkpoint() serves, and that restore() folds only live units, so
its refreshed rows omit released units.

* docs(session-projection): sync the ProjectionHandle type-equiv block

* docs(session-projection): record frozen released units and their upgrade

Add the upgrade guide for checkpoint() keeping a released unit's last
row, update the registration-handles Agent Note with the frozen-cell
decision and the retained predecessor, list both consequences under the
registry README's known limitations, note in the projection cache README
that a stored row can be frozen at its unit's release, and say that
restoreFloor() ignores released predecessors.

Update the agent-loop resource-lifecycle unload test, which read
checkpoints through an alias, to the frozen-row semantics.

* docs(upgrade-guide): mark the released-checkpoint snippet ignore-check

* docs(session-projection): state the retained-handle path and narrow a rejected alternative

* docs(upgrade-guide): re-record the released-checkpoint guide pairing
2026-11-03 11:07:09 +08:00
..
2026-10-28 02:03:15 +08:00

description, kind
description kind
The context group map: request-context plugins that add durable, model-visible context without defining tools, for users and maintainers navigating the group. package-group

context/ — Request-context plugins

English | 中文

Summary

The context group provides plugins that add model-visible context to each request without defining any tool: workspace instruction files become guidance, @file mentions offer path completion, other sessions can be referenced as bounded snapshots, and the model can see the current time and the agent's tmux location. Only agent-instructions (dsh-base) ships mounted by default; the rest are opt-in. Context is durable: injected instructions and references enter session history as user-role messages, so they persist, replay, and compact like other conversation content. This page maps the group; each package README owns the per-package contract.

Table of Contents


Packages

Package Role ctx key
agent-instructions/ Loads AGENTS.md/CLAUDE.md workspace instructions into context and refreshes them after file edits —
session-reference/ References other sessions: mention one and its bounded read-only snapshot becomes context ctx.sessionReferenceResolver
file-reference/ @file mention discovery and the shared mention grammar for host-backed UIs ctx.fileReferences
file-reference-local/ Local-workspace completion provider for @file mentions —
time-context/ Current time, browser zone, and elapsed time per step —
tmux-context/ The agent's tmux session, window, and pane location —
harness-dev-context/ The harness checkout and Web GUI URL as runtime context, keeping the system prompt stable across processes —


Dev Note

Working context for maintainers — click to expand

None.