Skip to content

fix(sessions): stop self-only recall from scanning unrelated sessions - #200202

Merged
roboclaw-bot merged 5 commits into
mainfrom
openclaw/fast-krill-2
Nov 16, 2026
Merged

roboclaw-bot merged 5 commits into
mainfrom
openclaw/fast-krill-2

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Collaborator

Related: #198855

What Problem This Solves

Fixes slow or failed history recall under self-only visibility when unrelated session inventory is large or unavailable.

User Impact

Self-only recall searches the current conversation directly, without waiting for an unrelated roster scan. Explicit targets, host-bound read scopes, sandbox clamps, incognito restrictions and broader visibility modes retain their existing authorization paths. This does not fix the separate broad-search fanout investigation.

Why This Change Was Made

Effective self visibility already defines a one-session search universe. Reuse the existing targeted resolver and access check instead of enumerating the roster and filtering it back down. No new permission, protocol, configuration, dependency, state or cache is introduced.

Evidence

  • Current-session regression: red on the base when unrelated inventory is unavailable; green with the fix, retaining canonical-key matching and foreign-hit exclusion.
  • 39 focused tool tests plus the Gateway visibility-matrix test pass; 14 prefix-stability cases pass. Focused wrapper: 26.07s. Broad error coverage explicitly selects all and retains its assertions.
  • Strict targeted production/test/script types, lint, format and diff checks pass. Complete search-range and later ACK-delta local autoreviews found no P0–P2 findings; reviewers did not execute project code.
  • Exact-head CI 43932467783 completed successfully on attempt 1 at aa3656aa5101bc6a92fdbf5bca7adbfe3d53b2be; both UI E2E shards and both CI gate statuses passed. The original failed CI attempt remains recorded.

Real agent/model proof — passed

A fresh isolated Gateway was built from source 895756d5aa4ff188db6081e342f8315878992025, whose committed tree 65cedc05c03f459c4a627d6af39a421a98a63484 exactly matches the published head. Only a task-owned driver and synthetic scenario were added outside the shipping diff.

The normal source-selected live-frontier flow used a real configured OpenAI model, the normal agent RPC, Gateway search, QA-channel delivery and persisted transcript owners. The final canonical report is 1 scenario, 1 passed, 0 failed, 0 skipped; all selected cells executed. It verifies:

  • served agents.list includes the QA agent and the served primary model has canonical OpenAI identity;
  • the model actually issues a successful sessions_search with sessionKey omitted;
  • its persisted search result contains the earlier synthetic reference code;
  • the separately persisted final and normal non-error delivered final both equal SELF-SEARCH-OK violet-copper-9281.

An earlier bound live execution also passed. This is one scenario exercised twice, not two distinct coverage cases. The first unbound attempt never reached model execution because QA imported the SecretRef without its provider definition. The existing fixture hook then retained only the matching, already-configured absolute-path file-provider definition. No key values, alternate accounts, model overrides, endpoints or credential references were supplied or changed by that fixture. Synthetic controls reproduce the missing-definition error and pass with the supported hook. The narrowed proof harness also received an independent P0–P2 clean review.

Transport work-count measurement

Five serial ABAB process pairs, each one cold and five warm self searches over 600 synthetic sessions, used the real tool → Gateway WebSocket path on Node 26.12.1. Base 4a0e45492b8987d67d8b56e8d6dcdb3765aa61ed; measured search source 0d8db16e701a3a520d6216e3c4b6ce77ec42ee48, unchanged by the ACK-test repair.

Measurement Base Candidate
Unrelated listing RPCs per self search 3 0
Search RPCs per self search 1 1
Warm median / p95 (25 queries per arm) 103.990 / 140.799 ms 16.311 / 24.076 ms
Cold median / p95 (5 queries per arm) 1095.432 / 1180.355 ms 841.583 / 889.071 ms

Result and completeness flags matched in the no-match fixture. Rerun scripts/perf/session-search-rpc-measure.ts with fresh state directories, --sessions 600 --visibility self, and --tool-ref <base-sha> for the baseline. This benchmark does not establish broad-search recall correctness.

CI readiness repair

Original failure: the ACK-ownership test scrolled a replaceable loading summary before resolving the steer ACK. Source 895756d5aa4ff188db6081e342f8315878992025 makes its selector wait for the resolved command descendant. All ACK, retained-draft, retained-tool and send-count assertions remain unchanged; no retries, sleeps, timeout increases or production changes were added.

The controlled import/stability-window probe is red on main ec025eba2df15ab949239fa17dfd99ac4286b50c and green with the selector. All four original cases pass on that baseline plus the repair and the combined search candidate: 19.69s wrapper, including 10.37s UI build; 5.754s test time. Hosted ClawSweeper found no actionable technical findings on prior search head d5464f9cb957499c6697470907222d8cec84320b; the new readiness delta has its separate fresh local review.

Investigated local validation gaps

The production unused-file scan passed with zero findings. The full-tree scan failed on five unmodified, non-owned paths; it remains a failure, not an aggregate pass:

  • scripts/lib/stable-publish-recovery.mjs
  • src/gateway/tools-invoke.policy.test-support.ts
  • src/plugins/test-helpers/install-account-policy.test-support.ts
  • test/scripts/fixtures/vitest-worker-scheduling.cjs
  • test/scripts/vitest-worker-cache-retention.test-support.ts

The private-QA build completed with exit 0 but emitted nonfatal UI-budget advisories; this PR changes no production UI code and does not claim a strict UI-budget pass. Native exact-head review records retain these gaps.

Requested by @vincentkoc.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 2 commits November 16, 2026 18:00
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 5d923180-9a48-8ed7-a2c1-a72ce73d7957
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts agents Agent runtime and tooling size: M labels Nov 16, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 16, 2026 18:15
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head d5464f9cb957499c6697470907222d8cec84320b, but the PR head is now aa3656aa5101bc6a92fdbf5bca7adbfe3d53b2be. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-16T18:30:16.304Z sha d5464f9 :: needs maintainer review before merge. :: none

roboclaw-bot and others added 3 commits November 16, 2026 18:45
Select the loaded command row rather than its temporary loading summary before scrolling and exercising deferred ACK ownership. Preserve all four original ACK, draft, tool, and send-count assertions.

Co-authored-by: vincentkoc <[email protected]>
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: a91f029d-420c-8235-9278-4ce2c73ba71c
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Nov 16, 2026
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 16, 2026
@roboclaw-bot
roboclaw-bot merged commit 4dfa434 into main Nov 16, 2026
154 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/fast-krill-2 branch November 16, 2026 19:56
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

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

* fix(sessions): avoid roster scans for self-only search

Co-authored-by: vincentkoc <[email protected]>

* fix(sessions): stop self-only recall from scanning unrelated sessions

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 5d923180-9a48-8ed7-a2c1-a72ce73d7957

* test(ui): wait for resolved ACK ownership tool rows

Select the loaded command row rather than its temporary loading summary before scrolling and exercising deferred ACK ownership. Preserve all four original ACK, draft, tool, and send-count assertions.

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/fast-krill-2

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: a91f029d-420c-8235-9278-4ce2c73ba71c

---------

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

Labels

agents Agent runtime and tooling app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant