refactor: migrate bundled session metadata reads#96527
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 3:11 PM ET / 19:11 UTC. Summary 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 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. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest 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 changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -36, Tests +45, Other +8. Total +17 across 22 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
|
9bc2ea1 to
96d3e0a
Compare
96d3e0a to
5c0e33b
Compare
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
mainafter #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
getSessionEntryaccess, 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
upstream/mainat4d4769c0d6a55cecb40ac3910527e0eb0a1232f1, the refactor: narrow bundled session runtime barrels #96507 merge commit.node scripts/check-session-accessor-boundary.mjsnode 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.tsgit diff --checkpnpm lint:tmp:session-accessor-boundarypnpm exec oxfmt --check --threads=1 <touched files>pnpm tsgo:test:srcAGENTS_HOME="$HOME/.agents" "$HOME/.agents/skills/autoreview/scripts/autoreview" --mode local/Users/phaedrus/Projects/clawdbot: recorded original detached live SHA352c4a40d838d7deb0bfdf38fa33665aef00be72, checked out proof SHA9bc2ea1652d6a25666cd0d80a77bdf7c040c9774, ranpnpm 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, andpnpm openclaw gateway call health --json.agent:main:mainand Telegram group/topic session keys withreadConsistency: "latest", resolved Discord and Mattermost current-model helper output asopenai/gpt-5.5-codex, and confirmed the live store had 54 entries with no parent-session chain to exercise without writing synthetic state.352c4a40d838d7deb0bfdf38fa33665aef00be72, rebuilt, restarted the gateway, and confirmed RPC health with Discord and Telegram both connected.Refs #88838.