Skip to content

test(active-memory): control zero-hit recall polling - #149661

Merged
steipete merged 1 commit into
mainfrom
codex/active-memory-zero-hit-fixture-20260916
Sep 16, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/active-memory-zero-hit-fixture-20260916

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The recall test for usable search results with zero debug hits couples its 100 ms deadline to real filesystem scheduling. Slow I/O can exhaust that deadline before the test exercises the intended watcher behavior.

User Impact

More reliable Active Memory regression coverage. No production behavior, timeout, configuration, or dependency changes.

Why This Change Was Made

Use the neighboring tests' fake-clock pattern and wait for the real transcript read to reach the watcher before the model summary settles. The existing 100 ms deadline, 35 ms summary delay, and assertions remain unchanged. Controlling timers alone is insufficient: it can let the summary finish before the watcher consumes its read and hide an early-zero-hit regression.

Evidence

  • A controlled 125 ms filesystem delay makes the original test fail with a recorded 100 ms watchdog abort and missing context. The repaired test passes the same delay control.
  • A deliberate watcher regression that treats zero debug hits as terminal still fails the original summary assertion before the payload returns. This verifies the read synchronization exercises the relevant ordering.
  • All 214 tests in the original file order pass on Node 26.8.2, macOS arm64. Selected extension-test checks, formatting, and fresh independent P2 review pass.
  • The investigation followed the failed Active Memory case in #149118's CI. That saved failure lacks the recall status needed to establish its cause. An independently installed Linux Node 24.19.0 comparison passed all 214 tests on both the exact base and tested merge. This repair addresses the demonstrated test timing dependency; it does not claim to identify the historical CI failure or change the metadata optimization.

The patch changes one test file. Hosted exact-head CI remains required before landing.

@clawsweeper

clawsweeper Bot commented Sep 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.

@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 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 12:03 AM ET / 04:03 UTC (Revision 2).

ClawSweeper review

What this changes

The PR controls the clock and transcript-read ordering in an Active Memory regression test so slow filesystem operations do not exhaust its recall deadline.

Merge readiness

✅ Ready for maintainer review

The repair remains useful on current main, and no actionable patch defect was found. The protected maintainer PR should remain open for normal landing.

Priority: P3
Reviewed head: d6c812b4b1b5b12f9c8ef299063f03c73167e32e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair preserves meaningful assertions and has relevant reported validation, with no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test-only change is exempt from external contributor runtime proof; the captured body supplies focused delayed-I/O and regression-sensitivity validation for the recall fixture.
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 change is exempt from external contributor runtime proof; the captured body supplies focused delayed-I/O and regression-sensitivity validation for the recall fixture.
Evidence reviewed 7 items Verified introduced patch: The pinned merge-base-to-head diff changes only the existing regression test; its 100 ms deadline, 35 ms summary delay, and result assertions remain intact.
Watcher ordering and cleanup: The watcher consumes transcript records asynchronously before scheduling another poll. The new setImmediate synchronization lets that processing finish before the simulated summary settles; existing afterEach restores real timers and all spies.
Still necessary on current main: Fetched main retains the original real-time test without transcript-read synchronization. The latest-release file could not be inspected because its historical blob was unavailable; no shipped-fix claim is made.
Findings None None.
Security None None.

How this fits together

Active Memory searches stored memories before a conversational reply and adds relevant context to the main agent’s prompt. This test exercises the recall watcher’s handling of usable results whose diagnostic hit count is zero.

flowchart LR
  A[Conversation prompt] --> B[Active Memory recall]
  B --> C[Memory search transcript]
  C --> D[Recall watcher]
  D --> E[Usable summary]
  E --> F[Main agent context]
  G[Controlled test clock and read ordering] --> D
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +19. Total +19 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Keep the existing regression assertions while separating the simulated recall deadline from filesystem scheduling and ensuring the watcher processes results before summary completion.

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

Yes: current main starts a real 100 ms watchdog before asynchronous transcript work, so delayed I/O can consume the test budget. The PR reports a controlled failing reproduction; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes: controlling time and waiting for transcript consumption repairs the existing fixture without widening deadlines, weakening assertions, or adding production seams.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a focused test-reliability 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 maintainer-authored test-only change is exempt from external contributor runtime proof; the captured body supplies focused delayed-I/O and regression-sensitivity validation for the recall fixture.

Evidence

What I checked:

  • Verified introduced patch: The pinned merge-base-to-head diff changes only the existing regression test; its 100 ms deadline, 35 ms summary delay, and result assertions remain intact. (extensions/active-memory/index.test.ts:4092, d6c812b4b1b5)
  • Watcher ordering and cleanup: The watcher consumes transcript records asynchronously before scheduling another poll. The new setImmediate synchronization lets that processing finish before the simulated summary settles; existing afterEach restores real timers and all spies. (extensions/active-memory/transcript-watch.ts:139, d6c812b4b1b5)
  • Still necessary on current main: Fetched main retains the original real-time test without transcript-read synchronization. The latest-release file could not be inspected because its historical blob was unavailable; no shipped-fix claim is made. (extensions/active-memory/index.test.ts:4092, 0263e93ce860)
  • Captured validation and review continuity: The supplied PR body reports original-fail/repaired-pass results under 125 ms filesystem delay, a deliberate zero-hit watcher regression that still fails, and all 214 tests passing in original order. These are contributor-reported results, not reviewer executions. The prior completed review covered this same head and retained no findings or published rank-up moves. (d6c812b4b1b5)
  • Related work is distinct: fix(sessions): avoid saved-prompt reads when list metadata is current #149118 optimizes session metadata reads. Its CI motivated this investigation, but the captured discussion explicitly does not establish the cause of that historical failure or claim this test repair replaces the optimization.
  • Area-history routing: Current-main history lists Peter Steinberger on recall preservation and runtime-module refactors, including this recall-consolidation commit. Exact line-introduction attribution was not established because historical blobs needed by blame were unavailable. (extensions/active-memory/transcript-watch.ts, a72ff7a93fb1)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-16T03:54:21.118Z sha d6c812b :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 16, 2026 03:55
@steipete
steipete merged commit fcae2be into main Sep 16, 2026
161 checks passed
@steipete
steipete deleted the codex/active-memory-zero-hit-fixture-20260916 branch September 16, 2026 04:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: active-memory 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