refactor: add SDK transcript identity target API#95030
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 20, 2026, 1:27 PM ET / 17:27 UTC. Summary PR surface: Source +406, Tests +441, Docs +3, Config +4, Generated 0, Other +5. Total +859 across 14 files. Reproducibility: not applicable. This is a public SDK/API refactor PR rather than a bug report; the review target is API behavior, proof quality, and merge risk. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge only after maintainers explicitly accept this transcript SDK contract as the intended Path 3 public boundary and are comfortable with the upgrade, security-boundary, and session-state implications. Do we have a high-confidence way to reproduce the issue? Not applicable. This is a public SDK/API refactor PR rather than a bug report; the review target is API behavior, proof quality, and merge risk. Is this the best way to solve the issue? Yes, contingent on maintainer API acceptance. The combined identity/target/read/write/lock subpath is a coherent shape over the existing accessor seam and avoids the narrower raw-export approach, but it is still a public contract decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ad5d2cbc1bcb. Label changesLabel justifications:
Evidence reviewedPR surface: Source +406, Tests +441, Docs +3, Config +4, Generated 0, Other +5. Total +859 across 14 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
|
||
| Prefer `getSessionEntry(...)`, `listSessionEntries(...)`, `patchSessionEntry(...)`, or `upsertSessionEntry(...)` for session workflows. These helpers address sessions by agent/session identity so plugins do not depend on the legacy `sessions.json` storage shape. Use `preserveActivity: true` for metadata-only patches that should not refresh session activity, and `replaceEntry: true` only when the callback returns a complete entry and deleted fields must stay deleted. | ||
|
|
||
| For transcript reads and writes, import `openclaw/plugin-sdk/session-transcript-runtime` and use `resolveSessionTranscriptIdentity(...)`, `resolveSessionTranscriptTarget(...)`, `readSessionTranscriptEvents(...)`, `appendSessionTranscriptMessageByIdentity(...)`, or `withSessionTranscriptWriteLock(...)` with `{ agentId, sessionKey, sessionId }`. These APIs return stable transcript identity and storage-neutral memory hit keys without exposing `sessionFile` as the identity. `sessionFile` is deprecated transitional compatibility for plugins that already own an active transcript file artifact during the pre-SQLite window and need scoped helpers to bind to that artifact; new code should use structured transcript identity before the SQLite storage flip. |
There was a problem hiding this comment.
This reads like implementation notes moreso than actual public documentation.
There was a problem hiding this comment.
Addressed in f3d4c70: rewrote the SDK runtime docs to describe the caller-visible transcript operations and when to pass an active transcript artifact, without implementation/storage migration wording.
| | `plugin-sdk/reply-reference` | `createReplyReferencePlanner` | | ||
| | `plugin-sdk/reply-chunking` | Narrow text/markdown chunking helpers | | ||
| | `plugin-sdk/session-store-runtime` | Session workflow helpers (`getSessionEntry`, `listSessionEntries`, `patchSessionEntry`, `upsertSessionEntry`), legacy session store path/session-key helpers, updated-at reads, and transition-only whole-store/file-path compatibility helpers | | ||
| | `plugin-sdk/session-transcript-runtime` | Transcript identity, scoped target/read/write helpers, and storage-neutral memory hit key helpers that do not expose `sessionFile` as identity | |
There was a problem hiding this comment.
See previous comment. No need to mention storage-neutral or not exposing sessionFile
There was a problem hiding this comment.
Addressed in f3d4c70: simplified the subpath row to list the public capabilities only.
| return await activeLockRunner(() => appendSessionTranscriptMessageLocked(params)); | ||
| } | ||
|
|
||
| export async function runSessionTranscriptAppendTransaction<T>( |
There was a problem hiding this comment.
If this is public interface it should have a docstring
There was a problem hiding this comment.
Addressed in f3d4c70: added a docstring for runSessionTranscriptAppendTransaction.
| } | ||
|
|
||
| /** | ||
| * Builds the storage-neutral memory hit key for one session transcript. |
There was a problem hiding this comment.
Stop talking about storage-neutral. That's an implementation detail.
There was a problem hiding this comment.
Addressed in f3d4c70: removed storage implementation language from the public SDK docstrings and kept them focused on behavior.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
b562ce5 to
cb9f329
Compare
…identity-target-api
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…26.6.10) (#1256) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/openclaw/openclaw](https://openclaw.ai) ([source](https://github.com/openclaw/openclaw)) | patch | `2026.6.9` → `2026.6.10` | --- ### Release Notes <details> <summary>openclaw/openclaw (ghcr.io/openclaw/openclaw)</summary> ### [`v2026.6.10`](https://github.com/openclaw/openclaw/blob/HEAD/CHANGELOG.md#2026610) [Compare Source](openclaw/openclaw@v2026.6.9...v2026.6.10) ##### Highlights - **Automatic fast mode for talks:** OpenClaw can enable fast mode for short conversational turns, then return to normal mode for longer runs with bounded fallback and delivery behavior. ([#​85104](openclaw/openclaw#85104)) Thanks [@​alexph-dev](https://github.com/alexph-dev) and [@​vincentkoc](https://github.com/vincentkoc). - **More reliable model routing:** Zai model synthesis, GLM overload failover, and native reasoning-level selection now follow the active model catalog more consistently. ([#​94461](openclaw/openclaw#94461), [#​93241](openclaw/openclaw#93241), [#​94067](openclaw/openclaw#94067), [#​94136](openclaw/openclaw#94136)) Thanks [@​Pandah97](https://github.com/Pandah97), [@​chrysb](https://github.com/chrysb), [@​0xghost42](https://github.com/0xghost42), [@​zhengli0922](https://github.com/zhengli0922), [@​openperf](https://github.com/openperf), [@​civiltox](https://github.com/civiltox), and [@​BorClaw](https://github.com/BorClaw). - **Safer session and channel state:** channel switches reset stale origin fields, and cron delivery awareness stays attached to the target session. ([#​95328](openclaw/openclaw#95328), [#​93580](openclaw/openclaw#93580)) Thanks [@​ZengWen-DT](https://github.com/ZengWen-DT), [@​jalehman](https://github.com/jalehman), [@​gorkem2020](https://github.com/gorkem2020), and [@​scotthuang](https://github.com/scotthuang). - **Trusted policies survive hook composition:** composed hook registries keep the trusted tool policies required by approval-sensitive flows. ([#​94545](openclaw/openclaw#94545)) Thanks [@​jesse-merhi](https://github.com/jesse-merhi). ##### Changes - **Agent and channel runtime:** fast-mode state now survives retries, fallback transitions, progress events, and embedded/CLI/ACP normalization; session and channel routing retain the current target and delivery context. ([#​85104](openclaw/openclaw#85104), [#​93580](openclaw/openclaw#93580), [#​95328](openclaw/openclaw#95328)) Thanks [@​alexph-dev](https://github.com/alexph-dev), [@​vincentkoc](https://github.com/vincentkoc), [@​scotthuang](https://github.com/scotthuang), [@​ZengWen-DT](https://github.com/ZengWen-DT), [@​jalehman](https://github.com/jalehman), and [@​gorkem2020](https://github.com/gorkem2020). - **Provider behavior:** model catalogs now supply the correct Zai base URL, overload classification, and native reasoning controls for live-discovered models. ([#​94461](openclaw/openclaw#94461), [#​93241](openclaw/openclaw#93241), [#​94067](openclaw/openclaw#94067), [#​94136](openclaw/openclaw#94136)) Thanks [@​Pandah97](https://github.com/Pandah97), [@​chrysb](https://github.com/chrysb), [@​0xghost42](https://github.com/0xghost42), [@​zhengli0922](https://github.com/zhengli0922), [@​openperf](https://github.com/openperf), [@​civiltox](https://github.com/civiltox), and [@​BorClaw](https://github.com/BorClaw). ##### Fixes - **Fast-mode and policy correctness:** fallback cutoffs and reset notices are bounded, repeated progress events remain visible, Codex service-tier state is normalized, and trusted policies are not lost when hook registries are composed. ([#​85104](openclaw/openclaw#85104), [#​94545](openclaw/openclaw#94545)) Thanks [@​alexph-dev](https://github.com/alexph-dev), [@​vincentkoc](https://github.com/vincentkoc), and [@​jesse-merhi](https://github.com/jesse-merhi). - **Model and delivery edge cases:** Zai and GLM failover paths use the right runtime metadata, while stale channel-origin state no longer leaks across session changes. ([#​94461](openclaw/openclaw#94461), [#​93241](openclaw/openclaw#93241), [#​95328](openclaw/openclaw#95328)) Thanks [@​Pandah97](https://github.com/Pandah97), [@​chrysb](https://github.com/chrysb), [@​0xghost42](https://github.com/0xghost42), [@​zhengli0922](https://github.com/zhengli0922), [@​ZengWen-DT](https://github.com/ZengWen-DT), [@​jalehman](https://github.com/jalehman), and [@​gorkem2020](https://github.com/gorkem2020). - **Provider plugin onboarding:** setup refreshes provider plugin registry metadata after installing setup-selected provider plugins, so auth continuation uses the newly installed provider instead of stale registry state. ([#​95792](openclaw/openclaw#95792)) Thanks [@​snowzlmbot](https://github.com/snowzlmbot). ##### Complete contribution record This audited record covers the complete v2026.6.9..HEAD history: 12 merged PRs. The generation manifest also supplies direct commits as editorial input; the grouped notes above prioritize user impact. ##### Pull requests - **PR [#​86627](openclaw/openclaw#86627 Keep core doctor health in contribution order. Thanks [@​giodl73-repo](https://github.com/giodl73-repo). - **PR [#​93580](openclaw/openclaw#93580 fix: preserve cron delivery awareness for target sessions. Thanks [@​scotthuang](https://github.com/scotthuang) and [@​jalehman](https://github.com/jalehman). - **PR [#​95030](openclaw/openclaw#95030 refactor: add SDK transcript identity target API. Thanks [@​jalehman](https://github.com/jalehman). - **PR [#​94838](openclaw/openclaw#94838 refactor(copilot): complete harness lifecycle parity. Thanks [@​vincentkoc](https://github.com/vincentkoc). - **PR [#​95328](openclaw/openclaw#95328 fix(sessions): reset stale per-channel origin fields on channel switch. Related [#​95325](openclaw/openclaw#95325). Thanks [@​ZengWen-DT](https://github.com/ZengWen-DT) and [@​jalehman](https://github.com/jalehman) and [@​gorkem2020](https://github.com/gorkem2020). - **PR [#​94461](openclaw/openclaw#94461 fix(zai): fall back to manifest baseUrl for synthesized GLM-5 models. Related [#​94269](openclaw/openclaw#94269). Thanks [@​Pandah97](https://github.com/Pandah97) and [@​chrysb](https://github.com/chrysb). - **PR [#​93241](openclaw/openclaw#93241 fix(agents): classify Zhipu GLM overload as overloaded for failover. Related [#​93211](openclaw/openclaw#93211). Thanks [@​0xghost42](https://github.com/0xghost42) and [@​zhengli0922](https://github.com/zhengli0922). - **PR [#​94067](openclaw/openclaw#94067 fix(channels): resolve native /think menu levels via runtime catalog for live-discovered models. Related [#​93835](openclaw/openclaw#93835). Thanks [@​openperf](https://github.com/openperf) and [@​civiltox](https://github.com/civiltox). - **PR [#​94136](openclaw/openclaw#94136 fix(zai): expose GLM-5.2 reasoning levels \[AI-assisted]. Thanks [@​BorClaw](https://github.com/BorClaw). - **PR [#​85104](openclaw/openclaw#85104 feat: fast talks auto mode. Related [#​85087](openclaw/openclaw#85087). Thanks [@​alexph-dev](https://github.com/alexph-dev). - **PR [#​94545](openclaw/openclaw#94545 fix: keep trusted policies with hook registry. Thanks [@​jesse-merhi](https://github.com/jesse-merhi). - **PR [#​95792](openclaw/openclaw#95792 fix(onboard): refresh provider plugin registry after setup installs. Related [#​95765](openclaw/openclaw#95765). Thanks [@​snowzlmbot](https://github.com/snowzlmbot). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1256
What
Adds one combined public SDK transcript runtime API bundle for Path 3. This supersedes #89261 and #89262 by exposing the coherent contract in a single review unit: stable transcript identity plus scoped transcript target/read/write/publish/lock helpers.
Why
#89261 and #89262 were split across a stale stack, but the public API is one contract. Plugins need identity helpers and scoped target writers together so reads, appends, update publishes, and write locks bind to the same session transcript target without treating
sessionFileas durable identity. The compatibility behavior remains additive and limited to callers that already receive active transcript artifacts.Changes
Changes Walkthrough
src/plugin-sdk/session-transcript-runtime.tssrc/config/sessions/transcript-append.tssrc/config/sessions/session-accessor.tssrc/plugin-sdk/session-transcript-hit.tssrc/plugin-sdk/session-transcript-memory-hit.tsdocs/plugins/sdk-runtime.mddocs/plugins/sdk-subpaths.mdpackage.json/scripts/lib/plugin-sdk-entrypoints.jsondocs/.generated/plugin-sdk-api-baseline.sha256Verification
pnpm docs:list- passed after workspace deps installednode scripts/run-vitest.mjs src/plugin-sdk/session-transcript-runtime.test.ts src/plugin-sdk/session-transcript-hit.test.ts src/config/sessions/session-accessor.test.ts- passednode scripts/sync-plugin-sdk-exports.mjs --check- passednode scripts/check-plugin-sdk-subpath-exports.mjs- passednode --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --check- passednode scripts/check-session-accessor-boundary.mjs- passed./node_modules/.bin/oxfmt --check --threads=1 ...- passednode scripts/format-docs.mjs --check docs/plugins/sdk-runtime.md docs/plugins/sdk-subpaths.md- passednode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ...- passednode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/sdk-transcript-api-core.tsbuildinfo- passednode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/sdk-transcript-api-core-test.tsbuildinfo- passedgit diff --check- passed.agents/skills/autoreview/scripts/autoreview --mode local --base upstream/main ...- first run found a read-side mutation bug; fixed and retested.agents/skills/autoreview/scripts/autoreview --mode local --base upstream/main ...- cleanRefs #88838.
Supersedes #89261.
Supersedes #89262.
Real behavior proof
Behavior addressed: Public SDK transcript runtime contract for Path 3: stable transcript identity plus scoped target/read/write/lock helpers, including deprecated
sessionFilecompatibility for callers that already receive an active transcript artifact.Real environment tested: Local PR checkout on macOS, PR head
1125743c702f0c66c609ff343090a0a0f7556385, Nodev24.15.0. The proof imported the built package subpaths aftercorepack pnpm build.Exact steps or command run after this patch:
Evidence after fix: Focused Vitest passed 2 shards with 42 tests. SDK subpath/export/surface checks passed with public callable exports budgeted at 5183. Oxfmt, oxlint, both tsgo wrappers,
git diff --check, andcorepack pnpm buildpassed. The standalone package-import proof exited 0 and printed:{ "importSurface": "openclaw/plugin-sdk/session-transcript-runtime", "hitSubpathImportSurface": "openclaw/plugin-sdk/session-transcript-hit", "memoryKey": "transcript:main:proof-session%3Acurrent-head", "hitSubpathSameKey": true, "parsedAgentId": "main", "hitParsedAgentId": "main", "resolvedKeys": ["agent:main:proof"], "identityReturnedSessionFile": false, "targetReturnedSessionFile": false, "targetKind": "active-session-file", "lockedTargetReturnedSessionFile": false, "beforeCount": 2, "malformedLineSkipped": true, "appendReturnedMessage": true, "afterCount": 4, "persistedContainsAppend": true, "persistedContainsLockAppend": true, "publishWithStaleInputCompleted": true, "finalStoreSessionFileUnchanged": true } {"cleanupRemoved":true}Autoreview result:
.agents/skills/autoreview/scripts/autoreview --mode local --base upstream/main ...exited 0:autoreview clean: no accepted/actionable findings reported; overall patch correct, confidence 0.84.Observed result after fix: The built public package export resolved from
openclaw/plugin-sdk/session-transcript-runtime, and the existing hit subpath resolved the same memory key helpers without importing the transcript runtime writer/read-lock path. Identity, target, and locked target helpers returned public shapes withoutsessionFile. Reads skipped malformed JSONL rows, append and write-lock helpers persisted to the active transcript target, publish helpers completed while overriding stale caller-supplied publish identity internally, and cleanup removed the temporary proof state.What was not tested: No third-party plugin package was installed, no future SQLite runtime flip was exercised, and no broad Crabbox/Testbox matrix was run for this narrow import-boundary fix. The proof used the current built package and focused SDK/runtime checks rather than restarting the local live gateway. A full local
pnpm testrun was also attempted on this machine and failed in unrelated provider, tooling, infra, media, iMessage, and security shards; the transcript SDK tests and SDK surface checks pass after the budget correction.