Skip to content

fix(ci): stabilize memory repair responsiveness checks - #155778

Closed
steipete wants to merge 1 commit into
mainfrom
codex/memory-candidate-reader-readiness-20260922
Closed

steipete wants to merge 1 commit into
mainfrom
codex/memory-candidate-reader-readiness-20260922

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #155719

What Problem This Solves

Fixes intermittent CI failures where legacy-memory repair responsiveness checks include cold retrieval-worker startup in their one-second deadline.

User Impact

Test-only change. Production retrieval and repair behavior, the one-second candidate deadline, provider hold, corpus, and cleanup remain unchanged.

Why This Change Was Made

Read index state through the existing retrieval worker and the same upgraded database before measuring the two candidate calls. This establishes real reader readiness without querying candidates, starting repair, or releasing the provider gate. Cold-start latency is measured separately; this does not claim to improve it.

Evidence

  • Reproduced the original failure on exact merge 784ef32c875: the original 20-file group had 227 passes and one failure on Linux Node 24.19.0 with two-CPU affinity. The host exposed four CPUs; this is an affinity diagnostic, not a claim of identical CI hardware.
  • Temporarily restoring the historical blocking await still failed both prepared-reader probes at zero of two completions. In the startup-catch-up variant, the provider gate was held before either call, and calls settled only after release. Exact production bytes were restored before the corrected group passed all 228 tests in 189.75 seconds.
  • Observed cold readiness separately at 618.73 ms. The earlier unchanged diagnostic pair took 987.28 ms versus 5.42 ms for its warm sibling; a passing timing sample alone is not treated as a fix.
  • Fresh-main focused fixture: all three tests passed in 178.98 seconds including cold compiler preparation. The existing 256-file real-storage fixture is retained because it proves foreground reads and admitted repair cleanup across actual workers.
  • Scoped P2 review found no actionable findings. The complete selected one-file check gate includes extension-test types, typed lint, formatting, and repository guards.

Wait for the existing index-state reader on the upgraded database before
measuring candidate independence from a held provenance rebuild. Preserve
the one-second deadline, provider gate, corpus, and repair drainage.

The historical blocking-await control still fails with the reader prepared;
the original 20-file group passes. Cold worker startup remains separately
measured and is not claimed as a production performance fix.
@clawsweeper

clawsweeper Bot commented Sep 22, 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 extensions: memory-core Extension: memory-core size: XS maintainer Maintainer-authored PR labels Sep 22, 2026
@steipete
steipete marked this pull request as ready for review September 22, 2026 14:48
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 10:54 AM ET / 14:54 UTC.

ClawSweeper review

What this changes

Prepares Memory Core’s retrieval worker before timing candidate lookups during legacy-index repair, excluding cold worker startup from the responsiveness assertion.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, narrowly scoped test repair absent from current main. Source inspection found no actionable defect, and the reported blocking-await control supports preserving regression sensitivity.

Priority: P2
Reviewed head: b7c56432b1b23b2fa1631f0caf4b880b1c8ff1f2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair with a credible negative control and no identified correctness or security defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test-only PR is exempt from external-contributor runtime proof. Its reported real SQLite/worker fixture runs and blocking-await control address the changed assertion; no production or stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored test-only PR is exempt from external-contributor runtime proof. Its reported real SQLite/worker fixture runs and blocking-await control address the changed assertion; no production or stored-data contract changes.
Evidence reviewed 7 items Introduced change preserves the assertion: The pinned introduction delta adds an existing worker import and an awaited index-state read before either candidate lookup. The provider gate, completion assertion, expected empty results, repair drainage, and post-repair results remain unchanged.
Preparation uses the existing retrieval owner: Index-state and curated-candidate requests use the same retrieval pool. The index-state worker branch reads index facts and closes its reader; it does not query candidates, admit repair, or release the provider gate. Candidate repair admission remains in the manager’s curated-retrieval path.
Read-only worker path: The index-state request opens the requested agent database read-only and returns readMemoryRetrievalIndexState. The fixture consistently creates agent main, matching the added preparation request.
Findings None None.
Security None None.

How this fits together

Memory Core retrieves indexed notes for automatic recall while legacy indexes can rebuild in the background. These tests check that foreground candidate requests finish without waiting for that rebuild and return classified results afterward.

flowchart TD
  A[Legacy memory index] --> B[Upgraded memory manager]
  B --> C[Prepare retrieval reader]
  C --> D[Timed candidate lookups]
  B --> E[Background repair held]
  D --> F[Prompt empty results]
  E --> G[Release repair and verify results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +7. Total +7 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Keep reader readiness outside the repair-independence deadline while preserving the held-rebuild regression and post-repair persistence checks.

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

Yes for the reported test scenario: the body identifies the failing group and environment, and source confirms cold retrieval startup falls inside the original assertion window. The intermittent failure was not independently executed during this read-only review.

Is this the best way to solve the issue?

Yes. Preparing the existing read-only worker isolates the intended repair-independence contract without extending the deadline, bypassing candidate retrieval, or changing production code.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Repairs a bounded CI test reliability problem without changing production behavior.
  • 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 maintainer-authored test-only PR is exempt from external-contributor runtime proof. Its reported real SQLite/worker fixture runs and blocking-await control address the changed assertion; no production or stored-data contract changes.

Label justifications:

  • P2: Repairs a bounded CI test reliability problem without changing production behavior.
  • 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 maintainer-authored test-only PR is exempt from external-contributor runtime proof. Its reported real SQLite/worker fixture runs and blocking-await control address the changed assertion; no production or stored-data contract changes.

Evidence

What I checked:

  • Introduced change preserves the assertion: The pinned introduction delta adds an existing worker import and an awaited index-state read before either candidate lookup. The provider gate, completion assertion, expected empty results, repair drainage, and post-repair results remain unchanged. (extensions/memory-core/src/memory/manager-candidate-repair.test.ts:71, b7c56432b1b2)
  • Preparation uses the existing retrieval owner: Index-state and curated-candidate requests use the same retrieval pool. The index-state worker branch reads index facts and closes its reader; it does not query candidates, admit repair, or release the provider gate. Candidate repair admission remains in the manager’s curated-retrieval path. (extensions/memory-core/src/memory/manager-cpu-worker-runtime.ts:37, b7c56432b1b2)
  • Read-only worker path: The index-state request opens the requested agent database read-only and returns readMemoryRetrievalIndexState. The fixture consistently creates agent main, matching the added preparation request. (extensions/memory-core/src/memory/manager-search.worker.ts:111, b7c56432b1b2)
  • Current-main necessity: Comparison against fetched main shows that this preparation is still absent; the only difference in the affected test is this PR’s warmup. (extensions/memory-core/src/memory/manager-candidate-repair.test.ts:71, fbc540f147e5)
  • Latest-release comparison: The supplied latest release contains the original test blob dd29e6ae6d10d02a52f6b2f5ebdbd874066d36e4, matching the pre-patch version rather than the proposed reader preparation. (extensions/memory-core/src/memory/manager-candidate-repair.test.ts, ec9c1a13db89)
  • Reported validation and negative control: The captured PR body reports an original-order failure on Linux Node 24.19.0 with two-CPU affinity, both prepared-reader probes failing when the historical blocking await was restored, and all 228 tests passing afterward in 189.75 seconds. It separately reports 618.73 ms cold readiness and a three-test focused run taking 178.98 seconds including cold compiler preparation. These are author-reported results; this read-only review did not execute tests. (b7c56432b1b2)

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

Copy link
Copy Markdown
Contributor Author

Superseded by the memory fixture repair in #155745 (5c9d100c72a08cbc0c3d1f09e5590ec27bd8d8e5), by @vincentkoc.

The landed fixture checks that both public candidate promises settle after a FIFO read barrier and before the held rebuild is released, with provider-entry and cancellation cleanup. It directly verifies repair independence; this PR's separate warmup is unnecessary, and the landed test does not claim a one-second cold-start guarantee.

Verified the canonical source and Linux proof: all three cases passed, and restoring the historical blocking await made both startup variants fail at the intended post-barrier assertion (zero completed instead of two), without timeout or unhandled error. The proof driver's separate summary-count check failed because Vitest grouped identical traces; both named failures were checked from the retained output without a rerun. Closing this PR as superseded, not merged.

@steipete steipete closed this Sep 22, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The fixture failure is now covered on main by #155745, merged as 5c9d100c72a08cbc0c3d1f09e5590ec27bd8d8e5.

That change queues an index-state read behind both candidate lookups on the same retrieval worker, then checks that both public calls completed while the repair gate remains held. It also uses the existing provider-entry signal and releases the rendezvous on test cancellation. Memory production behavior is unchanged. The landed PR records a blocking-await negative control that fails both startup modes, followed by all three corrected cases passing.

I verified the changed fixture and its ownership path in freshly fetched main d15cac3f06178f7aa6a49d746ae2201dcd3eb4a4. This supersedes the warm-up-only adjustment here, so I am closing this PR as already addressed on main.

@RomneyDa
RomneyDa deleted the codex/memory-candidate-reader-readiness-20260922 branch October 22, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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