Skip to content

fix(tests): repair two guards left red on main by the summaries changes - #25372

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-main-guards
Nov 15, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-main-guards

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Two slow-suite guards are red on main since #25340 and #25368 merged. This repairs both with test and inventory changes only; no production code changes.

Failure-Class: none

What was wrong

Both guards are marked slow and are selected by path, so the two pull requests' own CI did not run them; other pull requests (#25314, #25131) inherited the failures.

The repair

  • Inventory: utils/llm/summary_embeddings.py is registered with its policy stated beside the entry. It is the composer's single bounded embedding request for owner-memory retrieval. It enforces the generated-compute budget and resolves the BYOK key before any IO, and routes through the LLM gateway whenever gateway feature mode is on, which is the production setting on backend, backend-sync and backend-sync-backfill (OMI_LLM_GATEWAY_FEATURE_MODE=gateway, read from the serving specs). The direct client is the non-gateway branch only: same provider, key custody and model as clients.py OpenAIEmbeddings, with SDK retries off and the caller's absolute deadline. It lives outside clients.py so the notes routing digest and paid checkpoints stay unchanged. Both branches are exercised with the real SDK in test_episode_summary_provider_bounds.py. No gateway, BYOK or quota path is bypassed.
  • Tests: both context-budget tests now inject the clock and the completion event of composer_context_budget, so the caller's whole budget elapses deterministically while the provider call is still running. They still assert the properties the originals covered: the caller returns at the deadline and not when the non-cooperative provider finishes, partial context is discarded, completed sections survive, late results are never published, and the timeout fallback is recorded once. The ratchet and its allowlist are unchanged.

Verification

Both guards, the ratchet's stale-entry checks, the provider-bounds tests and the two edited test files: 89 passed locally with slow tests selected (-m "slow or not slow"). No tuning value, flag, state or schema changes.

Rollback: revert this commit; main returns to the two red guards.

Author: Claude Fable 5.2.

🤖 Generated with Claude Code

View guided diff

…budgets on an injected clock

Two slow-suite guards went red on main with BasedHardware#25340 and BasedHardware#25368, which the pull requests'
own path-selected CI did not run:

- the direct-provider inventory did not list utils/llm/summary_embeddings.py (AsyncOpenAI,
  the non-gateway branch of the composer's single bounded embedding request);
- two context-budget tests handed production code a real-clock budget under 0.5 s.

The inventory entry states its gateway policy. Both tests now let the caller's whole budget
elapse on an injected clock while the provider call is still running, and assert the caller
returned before the provider finished. No production code changes.

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 41d6ab7 into BasedHardware:main Nov 15, 2026
57 checks passed
Git-on-my-level added a commit that referenced this pull request Nov 15, 2026
Brings in the upstream guard repair (#25372) that unblocks this PR's backend
unit run, plus the episode default-context and pusher codec work. Resolves the
feature-flag registry conflict by keeping both sides: main's new
EPISODE_COMPOSER_DEFAULT_CONTEXT_ENABLED row plus this branch's
cancel_flow_parity row. No source file this PR touches was changed on main, so
the approved render/copy packet and the SCA-2364 stable-presenter lifecycle fix
are unaffected.
Git-on-my-level added a commit that referenced this pull request Nov 15, 2026
Follow-up retries fetch a projection policy even when the part is
already ready or quarantined and immediately returns. Return before that
unused fetch, removing one transaction/job read on the ordinary
pinned-policy path. Unfinished parts retain policy resolution and
refusal before side effects; the surrounding persisted-receipt and
completion transactions are unchanged.

This is a small additional cut for the Firestore intervention. It must
not delay #25314 or the admitted recovery-default restoration. Savings
are not booked before production measurement.

## Validation

- Head `813961ee1bd7e4de9925addc170e5bd04d30da91` normally merges main
`41d6ab74e7b7c6a69695bfdb47c0cea9f87f40a0`, including shared guard
repair #25372. The change-specific file blobs are unchanged from the
preceding head.
- Canonical focused fast lane: 70 passed (45 follow-up and25 gateway
tests); all11 clock-ratchet cases are marked slow and exercised by the
separate slow lane. Existing1s CPU ceiling unchanged.
- Canonical `scripts/run-slow-guardrails-ci.sh`: 2,051 passed, 1,471
deselected. This is the repository's distinct slow guardrail recipe.
- Normal successor pre-push gate passed. GitHub CI remains the full
required authority and is pending.
- Refreshed independent Luna source review: SHIP for exact
successor813961ee1bd7e4de9925addc170e5bd04d30da91 against41d6ab74. No
actionable defects in the two scoped files. No CI or serving approval is
inferred from a source verdict.

## Product invariants affected

none

Failure-Class: none

## Batch pipeline tuning

No capacity, concurrency, cadence, retry interval, state, retention,
allowance or policy values change. The existing ready/quarantined no-op
guard moves ahead of an unused policy fetch. No new state or queue is
introduced.

## Rollback

Revert this commit through the normal source/release path. No migration,
flag or production change is included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant