Skip to content

test: stabilize startup session migration flake#97370

Merged
RomneyDa merged 2 commits into
mainfrom
codex/fix-gateway-session-migration-flake
Jun 28, 2026
Merged

test: stabilize startup session migration flake#97370
RomneyDa merged 2 commits into
mainfrom
codex/fix-gateway-session-migration-flake

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jun 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove the gateway startup session migration unit test that loaded real bundled plugin doctor-contract discovery.
  • Keep plugin-owned session migration coverage in state-migrations.orphan-keys.test.ts, with explicit plugin agent IDs for migration behavior cases.
  • Add a narrow no-override doctor-contract discovery guard so startup still has coverage for resolving plugin-owned session-store agents without loading bundled plugin metadata.
  • Add a focused registry integration check that loads the real Voice Call doctor contract through plugins.load.paths and verifies its session-store agent IDs.

Verification

  • OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs --config test/vitest/vitest.gateway-server.config.ts src/gateway/server-startup-log.test.ts src/gateway/server-startup-memory.test.ts src/gateway/server-startup-plugins.test.ts src/gateway/server-startup-post-attach.test.ts src/gateway/server-startup-session-migration.test.ts src/gateway/server-startup-web-fetch-bind.test.ts src/gateway/server-startup.test.ts --reporter=verbose
  • node scripts/run-vitest.mjs --config test/vitest/vitest.infra.config.ts src/infra/state-migrations.orphan-keys.test.ts --reporter=verbose
  • node scripts/run-vitest.mjs --config test/vitest/vitest.plugins.config.ts src/plugins/doctor-contract-registry.load-paths.test.ts --reporter=verbose
  • node scripts/run-vitest.mjs extensions/voice-call/doctor-contract-api.test.ts --reporter=verbose -t "reports top-level and per-number session-store agents"
  • .agents/skills/autoreview/scripts/autoreview --mode local -> clean, no accepted/actionable findings
  • git diff --check

Observed flake: https://github.com/openclaw/openclaw/actions/runs/28275435633/job/83781270309

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 1:33 AM ET / 05:33 UTC.

Summary
The branch removes a gateway startup session migration test that exercised real bundled Voice Call doctor-contract discovery, moves plugin-owned migration coverage into infra tests with mocked or explicit plugin agent IDs, and adds a registry load-path check for the real Voice Call doctor contract.

PR surface: Tests +44. Total +44 across 3 files.

Reproducibility: no. deterministic current-main reproduction was run. The linked Actions job failed the compact shard and current source shows the gateway test exercises real plugin discovery, so the flake path is plausible but not a high-confidence repeated repro.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/gateway/server-startup-session-migration.test.ts, migration/backfill/repair: src/infra/state-migrations.orphan-keys.test.ts, migration/backfill/repair: src/plugins/doctor-contract-registry.load-paths.test.ts, serialized state: src/gateway/server-startup-session-migration.test.ts, serialized state: src/infra/state-migrations.orphan-keys.test.ts, unknown-data-model-change: src/infra/state-migrations.orphan-keys.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Let the remaining required CI finish on the current head before merge.

Risk before merge

  • [P1] Required CI still had a few pending broad checks during this read-only review; local tests were not run because the checkout must remain unchanged.

Maintainer options:

  1. Decide the mitigation before merge
    Land the test-only reshuffle after remaining required checks finish, keeping gateway startup tests narrow and plugin-owned session-store discovery covered in infra and registry tests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No repair lane: there are no actionable findings, and the protected maintainer PR should continue through ordinary maintainer review and CI.

Security
Cleared: Only test files change; no dependency, workflow, secret-handling, generated/vendor, package, or production runtime surface is added.

Review details

Best possible solution:

Land the test-only reshuffle after remaining required checks finish, keeping gateway startup tests narrow and plugin-owned session-store discovery covered in infra and registry tests.

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

No deterministic current-main reproduction was run. The linked Actions job failed the compact shard and current source shows the gateway test exercises real plugin discovery, so the flake path is plausible but not a high-confidence repeated repro.

Is this the best way to solve the issue?

Yes. Moving plugin-owned migration behavior coverage into infra and registry tests is a narrower maintainable fix than keeping a gateway wrapper test that loads bundled plugin discovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 119dc4bd821e.

Label changes

Label justifications:

  • P3: This is low-risk test stabilization with no runtime, config, migration, dependency, or workflow file changes.
  • 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: Not applicable: this is a maintainer-labeled test-only PR, and the PR body lists targeted test and autoreview validation instead of user-facing runtime proof.
Evidence reviewed

PR surface:

Tests +44. Total +44 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 96 52 +44
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 96 52 +44

What I checked:

  • Protected maintainer signal: Live PR metadata shows the maintainer label and MEMBER author association, which means this cleanup workflow must keep the PR open for explicit maintainer handling. (9d85943ff0a6)
  • Current-main broad gateway test: Current main still has a direct gateway startup session migration test that creates a Voice Call plugin config and runs the real startup migration path for plugin-owned agent discovery. (src/gateway/server-startup-session-migration.test.ts:32, 119dc4bd821e)
  • Scoped gateway policy: The gateway scoped guide says startup paths and tests should not materialize bundled plugin runtime when static plugin-owned descriptors are enough, which supports narrowing this gateway wrapper test. (src/gateway/AGENTS.md:3, 119dc4bd821e)
  • PR-head wrapper tests: On the PR head, the gateway startup migration test keeps coverage focused on logging, warnings, no-op behavior, and caught errors through injected migration deps. (src/gateway/server-startup-session-migration.test.ts:29, 9d85943ff0a6)
  • PR-head infra discovery guard: The orphan-key migration test now mocks only listPluginDoctorSessionStoreAgentIds, verifies the config/env/pluginIds call, and proves the Voice Call session key is canonicalized. (src/infra/state-migrations.orphan-keys.test.ts:278, 9d85943ff0a6)
  • Runtime migration contract: The production migration already accepts explicit additional agent IDs and otherwise resolves plugin-owned session-store agent IDs through doctor contracts, so the PR is changing test placement rather than runtime behavior. (src/infra/state-migrations.ts:5128, 119dc4bd821e)

Likely related people:

  • obviyus: Merged the original session-key canonicalization work and later authored the PR that added orphaned session key migration and gateway startup migration coverage. (role: original migration owner and merger; confidence: high; commits: d3deacba8436, 56c079eba725, b3c69b941e6d; files: src/infra/state-migrations.ts, src/gateway/server-startup-session-migration.ts, src/gateway/server-startup-session-migration.test.ts)
  • jzakirov: Authored the recent merged session migration performance PR that modified orphan-key migration tests and relied on startup migration as the canonicalization boundary. (role: recent area contributor; confidence: medium; commits: ed261c6720af, a86ca4f4ba97; files: src/infra/state-migrations.orphan-keys.test.ts, src/gateway/session-utils.ts, src/config/sessions/store.ts)
  • jalehman: Authored the startup migration logging split in the recent session migration refactor PR and merged that adjacent area work. (role: recent adjacent contributor and merger; confidence: medium; commits: 42c922460a1f, a86ca4f4ba97; files: src/config/sessions/startup-migration.ts, src/gateway/server-startup-session-migration.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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

@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 28, 2026
@RomneyDa
RomneyDa merged commit 08d15ec into main Jun 28, 2026
121 of 129 checks passed
@RomneyDa
RomneyDa deleted the codex/fix-gateway-session-migration-flake branch June 28, 2026 11:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 29, 2026
* test: stabilize startup session migration flake

* test: cover voice call doctor session ids
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* test: stabilize startup session migration flake

* test: cover voice call doctor session ids
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
* test: stabilize startup session migration flake

* test: cover voice call doctor session ids
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
* test: stabilize startup session migration flake

* test: cover voice call doctor session ids
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: S 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