Repository navigation
feat(session): add SessionOptions.sessionLogUpload: "off" with DSH support - #1106
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_packagesboundary, andweb/deepseek-search-llm-requestusage gap.Requested and shape-approved by Cindy in
#core:#397for 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.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 homeenabled: true, coexisting with homedisabled: true, covering root turns, nativesubagentchildren, and resumed sessions) and verifiesloader.entries()fail-closed afterloader.await()before any agent or provider request (UnsupportedOptionError("sessionLogUpload", ...)if unverified).refusedSessionOptions.sessionLogUploadand rejectssessionLogUpload: "off"at open withUnsupportedOptionError("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.5against a loopback DeepSeek Messages server (DEEPSEEK_BASE_URL+ syntheticDEEPSEEK_API_KEY, isolatedDSH_HOME, OAR's--profile acp --patchlaunch), and confirmed@deepseek-ai/dsh-session-log-deepseekis also shipped in[email protected]:deepseek-official:POST /v1/messagescarriesdsh_session_log(on root turns, spawned nativesubagentchild turns, and resumed turns) and recordssession-log-deepseek/delivery-accepted.DSH_TELEMETRY_DISABLED=1alone: does not stopdsh_session_log(it only disablessession-telemetry-otel).llm-pi-ai) routes: do not senddsh_session_logeven withsession-log-deepseekenabled (onlydsh-llm-deepseekconsumesdeepseekLlmApiExtensions).$DSH_HOME/cordis.patch.yml):[{"id":"session-log-deepseek","config":{"enabled":false}}]removesdsh_session_logandsession-log-deepseek/delivery-accepted.sessionLogUpload: "off": removesdsh_session_logandsession-log-deepseek/delivery-acceptedacross root turns, nativesubagentchild turns, and resumed sessions, even when$DSH_HOME/cordis.patch.ymlexplicitly setsenabled: true, without editing user files.docs/runtimes/dsh.md: official DeepSeek requests also carrydsh_plugin_packages(plugin-package-inventory-deepseek), whichsessionLogUpload: "off"does not disable;web/deepseek-search-llm-requestlogs only the outbound search request before dispatch with no usage event, soSession.usage()cannot count it.Call-site audit
Audited every
RefusableSessionOption/refusedSessionOptions/SessionOptions/launchDshcall site across the repo:packages/oar/src/contracts/session-options.ts,packages/oar/src/contracts/runtime.ts,packages/oar/src/shared/session-options.ts: addedSessionOptions.sessionLogUpload?: "off","sessionLogUpload"toRefusableSessionOption, and included"sessionLogUpload"inrefuseSessionOptions.packages/oar/src/runtimes/dsh/{options.ts,index.ts,launch.ts,bridge.ts,session.ts,skills.ts,list-models.ts}: addeddshSessionLogUploadRefusal(version)(gated at0.2.1-rc.5, checked insessionCapabilitiesand beforedshVersionRefusalindshSession),DshLaunchOptions.disableSessionLogUpload, CLI--patchrow forsession-log-deepseek, fail-closedloader.entries()verification afterloader.await()beforeboot(), andUnsupportedOptionError("sessionLogUpload", ...)mapping inopenFailure.antigravity,claude,codebuddy,codex,cursor,devin,factory,grok,kimi,opencode,pi,pi-durable,qoder,qwen) and both community runtimes (morph,cybion): addedsessionLogUploadrefusal reason. (cursorSubprocessRefusedSessionOptions,opencodeV1RefusedSessionOptions, andpiRpcRefusedSessionOptionsinherit it via object spread.)docs/spec/runtime-matrix.mdanddocs/runtimes/dsh.md: documentedsessionLogUpload: "off", DSH defaults and user/host switches,dsh_plugin_packagesboundary,DSH_TELEMETRY_DISABLEDscope, andweb/deepseek-search-llm-requestusage 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 (missingloader.entries, missing plugin, name mismatch, unapplied config, inactive fiber), and real-DSH loopback vendor tests covering default upload vssessionLogUpload: "off"across root, subagent child, and resumed sessions.dshListModelsanddshSkills(packages/oar/src/runtimes/dsh/list-models.ts,skills.ts): updated only forlaunchDshoptions-object signature; neither opens a live session or sendsdsh_session_log.sea-trial/vendor/dsh-name-tools.vendor.test.ts,sea-trial/vendor/dsh-system-prompt.vendor.test.ts: pass only 3 arguments tolaunchDsh; default options object preserves behavior unchanged.#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.tson real DSH0.2.2-rc.5: passed (default sendsdsh_session_log+delivery-accepted;sessionLogUpload: "off"suppresses both across root, subagent child, and resumed session even over homeenabled: 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).