Skip to content

refactor: migrate bundled session metadata reads#96527

Merged
jalehman merged 1 commit into
openclaw:mainfrom
jalehman:josh/path3-bundled-session-metadata-accessors-pr
Jun 24, 2026
Merged

refactor: migrate bundled session metadata reads#96527
jalehman merged 1 commit into
openclaw:mainfrom
jalehman:josh/path3-bundled-session-metadata-accessors-pr

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bundled plugins still had several read-only session metadata lookups that loaded or resolved whole session stores while Path 3 is moving runtime reads behind the session accessor seam. That kept model-picker, dispatch, routing, and group-activation paths coupled to broader store reads.

Why This Change Was Made

This finishes the remaining bundled read-only metadata slice after #96507 merged the narrower Feishu/Mattermost/runtime barrel cleanup. The branch was rebuilt on current main after #96507, preserving only the unique accessor migrations and avoiding duplicate Feishu/runtime-barrel churn.

User Impact

No user-facing command behavior should change. Discord, Mattermost, Slack, Matrix, Codex, and Telegram metadata reads now use targeted getSessionEntry access, with latest-read support where command UIs need fresh model/runtime overrides. Parent-session model override resolution can now load only the parent entry instead of the whole store.

Evidence

  • Rebuilt branch from upstream/main at 4d4769c0d6a55cecb40ac3910527e0eb0a1232f1, the refactor: narrow bundled session runtime barrels #96507 merge commit.
  • Overlap with refactor: narrow bundled session runtime barrels #96507 is limited to Mattermost model-picker and shared runtime/ratchet files; Feishu barrel cleanup remains owned by refactor: narrow bundled session runtime barrels #96507 and is not reintroduced here.
  • node scripts/check-session-accessor-boundary.mjs
  • node scripts/run-vitest.mjs src/auto-reply/reply/stored-model-override.test.ts test/scripts/check-session-accessor-boundary.test.ts extensions/mattermost/src/mattermost/model-picker.test.ts extensions/discord/src/monitor/native-command.model-picker.test.ts extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/bot-native-commands.session-meta.test.ts
  • git diff --check
  • pnpm lint:tmp:session-accessor-boundary
  • pnpm exec oxfmt --check --threads=1 <touched files>
  • pnpm tsgo:test:src
  • AGENTS_HOME="$HOME/.agents" "$HOME/.agents/skills/autoreview/scripts/autoreview" --mode local
  • Live proof on /Users/phaedrus/Projects/clawdbot: recorded original detached live SHA 352c4a40d838d7deb0bfdf38fa33665aef00be72, checked out proof SHA 9bc2ea1652d6a25666cd0d80a77bdf7c040c9774, ran pnpm build, pnpm openclaw gateway restart, pnpm openclaw gateway status --deep --require-rpc --json, curl -fsS http://127.0.0.1:18789/healthz, curl -fsS http://127.0.0.1:18789/readyz, and pnpm openclaw gateway call health --json.
  • Live read probe on proof SHA read existing live agent:main:main and Telegram group/topic session keys with readConsistency: "latest", resolved Discord and Mattermost current-model helper output as openai/gpt-5.5-codex, and confirmed the live store had 54 entries with no parent-session chain to exercise without writing synthetic state.
  • Restored live checkout to detached SHA 352c4a40d838d7deb0bfdf38fa33665aef00be72, rebuilt, restarted the gateway, and confirmed RPC health with Discord and Telegram both connected.

Refs #88838.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: telegram Channel integration: telegram scripts Repository scripts extensions: codex size: M maintainer Maintainer-authored PR labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 3:11 PM ET / 19:11 UTC.

Summary
The PR migrates bundled Discord, Mattermost, Slack, Matrix, Telegram, and Codex session metadata reads from whole-store helpers to targeted session accessors, adds latest-read support to the accessor runtime path, updates stored model override inheritance, and extends the session-accessor boundary ratchet.

PR surface: Source -36, Tests +45, Other +8. Total +17 across 22 files.

Reproducibility: not applicable. this is a behavior-preserving refactor rather than a reported current-main bug reproduction.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: extensions/matrix/src/session-route.ts, serialized state: src/config/sessions/session-accessor.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #88838
Summary: this PR is an active candidate slice for the canonical Path 3 session/transcript SQLite migration tracker, following merged narrower accessor slices and adjacent to the open WhatsApp activation slice.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Exact-head CI still needs maintainer attention to finish any pending or dispatch-only checks before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land after maintainer review and exact-head CI completion, keeping the current source-compatible accessor shape and leaving the broader SQLite backend flip tracked by Track core session/transcript SQLite migration via accessor seam #88838.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No repair lane is needed; current head resolves the prior compatibility finding and should proceed through maintainer review and CI.

Security
Cleared: The diff changes TypeScript runtime/test code and boundary scripts only; it does not add dependencies, workflows, secret handling, package resolution, downloads, or new code-execution surfaces.

Review details

Best possible solution:

Land after maintainer review and exact-head CI completion, keeping the current source-compatible accessor shape and leaving the broader SQLite backend flip tracked by #88838.

Do we have a high-confidence way to reproduce the issue?

Not applicable; this is a behavior-preserving refactor rather than a reported current-main bug reproduction.

Is this the best way to solve the issue?

Yes; the current head uses targeted session accessors for bundled metadata reads while preserving list-session source compatibility and parent-session model override behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against eac1d3349c29.

Label changes

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR includes live Gateway proof for the changed runtime behavior, plus focused accessor/boundary proof after the compatibility fix.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded cleanup in session metadata/runtime plumbing with limited blast radius, but it touches compatibility-sensitive accessor and bundled plugin paths.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR includes live Gateway proof for the changed runtime behavior, plus focused accessor/boundary proof after the compatibility fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes live Gateway proof for the changed runtime behavior, plus focused accessor/boundary proof after the compatibility fix.
Evidence reviewed

PR surface:

Source -36, Tests +45, Other +8. Total +17 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 16 101 137 -36
Tests 5 55 10 +45
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 8 0 +8
Total 22 164 147 +17

What I checked:

  • PR state: this PR is open at head 5c0e33b, targets main, and carries the protected maintainer review label; it is not a close candidate while the maintainer-controlled Path 3 tracker still names it as active work. (5c0e33b2b9b7)
  • Source-compatible SDK list params: The current head keeps SessionStoreListParams derived from SessionStoreReadParams, so callers that pass readConsistency to listSessionEntries remain source-compatible even though list reads do not use that option. (src/plugin-sdk/session-store-runtime.ts:27, 5c0e33b2b9b7)
  • Runtime latest-read forwarding: Runtime session access params now include readConsistency and only forward it through the single-entry getSessionEntry path, preserving the public list parameter shape without changing list semantics. (src/plugins/runtime/runtime-agent.ts:92, 5c0e33b2b9b7)
  • Accessor cache contract: The session accessor maps readConsistency: latest to skipCache for single-entry reads, while list entries still use the existing listing path. (src/config/sessions/session-accessor.ts:908, 5c0e33b2b9b7)
  • Parent model override preserved: resolveStoredModelOverride now loads parent-session metadata through an injected targeted loader, and the Mattermost caller passes getSessionEntry with latest-read consistency, preserving explicit parent-session inheritance without whole-store access. (src/auto-reply/reply/stored-model-override.ts:35, 5c0e33b2b9b7)
  • Boundary ratchet extended: The accessor-boundary guard adds the migrated bundled metadata readers to the allowlisted accessor-only surface, so future whole-store regressions are checked by the existing script and tests. (scripts/check-session-accessor-boundary.mjs:127, 5c0e33b2b9b7)

Likely related people:

  • jalehman: Recent Path 3 session-accessor commits and the active tracker show repeated work on the session metadata/accessor migration across plugin SDK, session accessor, runtime, Mattermost, Telegram, and related bundled plugin slices. (role: feature owner and recent area contributor; confidence: high; commits: 4d4769c0d6a5, 4c841ac575d7, b58e6e0734f2; files: src/plugin-sdk/session-store-runtime.ts, src/config/sessions/session-accessor.ts, src/plugins/runtime/runtime-agent.ts)
  • Ayaan Zaidi: Blame around the current session-store runtime types and session accessor implementation traces important parts of the accessor seam to earlier grafted work by this author. (role: original seam contributor; confidence: medium; commits: f1e38f2ed6; files: src/plugin-sdk/session-store-runtime.ts, src/config/sessions/session-accessor.ts)
  • vincentkoc: Recent history around Codex conversation binding and adjacent channel runtime code makes this owner relevant for the Codex session-metadata read path touched by the PR. (role: adjacent Codex and channel contributor; confidence: medium; commits: 8afc1f770bbe, 5c3469549159, b4cdd9211957; files: extensions/codex/src/conversation-binding.ts, extensions/telegram/src/bot-message-dispatch.ts)
  • he-yufeng: Recent Telegram dispatch history overlaps with the internal Telegram metadata reader paths affected by this accessor migration. (role: adjacent Telegram contributor; confidence: low; commits: fa2379dbc883; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/bot-native-commands.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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 keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 24, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 24, 2026
@jalehman
jalehman force-pushed the josh/path3-bundled-session-metadata-accessors-pr branch from 9bc2ea1 to 96d3e0a Compare June 24, 2026 18:50
@jalehman
jalehman force-pushed the josh/path3-bundled-session-metadata-accessors-pr branch from 96d3e0a to 5c0e33b Compare June 24, 2026 19:03
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 24, 2026
@jalehman
jalehman merged commit 7e2b2d2 into openclaw:main Jun 24, 2026
111 of 119 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: telegram Channel integration: telegram extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant