Repository navigation
fix: enforce migration guards for every protected session path - #117140
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 9:20 PM ET / August 1, 2026, 01:20 UTC. ClawSweeper reviewWhat this changesThe PR changes the session-accessor migration guard to scan each existing protected-file inventory directly, so protected core and plugin paths outside old directory roots cannot silently bypass the guard. Merge readinessKeep this maintainer-labeled PR open for explicit maintainer review. Current Likely related people: Peter Steinberger (high-confidence feature owner) and Josh Lehman (medium-confidence session-migration contributor). Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's session migration guard prevents selected migrated code paths from calling legacy filesystem-backed session helpers. It turns protected-file inventories and TypeScript scanner rules into ordered CI diagnostics, while a separate baseline ratchets remaining unmigrated debt. flowchart LR
A[Protected session-file inventories] --> B[Session migration guard]
C[Legacy helper patterns] --> B
B --> D[Direct TypeScript file scans]
D --> E[Ordered diagnostics]
E --> F[CI guard result]
G[Unmigrated debt baseline] --> B
Decision needed
Why: The patch is a focused, source-supported repair with real guard proof, but the repository's protected Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther -61. Total -61 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Preserve the direct-inventory enforcement model and land it after the protected maintainer review, retaining the current diagnostic order, debt ratchet, compatibility-export scan, and Testbox mutation coverage. Do we have a high-confidence way to reproduce the issue? Yes, from source and the supplied Testbox mutation proof: current main only scans configured directory roots before filtering to protected files, so a protected path outside those roots is skipped; the branch directly targets the inventory file paths. Is this the best way to solve the issue? Yes: direct scanning of the existing protected-file inventories is the narrowest owner-boundary fix because those inventories already define what must stay migrated, while root lists remain only for the unmigrated-debt ratchet. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against af687f920f61. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (217 commits) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) fix(doctor): persist normalized agent roster (openclaw#117115) fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134) fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899) fix(gateway): honor HTTP If-Modified-Since media validators (openclaw#117133) fix(config): delete one array element per config patch delete (openclaw#116463) fix(plugins): report installed dependency health authoritatively (openclaw#117029) fix(ui): recover moving sessions across paged gateway rosters (openclaw#117016) fix(ui): clear hidden session selection before bulk deletion (openclaw#117015) fix(discord): avoid replaying ambiguous voice deliveries (openclaw#117127) fix(ui): scope Gateway reconnect lineage to its target (openclaw#117125) fix(models): expose runtime provider catalogs in browse views (openclaw#116857) ...
* commit 'c41f033b87545b658215a9c3bbe03f88fbaa867d': (347 commits) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) fix(doctor): persist normalized agent roster (openclaw#117115) fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134) fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899) fix(gateway): honor HTTP If-Modified-Since media validators (openclaw#117133) fix(config): delete one array element per config patch delete (openclaw#116463) fix(plugins): report installed dependency health authoritatively (openclaw#117029) fix(ui): recover moving sessions across paged gateway rosters (openclaw#117016) fix(ui): clear hidden session selection before bulk deletion (openclaw#117015) fix(discord): avoid replaying ambiguous voice deliveries (openclaw#117127) fix(ui): scope Gateway reconnect lineage to its target (openclaw#117125) ...
* origin/main: (3706 commits) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) fix(doctor): persist normalized agent roster (openclaw#117115) fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134) fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899) ...
* commit '7e78de747b8a64d52f30aee948b697bf4c528691': (359 commits) refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) ...
* commit '31f24547a94a8bd74a32e42cde1783591c5804d9': (347 commits) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) fix(doctor): persist normalized agent roster (openclaw#117115) fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134) fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899) fix(gateway): honor HTTP If-Modified-Since media validators (openclaw#117133) fix(config): delete one array element per config patch delete (openclaw#116463) fix(plugins): report installed dependency health authoritatively (openclaw#117029) fix(ui): recover moving sessions across paged gateway rosters (openclaw#117016) fix(ui): clear hidden session selection before bulk deletion (openclaw#117015) fix(discord): avoid replaying ambiguous voice deliveries (openclaw#117127) fix(ui): scope Gateway reconnect lineage to its target (openclaw#117125) ...
* commit '5148236bbe050f6c05ee59190986a7215b41ce1c': (359 commits) refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) ...
* origin/main: (3706 commits) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) fix(doctor): persist normalized agent roster (openclaw#117115) fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134) fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899) ...
What Problem This Solves
Fixes an issue where the session migration boundary guard reported success even when forbidden legacy session-store calls appeared in files explicitly marked as migrated. Ten protected core and plugin files were outside the guard's separately maintained directory roots, so their migration policy was silently unenforced.
Why This Change Was Made
Enforce each existing migration concern against its authoritative protected-file inventory instead of repeatedly crawling incomplete directory roots. Preserve the historical diagnostic order, the separate unmigrated debt ratchet and baseline, intentionally stale inventory entries, all exported contracts, and the shipped beta compatibility allowlist. Consolidating repeated scanner bookkeeping removes 61 production lines and reduces enforcement inventory from approximately 18,301 candidate paths to 178 existing protected files.
User Impact
Developers and maintainers now get a failing guard when a protected core or plugin session path reintroduces legacy filesystem-backed access. All previously enforced paths, migration rules, compatibility exports, and diagnostic ordering retain their existing behavior; no product configuration or public API changes.
Evidence
Validated on Blacksmith Testbox
tbx_01kyxd8k8cgn36rqvh2v4tfd93:loadSessionStore(...)into protectedsrc/status/summary.tsandextensions/slack/src/monitor/slash.ts; the unmodified guard incorrectly exits0and printssession accessor boundary guard passed.1and reports both exact file/line diagnostics.pnpm test test/scripts/check-session-accessor-boundary.test.ts test/scripts/ts-guard-utils.test.ts: all 40 existing tests pass unchanged.node scripts/check-session-accessor-boundary.mjs: the complete real repository corpus passes.CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 OPENCLAW_VITEST_MAX_WORKERS=1 pnpm check:changed: passed, including 248 script declaration contracts and targeted script lint.AI-assisted; the implementation, security boundary, before/after behavior, and validation were reviewed directly.