Files
deepseek-harness/packages/session
Yichen Jiang 8470ddef1d refactor(http-proxy): converge the proxy API on four functions
The package exported six functions, four of them shaped by one SDK's
transport each: a dispatcher factory, a `node:http` agent factory, a
proxy-URL lookup, and a policy accessor. Review asked whether the call
sites could converge instead of the package growing an export per SDK.

They could, and each removal took a whole shape with it:

- The OTLP exporter moves to the SDK's `fetch` delegate, retiring
  `createNodeHttpAgent`. Its Node-version floor goes too: `proxyEnv` on
  an `http.Agent` needs 22.21 or 24.5, inside the engines range, so
  telemetry was direct on 22.19, 22.20, and 24.0-24.4. The cost is
  `compression`, a Node-transport option; the plugin now refuses it,
  `keepAlive`, and `httpAgentOptions` at load instead of ignoring them.
- `web-fetch-http` builds its own address-pinning agent under an
  annotated `proxy-exempt:` exemption, retiring `createDispatcher`.
  Pinning is per-request state a process-wide dispatcher cannot hold.
- E2B reads `route.proxy`, retiring `proxyUrlFor`.

What remains is `installProxyFromEnvironment`, `proxyRouteFor`,
`proxyEnvironmentForChild`, and `clearedProxyEnv` — one per way a caller
can need the policy. Installation absorbs resolution and diagnostic
reporting, which no caller needed apart.

`proxyRouteFor` also closes a defect the old accessor made expressible:
`web-fetch-http` read the policy to decide whether to pin, then read it
again to build a transport, so an unmount between the two returned a
direct, unpinned agent for a URL the first read had cleared as proxied.
A route carries the answer and the transport that answer assumed.

Every egress spec now installs through `installProxyFromEnvironment`, so
no test asserts a policy object a real launch could not produce.
2026-09-01 21:15:04 +08:00
..

description, kind
description kind
Package map for the durable session data plane: the persistence seam and its backends, checkpoint policy, projections, log-backed titles, and outbound session telemetry. package-group

session/ — durable session data plane

English | 中文

Summary

The session group makes an agent's conversation durable and reusable outside the live loop: the persistence seam stores the event log and restores it on resume, the checkpoint policy keeps requests, tool side effects, and completed steps durable before the next action, projections serve whole log-derived values to client carriers, titles name each session from its content, and telemetry reports session activity outbound. Mount the shipped JSONL persistence provider first, then add the checkpoint policy and any projection, title, or telemetry packages the deployment needs. This page maps the group; every package README owns its contract, and session-query/ is a sibling group whose read/tool surface consumes persistence independently.

Table of Contents


Packages

The group splits into four families: durable storage (persistence seam, backends, checkpoint policy), projections, titles, and telemetry. Each package README owns its contract and configuration.

Persistence

Package Role ctx key
session-persistence/ Defines the durable session-storage service and the shared write coordination every backend composes ctx.sessionPersistence
session-persistence-jsonl/ Shipped backend: one append-only JSONL log per session, optionally Zstandard-compressed registers on ctx.sessionPersistence
session-checkpoint-policy/ Makes model requests, top-level tool side effects, and completed steps durable before the next action wraps ctx.llm and ctx.tools
session-log-deepseek/ Uploads the incremental canonical log as optional official DeepSeek request metadata contributes dsh_session_log

Projection

Package Role ctx key
session-projection/ Defines and drives projection units that fold committed events into whole current values ctx.sessionProjections
session-projection-cache/ Persists projection checkpoints so cold reads skip full log loads ctx.sessionProjectionCache
session-stats/ Serves whole-log conversation counts and wall times through the sessionStats unit registers on ctx.sessionProjections
session-turn-outline/ Serves the whole-log turn outline (turn, turn/start seq, prompt preview) through the turnOutline unit registers on ctx.sessionProjections

Titles

Package Role ctx key
session-title/ Log-backed session titles with a deterministic fallback and one optional provider ctx.sessionTitle
session-title-llm/ Shared model-backed title-generation policy for the provider packages library — no ctx key
session-title-first-prompt-llm/ Titles a session from its first eligible human message registers on ctx.sessionTitle
session-title-all-prompts-llm/ Titles a session from all eligible human messages registers on ctx.sessionTitle

Telemetry

Package Role ctx key
session-telemetry/ Captures session activity and hands records to a configured reporting backend ctx.sessionTelemetry
session-telemetry-otel/ Delivers telemetry through OpenTelemetry logs in FULL, FEEDBACK_ONLY, or DISABLED mode registers on ctx.sessionTelemetry

Only one title provider may register at a time; without one, the title service keeps its deterministic fallback. The subsystem pages below are the backend-neutral references for each family.


Dev Note

None.