Skip to content

fix(gateway): prevent cold plugin loads in session resolution tests - #151945

Merged
steipete merged 1 commit into
mainfrom
ci-burden/sessions-resolve-opaque-casing
Sep 18, 2026
Merged

steipete merged 1 commit into
mainfrom
ci-burden/sessions-resolve-opaque-casing

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the opaque Matrix-reference unit-test timeout seen in main run 35309177026.

Related: #151204.

User Impact

This repairs test-fixture isolation. Production session resolution and its existing casing assertions are unchanged.

Why This Change Was Made

The default test plugin registry omitted Matrix. Preparing a synthetic session row therefore sent parent-model lookup through optional bundled plugin activation for the colon-containing room ID. That cold synchronous load caused the timeout; the failure was not a casing mismatch or a stale resident index.

Install the existing session-conversation registry before each test because shared teardown resets the active registry after every case. The existing opaque-reference cases also assert that they never enter the bundled loader, making a missing fixture fail deterministically.

Evidence

  • Unmodified file reproduced the 120-second timeout on its first standalone invocation. The original hosted selector and the eight-worker Gateway group reproduced it at 173.8 and 174.4 seconds under concurrent pressure. Baseline repetition stopped after the first isolated failure; no failed CI jobs were rerun.
  • Before the fixture fix, both existing casing assertions passed in the guard-only probe, then both new assertions failed on exactly one Matrix session-key-api.js loader call.
  • Fixed file: 21/21 fresh invocations, three concurrent lanes with separate caches, 546 passing tests. The uppercase case took 0.6–5.1 seconds. No retries or timeout changes.
  • Resolver/index siblings: 96/96 tests passed across all four sessions-resolve* files and session-utils.perf.test.ts, including improve(sessions): speed up session links and list pages #151204 resident-index coverage.
  • The repaired casing cases passed inside the original hosted group (1.4/1.0 seconds) and the eight-worker group (1.1/1.0 seconds). Both broad runs were stopped after unrelated failures, so full-group green proof remains incomplete.
  • node scripts/check-changed.mjs, line-cap ratchet, oxfmt --check, and git diff --check passed. A type-aware lint canary rejected an intentionally floating promise with the expected rule. Independent review was clean through P2.

The broad-run limit is explicit: the original group again timed out in desktop/computer-authority.runtime.test.ts (also red before the fix; one candidate case took 502 seconds against its unchanged 90-second limit). The eight-worker group also failed session-message-events.test.ts (red in the baseline), repository snapshot capture, workspace-result finalization, and workspace-recovery subprocess checks. No retries, increased timeouts, weakened assertions, or baseline exceptions were used to hide those failures. The remaining broad cases were stopped; neither entire group is claimed green.

Install the session-conversation registry before each case so opaque Matrix
room IDs do not trigger cold bundled plugin activation during row preparation.
Guard the existing casing assertions against accidental facade loading.

Related: #151204
Reproduced main CI run 35309177026.
@clawsweeper

clawsweeper Bot commented Sep 18, 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 gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Sep 18, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 12:22 PM ET / 16:22 UTC.

ClawSweeper review

What this changes

The PR installs the existing channel test registry before session-resolution tests and guards the Matrix casing cases against loading bundled plugins.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still needs this focused fixture repair. The patch preserves the existing assertions, addresses the plugin-loading trigger, and introduces no actionable correctness defects.

Priority: P3
Reviewed head: ee1a183d13fda4ee186cc9bddf3ce51cf3fb5e03

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture correction with preserved behavioral assertions and relevant reported regression validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored test-only repair, so external-contributor runtime proof is not required. Reported before/after test runs exercise the changed fixture; no production runtime behavior changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored test-only repair, so external-contributor runtime proof is not required. Reported before/after test runs exercise the changed fixture; no production runtime behavior changes.
Evidence reviewed 8 items Verified introduced scope: The pinned merge-base-to-head diff changes only fixture setup and adds a restored loader spy with a negative assertion. Existing casing expectations remain unchanged. The verified test merge also changes only this test file.
Source-backed loading trigger: Conversation resolution probes bundled artifacts for colon-containing identifiers only when no channel plugin is registered. The existing session-conversation fixture registers Matrix, preventing that branch without changing production behavior.
Fixture lifecycle: The default test registry omits Matrix, and shared afterEach reinstalls that default registry. Installing the session-conversation fixture in beforeEach therefore covers both table cases and avoids dependence on preceding tests.
Findings None None.
Security None None.

How this fits together

Gateway session resolution turns session references into matching session records. Its tests prepare synthetic session rows, whose parent-model lookup can consult channel plugins.

flowchart TD
  A[Synthetic session reference] --> B[Session row preparation]
  C[Channel test registry] --> D[Conversation lookup]
  B --> D
  D --> E{Matrix registered?}
  E -->|Yes| F[Lightweight test resolver]
  E -->|No| G[Bundled plugin loader]
  F --> H[Session matching and casing assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +9. Total +9 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 9 0 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 9 0 +9

Review metrics

None.

Technical review

Best possible solution:

Keep session-resolution fixtures self-contained through the shared channel registry, with a deterministic guard against accidental bundled-plugin loading.

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

Yes: source identifies the missing Matrix registration and resulting bundled-loader branch, and the PR reports a failing guard-only probe. Timeout timing was not independently reproduced in this read-only review.

Is this the best way to solve the issue?

Yes: reusing the existing registry fixes fixture ownership at setup, while the negative loader assertion catches recurrence without weakening casing checks or increasing timeouts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 19dbf2e4dabf.

Labels

Label changes:

  • add P3: This is a bounded test-isolation repair with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored test-only repair, so external-contributor runtime proof is not required. Reported before/after test runs exercise the changed fixture; no production runtime behavior changes.

Label justifications:

  • P3: This is a bounded test-isolation repair with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored test-only repair, so external-contributor runtime proof is not required. Reported before/after test runs exercise the changed fixture; no production runtime behavior changes.

Evidence

What I checked:

  • Verified introduced scope: The pinned merge-base-to-head diff changes only fixture setup and adds a restored loader spy with a negative assertion. Existing casing expectations remain unchanged. The verified test merge also changes only this test file. (src/gateway/sessions-resolve.test.ts:106, ee1a183d13fd)
  • Source-backed loading trigger: Conversation resolution probes bundled artifacts for colon-containing identifiers only when no channel plugin is registered. The existing session-conversation fixture registers Matrix, preventing that branch without changing production behavior. (src/channels/plugins/session-conversation.ts:210, ee1a183d13fd)
  • Fixture lifecycle: The default test registry omits Matrix, and shared afterEach reinstalls that default registry. Installing the session-conversation fixture in beforeEach therefore covers both table cases and avoids dependence on preceding tests. (test/setup-openclaw-runtime.ts:352, ee1a183d13fd)
  • Still necessary on fetched main: Comparing the relevant files with fetched main shows that main lacks the registry installation and loader guard; the shared fixture is already available. Latest-release file inspection found neither the new setup nor these opaque-reference cases, so no shipped equivalent was established. (src/gateway/sessions-resolve.test.ts:106, 19dbf2e4dabf)
  • Captured validation evidence: The supplied body snapshot, sourceRevision fcd0d9a48d9c100ac52bad470c226e337e91731da5464ed7f32d83b89f7612b6, reports baseline timeouts, a guard-only failure on Matrix loader calls, 21 successful fixed-file invocations, and 96 passing sibling tests. It explicitly does not claim complete broad-group success. This review inspected source and ran git diff --check; it did not execute tests. (ee1a183d13fd)
  • Related merged work is distinct: improve(sessions): speed up session links and list pages #151204 is verified merged and improves resident session lookup performance. Its supplied discussion and evidence concern indexing and list preparation, not this missing test registration; it does not supersede the fixture repair. (ca5048cd2991)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@steipete
steipete merged commit ee60e06 into main Sep 18, 2026
105 checks passed
@steipete
steipete deleted the ci-burden/sessions-resolve-opaque-casing branch September 18, 2026 17:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
* origin/main:
  test(gateway): isolate session resolution channel fixtures (#151945)
  fix(clickclack): drain discussion opens before shutdown (#151978)
  fix(test): restore trusted packaging harness startup (#151967)
  improve(codex): batch session adoption binding reads (#151979)
  improve(cron): reduce allocations for busy stream sources (#151956)
  fix(file-transfer): avoid repeated directory record encoding (#151987)
  fix: avoid session-list rebuilds when authentication availability changes (#151920)
  fix(updates): explain externally managed update refusals (#151942)
  improve(heartbeat): avoid unused config work in membership checks (#151867)
  fix(android): keep status text readable and label accessibility actions (#151342)
  improve(ui): show OS and size in the environment selector (#151947)
  fix(android): keep tool errors visible in collapsed chat activity (#151332)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…151945)

Install the session-conversation registry before each case so opaque Matrix
room IDs do not trigger cold bundled plugin activation during row preparation.
Guard the existing casing assertions against accidental facade loading.

Related: openclaw#151204
Reproduced main CI run 35309177026.
steipete added a commit that referenced this pull request Sep 19, 2026
Avoid cold Browser plugin activation in a fixture with no browser resources.

Follow up lane W concurrency evidence and #151945. Preserve existing assertions, wait budgets, and file parallelism.
steipete added a commit that referenced this pull request Sep 19, 2026
Await the session-state cleanup owner before deleting fixture databases.

Follow up lane W concurrency evidence and #151945. Preserve existing assertions, wait budgets, and file parallelism.
steipete added a commit that referenced this pull request Sep 19, 2026
Route chat.send directly to its owner and defer history, media and title runtime loading. Keep post-import authority checks and observe websocket isolation through actual delivery.

Follow up lane W concurrency evidence and #151945. Preserve existing assertions, wait budgets, and file parallelism.
steipete added a commit that referenced this pull request Sep 19, 2026
…2782)

Load the real plugin entry through the bundled facade test owner.

Follow up lane W concurrency evidence and #151945. Preserve existing assertions, wait budgets, and file parallelism.
steipete added a commit that referenced this pull request Sep 19, 2026
Bound private SDK host copies while retaining native package independence.

Follow up lane W concurrency evidence and #151945. Preserve existing assertions, wait budgets, and file parallelism.
steipete added a commit that referenced this pull request Sep 19, 2026
…152781)

Seed fresh title-retention transcripts with existing append and transaction owners.

Follow up lane W concurrency evidence and #151945. Preserve existing assertions, wait budgets, and file parallelism.
steipete added a commit that referenced this pull request Sep 19, 2026
Prepare explicit synthetic model policy and plugin metadata for the retention child.

Follow up lane W concurrency evidence and #151945. Preserve existing assertions, wait budgets, and file parallelism.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…aw#152779)

Avoid cold Browser plugin activation in a fixture with no browser resources.

Follow up lane W concurrency evidence and openclaw#151945. Preserve existing assertions, wait budgets, and file parallelism.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…aw#152780)

Await the session-state cleanup owner before deleting fixture databases.

Follow up lane W concurrency evidence and openclaw#151945. Preserve existing assertions, wait budgets, and file parallelism.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…law#152784)

Route chat.send directly to its owner and defer history, media and title runtime loading. Keep post-import authority checks and observe websocket isolation through actual delivery.

Follow up lane W concurrency evidence and openclaw#151945. Preserve existing assertions, wait budgets, and file parallelism.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…nclaw#152782)

Load the real plugin entry through the bundled facade test owner.

Follow up lane W concurrency evidence and openclaw#151945. Preserve existing assertions, wait budgets, and file parallelism.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
Bound private SDK host copies while retaining native package independence.

Follow up lane W concurrency evidence and openclaw#151945. Preserve existing assertions, wait budgets, and file parallelism.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…penclaw#152781)

Seed fresh title-retention transcripts with existing append and transaction owners.

Follow up lane W concurrency evidence and openclaw#151945. Preserve existing assertions, wait budgets, and file parallelism.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…law#152785)

Prepare explicit synthetic model policy and plugin metadata for the retention child.

Follow up lane W concurrency evidence and openclaw#151945. Preserve existing assertions, wait budgets, and file parallelism.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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