Skip to content

feat(session): add SessionOptions.sessionLogUpload: "off" with DSH support - #1106

Merged
stamp-build[bot] merged 1 commit into
mainfrom
agent/lookout/session-log-upload
Nov 21, 2026
Merged

stamp-build[bot] merged 1 commit into
mainfrom
agent/lookout/session-log-upload

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Lookout from open-agent-runtime opened this pull request through Stamp
View in Stamp →


Summary

Add SessionOptions.sessionLogUpload?: "off" so hosts can stop a runtime from sending the session's transcript or log to its vendor outside the model requests themselves, implement it on DSH (>= 0.2.1-rc.5), declare honest refusals across all other runtimes, and document DSH's default upload path, user/host off switches, dsh_plugin_packages boundary, and web/deepseek-search-llm-request usage gap.

Requested and shape-approved by Cindy in #core:#397 for Raft's DSH agents.

Release notes

New

  • SessionOptions.sessionLogUpload?: "off". Stops the runtime sending the session's transcript or log to its vendor outside the model requests themselves. Omitted preserves the user's and runtime's own settings; there is no "on". When given, "off" wins over a user opt-in (the protective direction). Separate telemetry metrics are out of scope. Supply it again on resume.
  • DSH sessionLogUpload: "off" (>= 0.2.1-rc.5). Appends { id: "session-log-deepseek", name: "@deepseek-ai/dsh-session-log-deepseek", config: { enabled: false } } to OAR's private invocation --patch (editing no user file, overriding home enabled: true, coexisting with home disabled: true, covering root turns, native subagent children, and resumed sessions) and verifies loader.entries() fail-closed after loader.await() before any agent or provider request (UnsupportedOptionError("sessionLogUpload", ...) if unverified).
  • Honest refusals on all other runtimes. Every other built-in and community runtime declares refusedSessionOptions.sessionLogUpload and rejects sessionLogUpload: "off" at open with UnsupportedOptionError("sessionLogUpload", ...) rather than silently ignoring it.

Native verification (DSH 0.2.2-rc.5 and 0.2.1-rc.5 package check)

Verified on real DSH 0.2.2-rc.5 against a loopback DeepSeek Messages server (DEEPSEEK_BASE_URL + synthetic DEEPSEEK_API_KEY, isolated DSH_HOME, OAR's --profile acp --patch launch), and confirmed @deepseek-ai/dsh-session-log-deepseek is also shipped in [email protected]:

  • Default deepseek-official: POST /v1/messages carries dsh_session_log (on root turns, spawned native subagent child turns, and resumed turns) and records session-log-deepseek/delivery-accepted.
  • DSH_TELEMETRY_DISABLED=1 alone: does not stop dsh_session_log (it only disables session-telemetry-otel).
  • Non-DeepSeek (llm-pi-ai) routes: do not send dsh_session_log even with session-log-deepseek enabled (only dsh-llm-deepseek consumes deepseekLlmApiExtensions).
  • User home patch ($DSH_HOME/cordis.patch.yml): [{"id":"session-log-deepseek","config":{"enabled":false}}] removes dsh_session_log and session-log-deepseek/delivery-accepted.
  • OAR sessionLogUpload: "off": removes dsh_session_log and session-log-deepseek/delivery-accepted across root turns, native subagent child turns, and resumed sessions, even when $DSH_HOME/cordis.patch.yml explicitly sets enabled: true, without editing user files.
  • Separate fields/events documented in docs/runtimes/dsh.md: official DeepSeek requests also carry dsh_plugin_packages (plugin-package-inventory-deepseek), which sessionLogUpload: "off" does not disable; web/deepseek-search-llm-request logs only the outbound search request before dispatch with no usage event, so Session.usage() cannot count it.

Call-site audit

Audited every RefusableSessionOption / refusedSessionOptions / SessionOptions / launchDsh call site across the repo:

  • Changed:
    • packages/oar/src/contracts/session-options.ts, packages/oar/src/contracts/runtime.ts, packages/oar/src/shared/session-options.ts: added SessionOptions.sessionLogUpload?: "off", "sessionLogUpload" to RefusableSessionOption, and included "sessionLogUpload" in refuseSessionOptions.
    • packages/oar/src/runtimes/dsh/{options.ts,index.ts,launch.ts,bridge.ts,session.ts,skills.ts,list-models.ts}: added dshSessionLogUploadRefusal(version) (gated at 0.2.1-rc.5, checked in sessionCapabilities and before dshVersionRefusal in dshSession), DshLaunchOptions.disableSessionLogUpload, CLI --patch row for session-log-deepseek, fail-closed loader.entries() verification after loader.await() before boot(), and UnsupportedOptionError("sessionLogUpload", ...) mapping in openFailure.
    • All 14 other built-in runtimes (antigravity, claude, codebuddy, codex, cursor, devin, factory, grok, kimi, opencode, pi, pi-durable, qoder, qwen) and both community runtimes (morph, cybion): added sessionLogUpload refusal reason. (cursorSubprocessRefusedSessionOptions, opencodeV1RefusedSessionOptions, and piRpcRefusedSessionOptions inherit it via object spread.)
    • docs/spec/runtime-matrix.md and docs/runtimes/dsh.md: documented sessionLogUpload: "off", DSH defaults and user/host switches, dsh_plugin_packages boundary, DSH_TELEMETRY_DISABLED scope, and web/deepseek-search-llm-request usage gap.
    • tests/fixtures/fake-dsh.mjs, tests/refused-session-options.test.ts, tests/session-capability-declaration.test.ts, tests/dsh/session-log-upload.test.ts, sea-trial/vendor/dsh-session-log-upload.vendor.test.ts: added unit tests for refusal declarations across all runtimes, DSH version gating, fail-closed bridge checks (missing loader.entries, missing plugin, name mismatch, unapplied config, inactive fiber), and real-DSH loopback vendor tests covering default upload vs sessionLogUpload: "off" across root, subagent child, and resumed sessions.
  • Unchanged (and why):
    • dshListModels and dshSkills (packages/oar/src/runtimes/dsh/list-models.ts, skills.ts): updated only for launchDsh options-object signature; neither opens a live session or sends dsh_session_log.
    • sea-trial/vendor/dsh-name-tools.vendor.test.ts, sea-trial/vendor/dsh-system-prompt.vendor.test.ts: pass only 3 arguments to launchDsh; default options object preserves behavior unchanged.
    • Other runtimes' session implementations: no verified upload switch yet (out of scope for #core:#397; tracked separately).

Verification

  • OAR_TEST=dsh-aimock OAR_DSH_BIN=/tmp/probe-dsh-file/prefix/bin/dsh pnpm vitest run sea-trial/vendor/dsh-session-log-upload.vendor.test.ts on real DSH 0.2.2-rc.5: passed (default sends dsh_session_log + delivery-accepted; sessionLogUpload: "off" suppresses both across root, subagent child, and resumed session even over home enabled: true).
  • OAR_TEST=dsh-aimock OAR_DSH_BIN=/tmp/probe-dsh-file/prefix/bin/dsh pnpm exec tsx sea-trial/main.ts session.capabilities-match-declaration: passed.
  • CI=1 OAR_COMMUNITY_TESTS=1 pnpm run check && pnpm run build: passed (typecheck, oxlint 0 warnings / 0 errors, all unit + community tests, mock sea-trial, build).

@stamp-build
stamp-build Bot merged commit 4bcc966 into main Nov 21, 2026
25 checks passed
@stamp-build
stamp-build Bot deleted the agent/lookout/session-log-upload branch November 21, 2026 09:58
@stamp-build stamp-build Bot mentioned this pull request Nov 21, 2026
stamp-build Bot added a commit that referenced this pull request Nov 21, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_181cd54194df4f34ad7de17509f925dc"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup>

---
<!-- /stamp:review:v1 -->

## OAR 0.128.0

### Behavior changes hosts should know

- **`turn_ended` is the last event of its turn** (#1101). In a frame that closes a turn, usage and context reports now come before `turn_ended`, and nothing follows `turn_ended` in that frame unless a `turn_active` opens the next turn first. Before, Claude, Qwen, Qoder and the other shared stream-json runtimes, the ACP runtimes, and Pi (SDK and RPC) could put the closing usage after `turn_ended`; Pi also put a refused input's report after its command events. The scripted test runtime follows the same order. Reports that arrive in a later frame (Kimi `usage_update` after its bounded wait, the Qwen and Factory context reply after its one-second bound) are recorded where they arrive and folded into `usage()` and `contextUsage()`; they are not attached to the turn that already ended. Hosts that treated `turn_ended` as "this turn's data is complete" get the closing usage earlier; hosts that read usage only from events after `turn_ended` must read it from the same frame instead. The rule is in docs/spec/record-stream.md.
- **`listModels` reports `unauthenticated` instead of an empty list when credentials are missing** (#1105).
  - DSH with no DeepSeek key used to answer `ok` with no models. It now answers `unauthenticated`, and the detail names the default route (`deepseek-official/deepseek-flash`) and says to configure credentials for it. With a key, the list is unchanged (`deepseek-flash`, `deepseek-v4-pro`).
  - The in-process Pi SDK answers `unauthenticated` when no provider has credentials but Pi's catalog is not empty, naming the saved default when there is one. Pi RPC exposes only the available models, so it keeps `ok` with an empty list (documented in docs/runtimes/pi.md).
  - All 17 built-in and community runtimes were probed signed out on real installs; only DSH and Pi SDK changed.

### New

- **`SessionOptions.sessionLogUpload: "off"`** (#1106). This option stops the runtime from sending the session's transcript or log to its vendor outside the model requests themselves. Leaving it out keeps the user's and runtime's own settings. There is no `"on"`, and when given it wins over a user opt-in. Separate telemetry metrics are out of scope. Give it again on resume.
  - DSH (0.2.1-rc.5 and later): DSH's bundled `session-log-deepseek` plugin is on by default and attaches pending session events (system prompt, messages, reasoning, tool calls, images; up to 8 MiB per request) to every request on official DeepSeek routes. With the option, OAR's private launch patch sets `enabled: false`, and the bridge confirms the setting took effect before any agent or model request starts; if it cannot confirm, the open fails with `UnsupportedOptionError("sessionLogUpload")`. Verified on DSH 0.2.2-rc.5 for root turns, native subagent children and resumed sessions, including over a user `enabled: true`. DSH's `DSH_TELEMETRY_DISABLED` does not stop this upload. Official requests also carry a separate plugin inventory field (`dsh_plugin_packages`) that this option does not cover. See docs/runtimes/dsh.md "Session-log upload".
  - Every other runtime refuses the option with `UnsupportedOptionError` (`refusedSessionOptions.sessionLogUpload`) until a switch is verified for it.
  - This adds a key to `RefusableSessionOption`, so exhaustive switches over that type need a case.

### Docs

- README has a Contributing section (#1102, #1103): issues and pull requests from people and agents are welcome, issues preferred. AI-written contributions need no human manual check if the AI verified them in a real environment. Projects using both Raft and OAR can ask [email protected] for a joint channel.
- docs/runtimes/dsh.md notes that DSH's auxiliary web-search model calls report no usage, so `usage()` cannot count them.

### Tests and CI

- The push matrix on `main` keeps the jobs an audit showed to guard contracts; the remaining platform legs run in a daily sharded matrix, and tests that checked no contract were removed (#1100). The commit gate in docs/development.md is `CI=1 pnpm run check`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Cindy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants