Repository navigation
fix(backend): remove stale SERVICE_ACCOUNT_JSON mapping from ExternalSecrets and rollouts - #10173
aryanorastar wants to merge 5 commits into
Conversation
The provider-timeout class (FC-per-hop-timeout: BasedHardware#8640, BasedHardware#8911, BasedHardware#9135, BasedHardware#9644) was fixed four times by moving a per-hop timeout. The Anthropic chat path now owns one admission budget instead: - RequestDeadline (240s inside the 300s platform bound, mirroring the Gemini proxy) is created in route middleware before extractors and body extraction; auth, BYOK, and paywall waits are bounded by it and budget exhaustion returns a typed 504 instead of a 401. - All provider sends go through send_with_deadline; the retry loop is a budget-aware policy: attempts never start on an expired budget, a retry or pause_turn continuation starts only above a 10s floor, and backoff sleeps truncate at the budget edge. A transient status on the final available attempt still passes through unchanged. - The budget governs everything before the first client-visible semantic SSE event. The stream idle timer now measures SEMANTIC progress: raw bytes and Anthropic ping events no longer reset it, closing the live gap where a ping-only upstream could hold a client forever with nothing visible. Streaming still has no total response timeout by design (BasedHardware#9135): a visible-delta stream survives budget expiry. - The detached Firestore usage write runs through a spawn seam that never inherits the request deadline. Behavioral tests drive the policy and the real stream translator with tokio::time::pause: budget-floor retry stop, backoff truncation at the edge, long visible streams surviving expiry, ping-only turns ending in a typed terminal SSE error, semantic-idle stalls independent of budget, and detached-write completion after expiry. Fixes BasedHardware#9835. Co-Authored-By: Claude Fable 5 <[email protected]>
Static tripwire (labeled as such): raw reqwest builders are not covered by signatures alone, so new direct .send() calls in routes/chat/ fail the manifest lanes. Behavioral coverage lives in the paused-time deadline tests. Caught class: BasedHardware#8640/BasedHardware#8911/BasedHardware#9135/BasedHardware#9644 (BasedHardware#9835). Co-Authored-By: Claude Fable 5 <[email protected]>
…eadline Named follow-up from BasedHardware#9835: proxy.rs kept a working ad hoc deadline; the budget type now exists, so the migration is mechanical. - The shared race/within helpers and DeadlineElapsed move to request_deadline.rs; the proxy-local copies are deleted (no aliases, all call sites and tests migrate in this change). - The budget is admitted by the shared route middleware before extractors on both proxy routes, so auth/BYOK/paywall waits are inside it. The handler consumes the same RequestDeadline the chat path uses; the phase-aware timeout telemetry mapping is unchanged. - CHAT_REQUEST_BUDGET generalizes to REQUEST_BUDGET (same 240s value both route classes already derived from the platform contract); the proxy's platform constants collapse into the shared module. Per-attempt Gemini defenses (connect bound, attempt cap) stay proxy-owned policy. - The streaming proxy keeps no total response timeout by design; it gains only budgeted extractor waits. - New behavioral test: the middleware-admitted budget is the one the handler consumes, on the paused tokio clock. Existing proxy deadline tests (hanging-upstream cancellation, downstream disconnect propagation, one-budget-includes-pre-dispatch-work) migrate to the shared helpers with assertions unchanged. Refs BasedHardware#9835. Co-Authored-By: Claude Fable 5 <[email protected]>
…Secrets and rollouts Failure-Class: none
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
While splitting this PR I checked whether
So removing the binding reroutes prod Firebase Admin + GCS auth through ADC. That is safe only if the prod GKE cluster runs Workload Identity so Separately, this branch also stacks the change on top of the entire #10054/#10056 chat-deadline work (20 files) rather than the 2-file ExternalSecrets change alone. Recommend: hold until prod Workload Identity is confirmed, then reland as a focused, accurately-framed WI-migration PR (not "remove stale mapping"). |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for chasing the ExternalSecret sync issue here.
I’m going to request changes because the current branch is not safe to merge in this shape:
- The
SERVICE_ACCOUNT_JSONbinding does not appear to be stale in code: it is still read by backend Firebase/GCS credential paths (backend/main.py,backend/pusher/main.py,backend/database/google_credentials.py,backend/utils/other/storage.py) and documented inbackend/AGENTS.md. Removing it reroutes production auth to ADC / Workload Identity, which needs explicit maintainer confirmation for prod before merge. - The PR is stacked with a separate desktop Rust chat-deadline/CI tripwire change. That may be useful work, but it is unrelated to the ExternalSecrets fix and materially changes another subsystem plus CI behavior, making this hard to validate or roll back as a focused secrets/deploy fix.
- Required checks are currently failing, including Static Contracts, Rust Backend, Backend unit suite, Desktop Swift Build & Tests, and Desktop Swift Test Suites.
Suggested path: split/reland the ExternalSecrets change as a focused PR only after prod Workload Identity / ADC coverage is confirmed, and keep the chat-deadline work in its own PR with its failing checks resolved.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Update — the removal is not just risky, it's blocked and wrong. The pre-push runtime-env validator (
That settles the "stale" question: it isn't. #9187's actual symptom is that the ExternalSecret references a Secret Manager key that was deleted upstream → closing this PR and handling #9187 as an ops/infra restore. I scope-reduced the branch to just the ExternalSecrets change to check, and it fails the validator by construction — there's no mergeable version of "remove the binding." |
|
Hey @aryanorastar 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Fixes #9187
Summary
Removes the stale
SERVICE_ACCOUNT_JSONkey mapping from both prod and dev backend-secrets Helm charts and theruntime_env.yamlCloud Run deployment manifests.This resolves the
prod-omi-backend-external-secretreportingSecretSyncedErrorbecause it tried to reference the deleted Secret Manager key. Auth now relies purely onGOOGLE_APPLICATION_CREDENTIALS.Failure-Class: none