Repository navigation
feat: narrow held-audio recovery with an optional cohort - #22991
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6473716f43
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| raw = os.getenv('STT_CAP_RECOVERY_COHORT') | ||
| state = _recovery_cohort_state(raw) | ||
| return state == 'unset' or state == 'set' and cohort_admits(uid, raw) |
There was a problem hiding this comment.
Wire the recovery cohort into deployed executors
When the documented probe sets STT_CAP_RECOVERY_COHORT=uid:<test>, the repository's Cloud Run deployment path cannot propagate that value to the backend and backend-sync recovery executors: the key is absent from backend/deploy/runtime_env/_base.yaml and its overlays, and it is not an approved live-managed setting in check_cloud_run_env_drift.py (the only private-values path found targets the GKE listen chart). Those revisions therefore read None here, which line 112 deliberately interprets as unrestricted, allowing recovery for the entire effective dispatch cohort instead of only the probe account. Add a private runtime binding for every API/sync recovery executor before making the unset state fail open.
AGENTS.md reference: backend/AGENTS.md:L151-L153
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Picks up #22995 (P17 capture_live_recovery fix) and main through 31756b9, which includes #22877 episodes (d6b734b; prod deploy freeze until the EPISODES_PERCENT=0 overlay lands, staging allowed per lead 88c5cd). Conflicts: - utils/sync/cap_hold_recovery.py: main's optional recovery cohort (#22991) and pacing metrics (#22970); module gates on recovery_admission_enabled. Kept integration's lane-returning _selected_lane, funded-processing reservation and batch hand-off. - main.py / app_roles.py: kept the B8 role-map mount; Mount(episodes) added in main's position (between pending_work and commitment_followup). - .github/ci-budget.yaml: six rationale strings carry both sides' notes. - config/feature-flags.yaml: both sides' rows; registry re-rendered. Adaptations: 8 label-debt entries (episodes/memory-source/held-content metrics, owner lane 14); test_summary_delivery first-import case allowlisted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Held-audio recovery for the original-live cap cohort runs only when API and backend-sync declare STT_CAP_DISPATCH_ENFORCEMENT=true. The base manifest pins it false, so every Cloud Run deploy reset recovery off. Pin it on in the prod overlay. Merge with the 100% cap step, when the #22991 narrowing is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* feat(deploy): keep STT cap enforcement on for prod API and sync Held-audio recovery for the original-live cap cohort runs only when API and backend-sync declare STT_CAP_DISPATCH_ENFORCEMENT=true. The base manifest pins it false, so every Cloud Run deploy reset recovery off. Pin it on in the prod overlay. Merge with the 100% cap step, when the #22991 narrowing is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: regenerate feature flag registry for the prod cap enforcement overlay Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(deploy): recompose runtime_env.yaml for the prod cap enforcement overlay Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(deploy): prod API and sync enforce STT cap dispatch in the runtime manifest The manifest guard still asserted the pre-rollout dark-everywhere state after this branch flipped STT_CAP_DISPATCH_ENFORCEMENT to 'true' for the prod backend and backend-sync Cloud Run services. Encode the new intended state instead: enforcement on for exactly those two prod services, dark everywhere else, cohort runtime-doc driven (empty in the manifest), lanes live-only. Fixes the Backend unit shard 2/6 failure (and the aggregated Backend unit suite) on run 39604250788. * chore(deploy): describe STT cap dispatch enforcement in the prod overlay accurately The overlay comment described held-audio recovery, which is one consumer of the gate, not what the flag does. State the actual behavior: funded STT cap dispatch admission, cohort- and lane-gated, with the cohort resolved from the runtime rollout document. --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: David Zheng <[email protected]>
Change
Held-audio recovery follows the same effective dispatch cohort as listen (prod:
pct:25). A one-account production recovery receipt would therefore wake other in-cohort owners with existing consent. (Correction: staging is isolated. All four staging services runFIRESTORE_DATABASE_ID=staginginbased-hardware-devwith in-cluster Redis, and the integration data-plane fence indatabase/_client._firestore_database_id()refuses to boot against prod Firestore, prod buckets or omi.me hosts. On staging this variable is defence in depth; for the prod probe it is the guard.)Add
STT_CAP_RECOVERY_COHORTas an optional intersection with effective dispatch membership, enforcement and original lanes. It reuses the dispatchuid:,pct:N, and soleallgrammar. Absent preserves existing behavior; malformed (including empty) denies all recovery and emits one warning per process without private tokens. Listen hold admission and backlog display remain unchanged.omi_stt_cap_recovery_cohort_narrowed{state="unset|set|malformed"}is a one-hot configuration gauge with no UID labels.Gate the processing-backlog API and manual/upgrade consent, durable-redrive owner visits, worker entry/continuation, direct wakes, selected manifests, recovery rows, and new sync provider attempts. Custody sealing/cleanup remains active. No held-audio recovery entry path was found that could not be gated.
This uses shared admission primitives and the existing parser rather than a second cohort resolver or a new control document. Extend the existing subject-bearing gate check to cover the recovery predicates.
Validation
make setuppassed in the dedicated worktree.omi-heavy, frombackend, withBACKEND_PYTEST_WORKERS=4 BACKEND_UNIT_TEST_FILE_LIST=<private test-path list> nice -n 10 ./test.sh.make preflight: 36 checks passed. PR metadata validation: 4 checks passed. Standalone async-blocker scan: zero blocking findings.Staging probe plan (separate deployment/window authorization)
based-hardware-devservicesbackend-stagingandbackend-sync-staging. Through the private-values path, setSTT_CAP_RECOVERY_COHORT=uid:<test>on every API/sync recovery executor before enabling recovery. Never commit the value or include the identity in a public receipt. Staging data isolation comes from the data-plane fence; still audit serving revisions and scheduler targets.rollout_cohorts/stt-cap-dispatchdocument and listen hold admission unchanged. Privately verify that the agent-owned test account belongs to the effective dispatch cohort; this env cannot add it. Verify the running release identity and freshstate="set"metric on every participant. A state gauge does not attest the private UID, so inspect the effective value privately.Production probe and ramp (separately authorized after staging passes)
uid:<test>narrowing on all production API/sync recovery executors before activating recovery. Verify release identities, traffic/scheduler targets, the private effective values, effective dispatch membership and freshstate="set"metrics. Keep listen and the shared cohort unchanged.state="unset". This may resume other owners' already-consented holds. A missed deadline is a blocker; no automatic widening. The registry records this ramp.pct:0on every API/sync executor, retaining custody/redrive and listen behavior. In-flight accepted calls may finish. Emptying the variable fails closed; removing it widens and is not rollback.No environment calls, flag flips, secret writes, deploys or merge were performed by this PR task.
Product invariants affected
none