fix: harden pipeline and ops transient failure recovery - #417
Closed
i-xtsu-sixyou-ken-mei wants to merge 1 commit into
Closed
fix: harden pipeline and ops transient failure recovery#417i-xtsu-sixyou-ken-mei wants to merge 1 commit into
i-xtsu-sixyou-ken-mei wants to merge 1 commit into
Conversation
This was referenced Sep 8, 2026
i-xtsu-sixyou-ken-mei
deleted the
fix/ops-reliability-sentry-candidates
branch
September 9, 2026 01:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Reduce recurrence of the actionable production failures in the 2026-09-07 zap-pilot-ops snapshot, and make the remaining Sentry candidates explicit so they can be resolved only after deploy/observation rather than being silently hidden.
Context
The snapshot contained 5 unresolved
podcast-pipelineSentry issues, 1zap-pilot-webissue, a repeatedly failingOps Cost Sync, and a failingCron Failure Alert.Candidate Sentry issues from the handoff:
7697446832/PODCAST-PIPELINE-6—[step:generateScript] OpenRouter request timed out after 600000msLLM_FALLBACK_MODELSinstead of terminating on the primary model.7713815594/PODCAST-PIPELINE-16—TypeError: fetch failedfrom Supabase7714955636/PODCAST-PIPELINE-19—vipspng: libpng read errorUNKNOWN_4— low-volume podcast-pipeline candidate not returned by the top-3 MCP sampleUNKNOWN_5— low-volume podcast-pipeline candidate not returned by the top-3 MCP sample7716381551/ZAP-PILOT-WEB-1—NetworkError: Failed to fetchanalytics-engineRelated non-Sentry signals addressed here:
ops-cost-sync.ymlrepeated Brave provider failure: Brave quota probe now retries transient network/408/429/5xx failures with bounded backoff and retains the concrete final error instead of collapsing toProvider request failed.cost-ledger:provider/brave unknown: same collector fix restores a durable Brave snapshot when the probe succeeds after a transient failure.cron-failure-alert.ymlfailure: the alert no longer depends on separately synchronized Telegram GitHub secrets. It authenticates the existing Infisical machine identity and reads the Telegram bot token / allowed-user list from the production environment rail.Operational signals intentionally not guessed at from this snapshot:
social-daemon ... stale: local-Mac process/supervision state, not enough evidence of an application defect in this incident packet.social-queue:waiting-media/episodes 18 lanes: a symptom without the blocking stage/error sample; no safe generic retry/change inferred here.Scope
Out of scope
Product contract / invariants
Affected invariant:
OpenRouter transport fallback policy in
apps/podcast-pipeline/src/services/llm.tsand its regression tests. Script generation previously opted out of timeout model failover.Why:
A 600s primary-model timeout produced Sentry
7697446832and failed the episode even whenLLM_FALLBACK_MODELSwas configured. Retryable transport failures should have one consistent model-fallback policy across workloads.Acceptance criteria
LLM_FALLBACK_MODELScandidate with a fresh 600s deadline.Implementation
fallbackOnTimeout: falseescape hatch from the shared OpenRouter transport policy.SCRIPT_OPENROUTER_TIMEOUT_MS = 600_000; each configured model candidate gets its own deadline.global.fetchwrapper that retries GET/HEAD only, up to 3 attempts with 250ms/500ms backoff for network failures, 408/429, and 5xx.Brave Search ...diagnostics through Control Center.scripts/notify-cron-failure.mjs; the workflow authenticates Infisical and invokes it throughscripts/env/run.mjs --environment prod.docs/schedules.mdto remove the old manual Telegram GitHub-secret synchronization procedure.Contract alignment
AGENTS.mdremains accurate; no scoped instruction change was required by this patch.docs/schedules.mdupdated for alert credentials).Validation
main(c9b0dc292ab2d63853ba986f4748ea3dd192fcbd) — clean: branch is 1 commit ahead / 0 behind and changes only the 10 intended files.Validation gaps
7713815594,7714955636, and7716381551.UNKNOWN_4/UNKNOWN_5require their concrete Sentry event samples before claiming any fix.Known unrelated failures
None intentionally introduced. Existing production signals listed above that lack sufficient diagnostics are recorded rather than hidden.
Reviewer notes
Focus review on retry safety boundaries: