Repository navigation
toil killers: skip duplicated pre-push for CI-green SHAs; persist ops env in prod manifest - #22978
Conversation
Fast-forwarding a branch to a SHA that GitHub CI already certified re-ran the whole local pre-push suite against an unchanged tree (about 55 minutes on each rollout sync). scripts/pre-push now asks GitHub about every pushed SHA first and exits early only when each one has GitHub's tree equal to the local tree, at least one successful CI workflow run (push / pull_request / merge_group) and every CI run on it terminal and green, and no red commit status. Deployment writers from the LOCK_CONTRACTS registry neither certify nor block. Not a skip hatch: the check reads no environment, fails closed on any error, timeout, unknown SHA or non-GitHub remote, and logs every verdict to <git-common-dir>/omi-pre-push-ci-verified.log. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nders Every Cloud Run train reset four ops values that the lead then restored by hand, because the prod overlay pinned their old values. Record today's live values (read with the ro-prod tier): - BATCH_PIPELINE_SPEECH_EMPTY_MULTILINGUAL_ENABLED=true on backend, backend-sync and backend-sync-backfill (integration already true) - SUMMARY_DEBT_REPAIR_ENABLED=false on backend-sync - BATCH_PIPELINE_RECOVERY_ALL_ADMITTED=true on backend-integration render_backend_runtime_env.py now fails the deploy before any output is emitted when a manifest env key does not come back out of the exact text handed to deploy-cloudrun (missing, duplicated, changed value) or is also named for removal in the same deploy. Provisional keys without a supplied value keep their documented preserve-live omission. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… statuses The deploy-writer registry decides which workflow runs the CI-verified check ignores, so reading it from the working tree let a local edit widen that set. The hook now passes its base ref and the registry is read with git show at that ref. A combined commit status now has to be success whenever any status exists; only GitHub's pending-with-zero-statuses answer is neutral. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: e9a6ab2baa
ℹ️ 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".
| | `STT_ROUTING_MODE` | Off shadow or cost-ordered health-gated live STT routing | backend | env | closed | declared | shadow (backend-listen (chart), gke/backend-listen) | on (backend-listen (chart), gke/backend-listen) | — | pending | undecided | 2026-11-04 | dazheng | | ||
| | `STT_ROUTING_ON_PERCENT` | Sticky UID percentage admitted to the cost router; zero keeps static routing | backend | env | closed | declared | 0 (backend-listen (chart), gke/backend-listen) | 90 (backend-listen (chart), gke/backend-listen) | — | pending | undecided | 2026-11-04 | dazheng | | ||
| | `SUMMARY_DEBT_REPAIR_ENABLED` | Code default false; production on for scheduled backend-sync; bounded completed server-minimum repair; requires first-summary gate | backend | env | closed | — | — | {value: 'true', category: rollout} | — | pending | undecided | 2026-11-04 | dazheng | | ||
| | `SUMMARY_DEBT_REPAIR_ENABLED` | Code default false; production on for scheduled backend-sync; bounded completed server-minimum repair; requires first-summary gate | backend | env | closed | — | — | {value: 'false', category: rollout} | — | pending | undecided | 2026-11-04 | dazheng | |
There was a problem hiding this comment.
Describe debt repair as disabled in production
The production value is now false, but this row still says the scheduled backend-sync sweep is on. The source summary in config/feature-flags.yaml:364 and the operational statement in backend/docs/listen_pusher_pipeline.mdx:5773 remain stale as well, so operators following the registry or regenerating it receive contradictory guidance and may restore the setting this change intends to keep disabled. Update the source description and affected operational documentation, then regenerate the registry.
AGENTS.md reference: backend/AGENTS.md:L134-L134
Useful? React with 👍 / 👎.
| if not green: | ||
| raise NotVerified(f"{sha[:12]}: no successful CI workflow run on this exact SHA") |
There was a problem hiding this comment.
Require a recognized CI suite before skipping checks
Any single successful run from CI_EVENTS is enough to satisfy this condition, even if that workflow performs no validation and every relevant check workflow is absent rather than pending or failed. For example, .github/workflows/pr-declined-comment.yml is a pull_request_target workflow included by CI_EVENTS, but its only job posts a comment; if that is the only eligible run reported for the SHA and there are no legacy statuses, this returns verified and scripts/pre-push exits before running any local checks. Require success from an allowlisted comprehensive check workflow or otherwise prove that the expected check set ran, rather than treating any successful workflow as certification.
Useful? React with 👍 / 👎.
… review Grok review of #22978 (FIX-FIRST): - pull_request runs test the PR merge ref, whose tree differs from the head whenever the branch is behind main, so they no longer certify a SHA; they still block when not terminal or not success/skipped. Only push and merge_group successes certify. pull_request_target (base checkout) is ignored. neutral is no longer green. - Default CodeQL runs (event "dynamic") now block when queued or red. - The deploy-writer registry is fetched from the push remote's main on GitHub instead of a local ref, so PRE_PUSH_BASE_* cannot widen the set of ignored runs. Any failure judges deploys as CI. - The commit payload must carry the requested SHA. - Job renders pass their own --remove-env-vars flag into the render assertion, not only forbidden_env. - Docs and the flag summary now say debt repair is held off in prod. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
omi/backend/deploy/runtime_env/prod.overlay.yaml
Lines 1514 to 1515 in c93c444
When this production overlay deploys the CPU recovery host, it enables multilingual recovery, but backend/docs/batch-pipeline-serving.md:429-440 still labels the feature dark and explicitly instructs operators to keep it off until an owner-scoped canary succeeds. This leaves the rollout and rollback guidance contradictory to the persisted production state; document the completed canary and enabled host scope, or keep the flag false until those prerequisites are met.
ℹ️ 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".
| category: rollout | ||
| BATCH_PIPELINE_RECOVERY_ALL_ADMITTED: | ||
| value: 'false' | ||
| value: 'true' |
There was a problem hiding this comment.
Correct the all-admitted recovery control documentation
With production recovery mode already on, this value expands the recovery sweep from the owner allowlist to every admitted owner, but backend/docs/listen_pusher_pipeline.mdx:5461-5464 says that BATCH_PIPELINE_RECOVERY_ALL_ADMITTED=false permits that expansion. The implementation in backend/config/policy/stages.py:112-124 requires this flag to be true, so an operator following the owning pipeline documentation would apply the opposite setting; update that control description alongside the rollout.
AGENTS.md reference: backend/AGENTS.md:L159-L159
Useful? React with 👍 / 👎.
| flags = _render_flag_values(_as_config_dict(job_config.get('flags')) or {}) | ||
| listed = {name for name in flags.get('--remove-env-vars', '').split(',') if name} | ||
| return listed | set(job_config.get('forbidden_env', [])) |
There was a problem hiding this comment.
Include workflow-only job removals in the assertion
This helper only inspects the manifest's flags, but existing jobs also remove variables through workflow-only flags—for example, .github/workflows/gcp_notifications_job.yml:220-223 carries a large literal --remove-env-vars list that is absent from the notifications manifest entry. If one of those names is later added to the manifest env, assert_manifest_env_renders will approve it even though the exact deploy command both updates and removes that key; the Cloud Run jobs command reference confirms these are separate environment-update controls. Source the actual workflow removal set, or move those removals into the manifest, before claiming every rendered key will land.
AGENTS.md reference: backend/AGENTS.md:L153-L153
Useful? React with 👍 / 👎.
…card test fix from #22877)
# Conflicts: # .github/checks-manifest.yaml
#22226 added test_first_attempt_past_the_per_attempt_deadline_still_summarizes with a 0.1 s per-attempt budget after #22797's real-clock-budget ratchet landed, so "Backend unit guardrails" fails on main for every PR that runs it (main's own push CI does not select the job). Scale the per-attempt budget to 0.5 s and the slow turn to 0.75 s: same ratio, still past one attempt and inside the mount's import-time whole-transport deadline. The sleep is wall time, so the CPU-time fast-unit guard is unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # backend/tests/unit/test_conversation_structure_provider_timeout.py
Summary
Two toil killers from the two-lane rollout (P12,
toil-killers).1. Pre-push: skip the duplicated local suite for CI-green exact SHAs. Fast-forwarding a branch to a SHA that GitHub CI already certified re-ran the whole local pre-push suite against an unchanged tree. That cost about 55 minutes on sync 14 and again on sync 15.
scripts/pre-pushnow callsscripts/pre_push_ci_verified.pyright after reading the pushed refs, and exits early only when every pushed SHA meets all of these:pushormerge_grouprun on that SHA concludedsuccess. Those are the only runs that check out the commit itself. Apull_requestrun tests the PR merge ref, whose tree differs whenever the branch is behind main.push,merge_group,pull_requestand default-CodeQL (dynamic) run on it is terminal and concludedsuccessorskipped.pull_request_targetruns, which check out the base, are ignored.success.In practice the skip applies to fast-forwards onto a main commit whose push CI has settled. A PR head that only has
pull_requestruns always runs the full suite.Deployment writers (the
LOCK_CONTRACTSregistry incheck-deployment-concurrency.py, fetched from the push remote'smainon GitHub, never from a local file or ref) neither certify nor block. On main they sit parked behind their lock or get cancelled by a newer push, and that says nothing about the commit.This is not a skip hatch. The check reads no environment variable. It fails closed on any error, timeout, unknown SHA, non-GitHub remote or unparseable answer, and then the full suite runs. Every verdict is printed and appended to
<git-common-dir>/omi-pre-push-ci-verified.log. The hook lives inscripts/; nothing under.github/workflowschanges. The new test goes in.github/scripts/, registered in.github/checks-manifest.yaml, next to its siblingtest_pre_push_ci_prediction.py.2. Ops-env drift after every Cloud Run train. The prod overlay pinned old values for keys the lead hand-sets live, so every train reset them and they were restored by hand. The train logs (
ops_env.py restore … drifted:) and aro-prodread of the live services agree on the set. The overlay now records today's live values (values only, no secrets, no allowlists):BATCH_PIPELINE_SPEECH_EMPTY_MULTILINGUAL_ENABLEDSUMMARY_DEBT_REPAIR_ENABLEDBATCH_PIPELINE_RECOVERY_ALL_ADMITTEDAfter the change, a
ro-proddiff of live env against the regenerated manifest shows no remaining value differences for the ops prefixesops_env.pycovers. Live-only keys (allowlists,FIRST_SUMMARY_DEADLINE_SECONDS,SYNC_ASSIGNMENT_RECOVERY_ENABLED) are not in the manifest, so deploys preserve them. They were never reset and are left alone.The deploy-time assertion lives in
render_backend_runtime_env.py, which the deploy action already runs before every Cloud Run deploy. Before emitting any output, it parses each service's and job's renderedenv_varstext back through deploy-cloudrun's escape grammar. It fails the deploy if a manifest key is missing, duplicated or changed, or if it is also named in that service's--remove-env-varsset. Unset provisional keys keep their documented preserve-live omission.test_summary_production_policy.pypinnedSUMMARY_DEBT_REPAIR_ENABLED=true(#22172). It now pins the livefalse, with a comment. The rollout lead was notified on the bus before merge.Lane / contract
P12
toil-killers(two-lane rollout swarm). Owner sign-offs for edits to other lanes' files: none.Product invariants affected
backend/deploy/runtime_env*is the production runtime manifest; no memory admission behaviour changes.Verification
.github/scripts/test_pre_push_ci_verified.py: 25 tests pass, at two layers. Unit tests cover green, unknown, red, neutral, in-progress, pull_request-blocks-but-never-certifies, CodeQL dynamic, pull_request_target, wrong commit payload, deploy-writer, unreadable registry, tree-mismatch, commit-status, multi-SHA, unreachable and unexpected-error verdicts. Hook-level tests run the realscripts/pre-pushin a fixture repo with a fakegh: a green exact SHA ends the hook before check selection; unknown, red and unreachable reach the full suite; env vars cannot force the skip.gh apiagainst BasedHardware/omi:e6877adc9f06(settled main head): verified, 8 successful push runs, tree matches, about 4s.34b3396cc208: not verified while its CodeQLdynamicrun is still queued.origin/main~6: not verified, becauseRepo Checkswas cancelled.backend/test.sh(nice -n 19,omi-heavy). All pass, including 7 new renderer tests: every dev/prod Cloud Run service and job renders every manifest key, escape round-trip, missing / changed / duplicated / stray / removed keys fail, provisional omission allowed, and a full--env prodrender emits nothing on failure.compose_runtime_env.pyandrender_feature_flag_registry.pywere regenerated. PR preflight passed.Review response (Grok, FIX-FIRST on
e9a6ab2b)pull_request/pull_request_targetcertify a tree they did not run. Fixed: onlypush/merge_groupsuccesses certify.pull_requestblocks,pull_request_targetis ignored, andneutralis no longer green.dynamic) did not block. Fixed: adynamicrun blocks when non-terminal or red, and never certifies.PRE_PUSH_BASE_*could widen the ignore set. Fixed: the registry is fetched from GitHubmainviagh api …/contents. On any failure it is empty, so deploy runs are judged as CI.--registry-refis gone. The commit payload must now also carry the requested SHA.forbidden_env. Fixed: job renders also pass their own--remove-env-varsflag. Not done: movinggcp_notifications_job.yml's hardcoded removal list onto the job's manifest flags, because it needs a.github/workflowsedit, which David must name. No key in that list is in the notifications job env today.desktop_backendstays outside the assertion; its env keys don't intersect its workflow's removal list today.config/feature-flags.yamlsummary (registry regenerated),runbooks/summary-guarantee.mdandlisten_pusher_pipeline.mdxnow say it is held off (deferred 2026-10-20).Rollback
Revert the PR. For the pre-push skip alone, revert
scripts/pre-push's new block. For one ops value, flip it inbackend/deploy/runtime_env/prod.overlay.yamland regenerate.Failure-Class: none
🤖 Generated with Claude Code