Skip to content

fix(tests): observe queued embeddings serialization - #155658

Closed
steipete wants to merge 1 commit into
mainfrom
codex/frv-embeddings-cleanup-20260922
Closed

steipete wants to merge 1 commit into
mainfrom
codex/frv-embeddings-cleanup-20260922

Conversation

@steipete

@steipete steipete commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The three embeddings serialization tests could pass before a second HTTP request reached provider admission.

User Impact

This strengthens internal regression coverage. Production behavior and existing response, ordering and cleanup assertions remain unchanged.

Why This Change Was Made

The table now uses the existing pass-through lease observer pattern and provider-entry helper before checking that another provider has not been created. The local-provider row registers its synthetic descriptor, and existing cleanup restores the observer. Main already owns the fixture-lifetime and disconnected-request repairs; this follow-up preserves those changes and touches only the three table rows.

Evidence

With serialization deliberately bypassed, the unchanged table incorrectly passed all three cases. The repaired table rejected all three under the same bypass, with normal teardown. The final source passed all 43 owner tests and all 429 tests in the original 12-file HTTP/models group, selected changed checks, direct type-aware lint and independent review through P2. A temporary floating-Promise canary confirmed type-aware lint rejects the violation; the exact reviewed bytes were restored.

pnpm test src/gateway/embeddings-http.test.ts --maxWorkers=1 took 151.219 seconds wall. The 12-file group took 258.939 seconds. No cases, Gateway boots, timeout increases, production changes or extra support files were added.

This proof covers frozen main 0a5b5381a26b8480021005dc0145524ba6181cdb plus the one-file change. Exact-head CI 35745087574 passed on df119c037bdb65ce62e56784e96c5371fa5aae88. The changed-test job took 212 seconds and its boundary job 188 seconds (whole-job measurements); earlier-head CI remains historical. Historical Linux timing attribution and full latest-main qualification remain open.

@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 gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 22, 2026
@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, 11:14 AM ET / 15:14 UTC (Revision 5).

ClawSweeper review

What this changes

Strengthens three embeddings HTTP tests by observing actual provider admission before checking serialization and registering the synthetic local provider’s descriptor.

Merge readiness

✅ Ready for maintainer review

The revised patch remains useful and has no blocking findings. It preserves main’s fixture repairs and resolves the earlier composition concern; the overlapping cleanup PR does not justify automatically closing this maintainer-owned work.

Priority: P2
Reviewed head: df119c037bdb65ce62e56784e96c5371fa5aae88

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable test repair with reported mutation sensitivity and no actionable correctness or security findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test repair is exempt from external-contributor runtime proof. Its reported mutation control exercises HTTP admission and provider cleanup through the existing Gateway suite; no 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 repair is exempt from external-contributor runtime proof. Its reported mutation control exercises HTTP admission and provider cleanup through the existing Gateway suite; no stored-data contract changes.
Evidence reviewed 7 items Pinned introduced change: The introduced patch only strengthens the existing serialization table. The observer forwards to the real lease owner, the second request is tracked and joined, and the spy is restored after provider draining.
Production contract and existing observation pattern: The lifetime owner serializes acquisition through a per-scope promise tail and holds that tail through cleanup for local providers. The HTTP owner determines locality from registered descriptors, explaining the added local descriptor. The adjacent disconnected-waiter test already uses the same forwarding lease observer. No Codex harness or protocol dependency is involved.
Current main still has the coverage gap: Comparison with fetched main shows the same focused table patch: main still uses a microtask-only wait and lacks this row’s synthetic local descriptor. Production endpoint and lifetime blobs match between fetched main and the reviewed head. No shipped-fix claim is made.
Findings None None.
Security None None.

How this fits together

The Gateway embeddings endpoint converts authenticated HTTP requests into vectors through configured embedding providers. These tests verify that a replacement provider waits until the previous provider’s cleanup finishes.

flowchart TD
  A[Authenticated HTTP requests] --> B[Embeddings endpoint]
  B --> C[Provider admission queue]
  C --> D{Previous cleanup finished?}
  D -->|No| E[Wait for cleanup]
  E --> D
  D -->|Yes| F[Create provider and return vectors]
  C --> G[Test observes admission and ordering]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +11. Total +11 across 1 file.

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

Review metrics

Metric Value Why it matters
Regression sensitivity 3 existing cases strengthened; 0 additional server boots The reported mutation control detects serialization bypass without expanding the test matrix or Gateway startup cost.

Technical review

Best possible solution:

Retain one canonical serialization table that observes real admission, accurately models local providers, and preserves main’s fixture cleanup.

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

Yes, for the test weakness: current main checks provider creation after only a microtask yield, which does not establish HTTP admission. The body also reports a failing serialization-bypass control; this review did not execute it.

Is this the best way to solve the issue?

Yes. Reusing the existing forwarding observer and provider-entry helper is a narrow repair that strengthens the original assertions without changing production code or adding a competing test harness.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a concrete regression-coverage gap with limited scope and 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 repair is exempt from external-contributor runtime proof. Its reported mutation control exercises HTTP admission and provider cleanup through the existing Gateway suite; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The introduced patch only strengthens the existing serialization table. The observer forwards to the real lease owner, the second request is tracked and joined, and the spy is restored after provider draining. (src/gateway/embeddings-http.test.ts:833, df119c037bdb)
  • Production contract and existing observation pattern: The lifetime owner serializes acquisition through a per-scope promise tail and holds that tail through cleanup for local providers. The HTTP owner determines locality from registered descriptors, explaining the added local descriptor. The adjacent disconnected-waiter test already uses the same forwarding lease observer. No Codex harness or protocol dependency is involved. (src/gateway/embeddings-provider-lifetime.ts:8, df119c037bdb)
  • Current main still has the coverage gap: Comparison with fetched main shows the same focused table patch: main still uses a microtask-only wait and lacks this row’s synthetic local descriptor. Production endpoint and lifetime blobs match between fetched main and the reviewed head. No shipped-fix claim is made. (src/gateway/embeddings-http.test.ts:830, dea53ea3fa4a)
  • Prior composition concern resolved: Raw test-merge parents are exactly pinned base 5c9d100 followed by reviewed head df119c0. Its delta preserves main’s cleanup helpers and contains only the table improvement. The captured body reports validation of this main-compatible composition. The previous reviewed commit was unavailable locally, so no direct earlier-head comparison is claimed. (src/gateway/embeddings-http.test.ts:833, 92b05bfd7add)
  • Reported mutation and validation evidence: The complete captured PR body reports that bypassing serialization let all three original rows pass, while the repaired rows rejected that bypass. It reports 43 passing owner tests, 429 passing HTTP/models group tests, and 151.219 seconds for the one-worker owner run. These are contributor-reported results, not executions performed during this read-only review; fresh hosted CI remains a normal gate. (df119c037bdb)
  • Overlapping active work: The supplied body for test(gateway): isolate embedding cleanup fixture state #155703 explicitly incorporates the local-descriptor and admission observations and additionally resets provider mocks after draining. It remains an open same-author implementation, not a merged replacement. The Google Meet cross-reference concerns a separate shutdown lifecycle defect. (3bbe5450d56d)

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 (4 earlier review cycles)
  • reviewed 2026-09-22T10:28:53.542Z sha 6d09a75 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T12:10:48.509Z sha f9271d4 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T14:00:20.952Z sha d5e9bbaa68e84cc90a073a1274f953d8e8c9e943 :: blocked before merge. :: none
  • reviewed 2026-09-22T14:30:48.725Z sha d5e9bbaa68e84cc90a073a1274f953d8e8c9e943 :: blocked before merge. :: none

@steipete
steipete marked this pull request as ready for review September 22, 2026 10:35
@steipete
steipete force-pushed the codex/frv-embeddings-cleanup-20260922 branch from 6d09a75 to f9271d4 Compare September 22, 2026 11:20
@steipete
steipete force-pushed the codex/frv-embeddings-cleanup-20260922 branch from f9271d4 to d5e9bba Compare September 22, 2026 13:51
@steipete steipete changed the title fix(tests): settle embedding cleanup fixtures fix(tests): observe queued embeddings admission Sep 22, 2026
@steipete
steipete force-pushed the codex/frv-embeddings-cleanup-20260922 branch from d5e9bba to df119c0 Compare September 22, 2026 15:07
@steipete steipete changed the title fix(tests): observe queued embeddings admission fix(tests): observe queued embeddings serialization Sep 22, 2026
@vincentkoc vincentkoc self-assigned this Sep 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Thanks @steipete. The explicit local-provider descriptor and forwarded second-admission observation from this PR are included in the canonical fixture repair, landed through #155703 as 6b89bf8. That repair reuses the server and cleanup owners already on main and also resets all three one-shot mock queues after provider drain.

I compared the current head df119c037bdb65ce62e56784e96c5371fa5aae88 against the landed source: its assertions and behavior are covered, with no unique remaining fix. Closing as superseded. The canonical change passed 20 complete file runs, three original-order groups, owner siblings, current-head CI, and independent source/proof review.

@vincentkoc vincentkoc closed this Sep 22, 2026
@RomneyDa
RomneyDa deleted the codex/frv-embeddings-cleanup-20260922 branch October 22, 2026 03:12
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 P2 Normal backlog priority with limited blast radius. 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.

2 participants