Skip to content

fix(sessions): avoid saved-prompt decoding in metadata listings - #191677

Merged
roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-149358
Nov 3, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-149358

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #149358, thanks @DakshK-02.

What Problem This Solves

Fixes unnecessary saved-prompt decoding when trajectory export, memory target discovery, or a session catalog fallback only needs session metadata from a large store.

User Impact

These metadata scans avoid loading saved session snapshots. Existing full runtime listings keep their default behavior; no configuration or migration is required.

Why This Change Was Made

Use the existing list projection at the remaining reads, forward its optional selector through the existing synchronous runtime listing, and reuse projected trajectory rows instead of performing two additional keyed reads. The catalog fallback now matches the Gateway's metadata snapshot; callers needing a complete entry should use an exact getter before replacing it.

Current main already moved the other named agent and ownership scans to worker-backed summaries or removed their old scans. The file-transfer plugin has no remaining session-list read. This replacement retains the useful remaining work without restoring those retired paths or adding storage APIs.

Production delta: net zero lines, including removal of the duplicate trajectory entry reads. The 70 added regression-test lines cover saved-prompt decoding, accepted session-key forms, and the retained full-list default; their separate test-line allocation leaves the shared baseline unchanged.

Evidence

  • On main b655b248d0a5af7f044c4e756269da88bdaa18c3, focused regressions fail on saved-prompt decode counts: trajectory marker export 3; memory target discovery 1 in each of default, custom, and shared stores; runtime metadata listing 1. Catalog spies also show the missing projection. After the fix, all counts are 0 and 85 focused tests pass. The final trajectory pass is 43/43 green, including two additional accepted key forms through the existing key resolver, for 87 distinct passing tests across the four files.
  • Crabbox / Blacksmith Testbox: run 41578701368. Named files: src/trajectory/export.test.ts, src/plugin-sdk/memory-core-host-engine-sessions.test.ts, src/plugins/runtime/runtime-agent.test.ts, and src/plugins/session-catalog.test.ts. Combined green command: 61.13 seconds including worker preparation; CI timing will be available in the PR checks.
  • Autoreview on final committed head 2d8321e9cff54d779afa35c37cf59b4bf02be75b against that main baseline: Codex, P0–P2, scoped clean; no actionable findings remain. An earlier index-only key-lookup finding was fixed with the existing resolver and covered by the final trajectory run. Type-aware lint and format checks pass on all touched files.
  • Exact-head CI completed with one failed root check: inherited test-line ceiling debt. Clean main fc8afdae15b979e51b4a5ac1560f861f979ad07f, the CI merge's first parent, reproduces the same 443-line overage in Crabbox run 41581070824: 6,420,146 lines / 6,419,703 ceiling, exit 1. The PR merge has 6,420,216 / 6,419,773: its 70 added lines have exactly 70 allocation lines of credit, leaving the overage unchanged. The checker and shared baseline are byte-identical between main and the CI merge. Every other selected job passed, including all three PostgreSQL shards, types, lint, build, and security. Landing uses the native attributed-failure route; the failed ratchet and its CI aggregate remain recorded as failed.
  • Contributor source was read only with gh pr view / gh pr diff; it was never checked out or executed. Only main plus this independent replacement ran in Crabbox. No tests, worker compilation, or broad checks ran on the production Team host. Native landing dependencies were installed under the IO gate and idle priority, with lifecycle scripts disabled for the task checkout; the native wrapper owns its separate managed dependency cache.

roboclaw-bot and others added 2 commits November 3, 2026 04:40
Reuse the existing list projection for catalog fallback, memory target
discovery, and trajectory identity matching. Remove two redundant keyed
trajectory reads while retaining full runtime listings by default.

Co-authored-by: DakshK-02 <[email protected]>
Resolve short and padded session keys with the existing storage identity
resolver before looking them up in the projected rows. Cover accepted key
forms while preserving zero saved-prompt decodes.

Co-authored-by: DakshK-02 <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation plugin: file-transfer size: S labels Nov 3, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 3, 2026 04:45
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@roboclaw-bot
roboclaw-bot merged commit 7b981e2 into main Nov 3, 2026
249 of 252 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-149358 branch November 3, 2026 05:14
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…claw#191677)

Avoid saved-prompt decoding in metadata-only trajectory, memory-target, and
catalog listings using the existing list projection. Reuse listed trajectory
rows instead of two additional keyed reads, preserving canonical keys and
the full runtime listing default.

Supersedes openclaw#149358, thanks @DakshK-02.

Evidence: saved-prompt decode regressions red on main and green after the
fix; 87 distinct focused tests pass; touched-file lint and format pass;
final committed-range Codex autoreview P0-P2 has no actionable findings.
Production LOC net zero. Exact-head PR CI retains the inherited 443-line
test-ceiling failure, reproduced on clean main in Crabbox; the change's 70
new test lines have matching allocation credit. Native attributed-failure
admission preserves that failed result and enforces the other gates.

Co-authored-by: DakshK-02 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation plugin: file-transfer size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant