Skip to content

fix(ci): deploy notifications-job with the verified LLM gateway endpoint - #21304

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/notifications-job-gateway-url
Oct 12, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/notifications-job-gateway-url

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Daily recaps stopped generating in prod on 2026-10-10 05:33 UTC. This change fixes the cause.

Root cause: gcp_notifications_job.yml rendered the job's runtime env without OMI_LLM_GATEWAY_URL. The manifest's default for that variable is the inert sentinel http://127.0.0.1:9. The notifications job runs with OMI_LLM_GATEWAY_FEATURE_MODE=gateway, so the 2026-10-10 dispatches deployed the sentinel. Since then, every daily_summary LLM call has failed with APIConnectionError: Connection error., which is 100% of daily_summary_user_failed lines in prod logs since 10-10.

Knock-on effect: those failing recipients keep every cohort complete=False. The saved cohort is resumed on every tick until its 7200s age-out, so the current cohort only runs about every 2 hours.

Live evidence before this fix: gcloud run jobs describe notifications-job showed OMI_LLM_GATEWAY_URL=http://127.0.0.1:9. The backend and backend-sync services carry the gated ILB endpoint.

Fix: mirror gcp_memory_maintenance_job.yml and gcp_x_connector_sync_job.yml:

  • Get GKE credentials and run verify-llm-gateway-serving.py --github-output.
  • Render with the verified gateway_url.
  • Fail closed if the URL is empty or the sentinel.

The deploy SA already holds container.viewer and compute.networkViewer, which the gate needs.

Adds a workflow contract test.

Failure-Class: FC-placeholder-value-passes-presence-check

Product invariants affected

  • INV-DATA-1 — the notifications job still targets the same prod data plane; this only replaces the inert gateway sentinel with the gated prod ILB endpoint the prod backend services already use.

Verification

  • render_backend_runtime_env.py --env prod --job notifications-job with OMI_LLM_GATEWAY_URL set renders that URL.
  • validate-backend-runtime-env.py --env prod --check-workflows passes.
  • 177 tests across the workflow-contract, job-identity, orchestrator, render and preflight suites pass.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

The job rendered OMI_LLM_GATEWAY_URL from the manifest's inert default
(http://127.0.0.1:9), so every daily recap generation has failed with
APIConnectionError since the 2026-10-10 deploy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T10:51:21.060175Z c8c3042 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8c3042470

ℹ️ 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".

Comment on lines +142 to +146
python3 backend/scripts/verify-llm-gateway-serving.py \
--environment="${{ vars.ENV }}" \
--project="${{ vars.GCP_PROJECT_ID }}" \
--region="${{ env.REGION }}" \
--github-output "$GITHUB_OUTPUT"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add the Cloud Run VPC probe before promotion

This gate only checks the Kubernetes workload and Compute forwarding-rule attachment; it never verifies that a Cloud Run job using CLOUD_RUN_VPC_NETWORK/CLOUD_RUN_VPC_SUBNET can reach and authenticate to the internal endpoint. If the Cloud Run route, subnet, or firewall is broken, this step still passes and the workflow deploys an unreachable URL, reproducing the daily-summary outage. The sibling memory-maintenance and X connector workflows run probe-llm-gateway-from-cloud-run.sh with the deployed image and target VPC before rendering/deploying the endpoint; notifications-job needs the equivalent fail-closed probe.

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit f22fab1 into main Oct 12, 2026
62 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/notifications-job-gateway-url branch October 12, 2026 10:57
aryanorastar added a commit that referenced this pull request Oct 16, 2026
…ciliation (#21362)

## What changed and why

Daily Recap recovery was unreachable on mobile/web, and successful
recovery could still disappear behind an older read or remain hidden on
Home. Offline Sync also left restored uploads without a job handle
permanently processing and overstated what successful processing proved.
Complete the recovery path and reconcile these remaining sync/reporting
gaps. Fixes #11821; remaining customer-account outcomes are tracked by
#21360.

- Add historical-date recovery to mobile Notifications settings/Daily
Recaps and web Conversations using the existing idempotent `POST
/v1/users/daily-summaries` authority. No push token or enabled schedule
is needed; source recordings and existing recaps are preserved.
- Publish successful mobile recovery to mounted Home readers, including
a previously empty Home section. Fence older reads, preserve existing
cards on failures, and offer retry. A malformed list envelope is a read
failure, not an empty account.
- Give web recap snapshots owner-scoped cache keys and one read lease
for initial load/refresh/pagination. Re-read after a creation/deletion
commits before adopting an older result, retain chronological order and
server offsets, reject late data after account switches, and surface
recap read failures with a specific retry.
- Reconcile uploaded WALs with missing/blank job handles: requeue
retained audio through the existing deduplicated upload path without
consuming retries; preserve unavailable rows when local audio is
missing. Persist the outcome and fence asynchronous file checks on
account changes.
- Show **Processed** rather than inventing a created conversation for an
empty/silent completed job. The legacy status card and empty-pending
state no longer claim completion while another recording needs
attention. Local-copy cleanup copy states the deletion period without
promising a cloud audio copy. Retention behavior, storage settings,
capacity controls and batching are unchanged.

## Product invariants affected

INV-CAP-1 — retained recordings stay intact through orphan-job recovery.
Requeueing preserves audio and retry budget; missing-file outcomes
remain visible rather than being acknowledged as synced. No deletion or
retention policy changes.

## How it was verified

- `bash app/test.sh`: full hermetic suite passed, **5,368 passed / 21
skipped**. Analyzer ratchet passed; existing informational diagnostics
remain within baseline.
- Focused mobile recovery/API/Home/sync tests: **176 passed**. WAL suite
also passed with `CAPTURE_EVIDENCE_V1_DARK_WRITE=true`: **146 passed**.
- `make mobile-verify ARGS='fast --paths
app/lib/pages/home/widgets/home_daily_recaps.dart
app/lib/pages/conversations/sync_page.dart
app/lib/pages/conversations/auto_sync_page.dart
app/lib/services/wals/local_wal_sync.dart'`: **23 existing relevant
journeys passed**. These are the seeded journey lane, separate from the
new focused recovery tests.
- `bun run check`: typecheck, Moonshine smoke, and the full current web
suite passed: **127 files / 682 tests**. The final recap lifecycle file
passed all 8 tests.
- Actual WAL service lifecycle regression: restored orphaned upload →
retained file requeued → upload ACK with job ID → job polling →
confirmed processing/conversation result → durable index reload. Audio
bytes stay unchanged; uploader/status transport are test seams, not a
real-device/backend-capacity measurement.
- Local HTTP smoke from the first commit exercised the real FastAPI
creation/list routes and emulator storage: disabled schedule, no FCM
token, missing October 4 recap beyond automatic catch-up, stable ID on
retry, one generation, zero pushes, honest 400 for an empty date, and
unchanged source conversation/prior recap/schedule. Only the summary
provider and quota gate were fixture seams.
- The recovery widget was exercised through that local API in an iOS
simulator and browser preview. The final actual legacy/Auto Sync widgets
were rendered with synthetic inventories and the bundled font, asserted,
captured, and visually inspected. No physical customer-device or
customer-account recovery test is claimed. Impeccable's final
changed-target detector returned no findings.

## Tests

`daily_summary_creation_test.dart` and `apiDailyRecaps.test.ts`:
endpoint/date/response identity, malformed/legacy replies and status
failures. `daily_recap_recovery_action_test.dart` and
`GenerateRecapAction.test.tsx`: date selection, cancellation, single
flight and honest failures. `home_recap_recovery_test.dart`: successful
recovery from another screen reveals Home, older responses cannot hide
it, and failed reads retry.

`useRecapsCreation.test.ts`: ownership, creation vs initial read, reads
both before and during deletion, malformed-response retry, stable
identity, chronological pagination and raw server offsets.
`ConversationSplitView.test.tsx` verifies the user-facing read-error
retry. `local_wal_sync_test.dart` covers missing/empty/whitespace
handles, durable retry state, preserved bytes, unavailable audio, and
the whole retained-file upload/poll lifecycle.
`sync_completion_truth_test.dart` and
`sync_row_recovery_window_test.dart` execute the actual sync
screens/rows and prevent false completion, conversation and cloud-copy
claims.

## Release and customer verification

The October scheduler/gateway/retry fixes (#21020, #21304, #21310) are
already on current main. Production notifications deployments for #21304
and #21310 succeeded on October 12. They restore the known generation
failures and remain required context for this report.

This PR needs **merge, a mobile release containing these changes, and
web deployment**. It uses existing backend contracts; **no new backend
deployment is required by this PR**. macOS already uses the shared
creation endpoint.

The remaining customer-account checks are operational verification, not
an assertion that the client PR restored customer data: confirm
scheduled recaps resumed, generate/check each missing eligible date from
retained server conversations, and confirm every reported recording
reached processing completion on the customer's installed release. The
feedback lacks a platform/version/exact sync error; do not claim the
orphan-job fix is its proven cause.

#21347 remains open for malformed stored recap read validation; #21319
remains open for pendant upload batching, and #21216 tracks
capacity/backlog complaints. Their causes are not established for this
customer. Do not duplicate those fixes or claim those separate symptoms
solved by this PR. Keep #21360/Featurebase open until the account
outcome is verified.

Local preflight passed all 27 checks. Architecture and
implementation/release checklist: `app/docs/recap-recovery.md`.

## UI evidence

Synthetic inventories; screenshots contain no customer data.

![Recovery on
iOS](https://raw.githubusercontent.com/BasedHardware/omi/04dda1ae63f6cca9181534b01de1bfac73300b47/.agent-artifacts/ui-evidence/daily-recap-recovery-completeness/001-mobile-ios-recovery-dark.png)
![Legacy sync needs
attention](https://raw.githubusercontent.com/BasedHardware/omi/04dda1ae63f6cca9181534b01de1bfac73300b47/.agent-artifacts/ui-evidence/daily-recap-recovery-completeness/003-mobile-ios-sync-needs-attention.png)
![Confirmed
processing](https://raw.githubusercontent.com/BasedHardware/omi/04dda1ae63f6cca9181534b01de1bfac73300b47/.agent-artifacts/ui-evidence/daily-recap-recovery-completeness/004-mobile-ios-sync-processed.png)

## Failure class (fixes)

Failure-Class: FC-read-in-flight-across-delete-resurrects-row

The existing class covers stale list adoption across a committed
mutation. The shared recap read owner fences both deletion and recovery;
controllable-future tests cover reads admitted before and during
deletion. The orphan-upload and missing-control changes are separate
concrete gaps, guarded by their service/UI regression tests.

Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2690
-> 2728 | Keep orphan-job reconciliation, snapshot iteration, post-await
row revalidation, persistence and session fencing inside the existing
WAL lifecycle owner rather than splitting mutation authority.
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