Skip to content

fix(ci): pin and bound native audio replay dependencies - #23403

Closed
Git-on-my-level wants to merge 1 commit into
mainfrom
fix/native-audio-replay-reliability
Closed

Git-on-my-level wants to merge 1 commit into
mainfrom
fix/native-audio-replay-reliability

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

What changes

PR #23389 lost two unit shards when the Azure Ubuntu mirror trickled a 62.8 MB native-audio closure past the five-minute install ceiling (shard 2, shard 5).

Pin the shard runner to Ubuntu 24.04 and download ffmpeg/libopus0 and their required dependencies from the signed Ubuntu snapshot 20261022T000000Z. Cache the authenticated archives and SHA256 manifest under an exact runner-image + installer-content key; verify checksums before installing offline. Cross-image fallback is removed because the missing-dependency closure depends on the base image.

Cold downloads get three 70-second attempts (five-second kill grace) with 5/10-second backoff, within the existing five-minute step ceiling. Snapshot index errors, exhausted retries, checksum mismatch, broken dependency installation, and missing ffmpeg/libopus remain hard failures. No live-mirror repair fallback. Bump the snapshot in the installer for security updates; its hash automatically invalidates the cache. Six shards, test budgets and the 20-minute job ceiling are unchanged.

Before / after measurement

Historical first-attempt main-push cohort: 2026-10-09 13:30 UTC through 2026-10-23 13:30 UTC. Measurement uses daily bounded gh run list --workflow backend-unit-tests.yml --branch main --event push --created ... --limit 1000, then /actions/runs/{id}/attempts/1/jobs step conclusions. The denominator excludes skipped/cancelled steps; this cohort is explicit and does not claim to cover every PR run or rerun.

Before: 11/3,403 completed install steps failed (0.323%), affecting 5/568 main runs that reached the step (0.880%), out of 788 main workflow runs enumerated. All eleven failed-step logs confirm the native-audio step timed out at its three- or five-minute ceiling. Affected runs: 39743462992, 39745013754, 39748833766, 39769281525, 39791659773. PR #23389's two failures are additional PR evidence, outside this main-only denominator.

After: local Ubuntu 24.04 arm64 container 0/2 failed installs (cold then verified warm); the hosted amd64 PR sample is pending. The container cold fetch downloaded 127 MB successfully on attempt one; both installs verified ffmpeg and dynamically loaded libopus. A single PR run is only an initial observation, not evidence of a sustained post-merge rate.

Validation

  • make setup completed in a fresh managed task worktree from origin/main.
  • nice -n 19 python3 .github/scripts/test_native_audio_replay_deps.py: six hermetic behavioral tests pass (cold/warm, timeout recovery, exhausted retries, corrupt/unverified cache, dpkg failure).
  • nice -n 19 actionlint .github/workflows/backend-unit-tests.yml: passes.
  • nice -n 19 python3 .github/scripts/check_ci_budget.py --refresh: inventory refreshed; runner class and existing p50 budget retained. Allow 0.1 extra daily PR runs (one installer-maintenance PR per ten days) for the new path trigger; existing daily caps stay unchanged.
  • Real Ubuntu 24.04 arm64 container: cold and verified warm installs pass; ffmpeg and libopus smoke checks pass.
  • OMI_PR_BODY_FILE=../pr-body.md nice -n 19 make preflight: all 27 selected checks pass.
  • Required pre-push gate passes, including backend typecheck and workflow-selected hermetic backend contract tests; all run at nice 19.
  • nice -n 19 shellcheck .github/scripts/native-audio-replay-deps.sh: passes.

Product invariants affected

none — CI dependency installation only.

Failure-Class: none
Failure-Class-Reason: Hosted Ubuntu mirror availability and CI artifact reproducibility; no product behavior or product failure-class contract changes.

View guided diff Turn on auto-fix

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T13:48:21.906430Z 47b6af4 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.

@Git-on-my-level
Git-on-my-level marked this pull request as draft November 4, 2026 07:01
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review November 4, 2026 07:27

@cubic-dev-ai cubic-dev-ai 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.

5 issues found across 6 files

Confidence score: 3/5

  • .github/scripts/native-audio-replay-deps.sh installs cached .deb files even when they are absent from SHA256SUMS, so an unverified archive can be installed. Reject unlisted archives or install only manifest entries.
  • .github/scripts/test_native_audio_replay_deps.py does not verify the apt snapshot URL, pin, or signed-by keyring. Capture the sourcelist in the stub and assert those settings.
  • .github/scripts/test_native_audio_replay_deps.py only exercises timeout failures, so it does not verify behavior on apt errors or when the ffmpeg/libopus checks fail. Add cases for those failure paths.
  • .github/checks-manifest.yaml is not included in this check’s triggers, so changes to its own manifest fields may not run the new test. Add the manifest to the triggers.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/scripts/native-audio-replay-deps.sh">

<violation number="1" location=".github/scripts/native-audio-replay-deps.sh:68">
P2: This installs every cached `.deb`, including archives not listed in `SHA256SUMS`; `sha256sum --check` does not reject extra files. Reject any unlisted archive or install only the verified manifest entries.</violation>
</file>

<file name=".github/checks-manifest.yaml">

<violation number="1" location=".github/checks-manifest.yaml:311">
P3: Add `.github/checks-manifest.yaml` to this check's triggers, as the other entries do. Without it, a PR that only changes this entry's manifest fields will not select the new test.</violation>
</file>

<file name=".github/scripts/test_native_audio_replay_deps.py">

<violation number="1" location=".github/scripts/test_native_audio_replay_deps.py:27">
P2: No test makes the `ffmpeg` or `python3` stub fail, so the stated hard failure for missing ffmpeg/libopus is unverified. Add a case where the ffmpeg stub exits non-zero (or the opus check fails) and assert a non-zero return code.</violation>

<violation number="2" location=".github/scripts/test_native_audio_replay_deps.py:29">
P2: Every failure in these tests is a timeout (exit 124). A non-timeout apt-get error, such as a signature or snapshot failure, is never exercised, so the test cannot show that it fails without saving SHA256SUMS or installing. Add a test where the apt-get stub exits non-zero during `--download-only` and assert the outcome the PR specifies.</violation>

<violation number="3" location=".github/scripts/test_native_audio_replay_deps.py:37">
P2: The apt-get stub never reads the `Dir::Etc::sourcelist` file, so nothing asserts the snapshot URL, the `20261022T000000Z` pin, or the `signed-by` keyring. Have the stub copy that sourcelist into EVENTS and assert the snapshot URL and keyring in a cold-fetch test.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic


# No apt repair or live mirror fallback: a bad closure must fail visibly.
((${#packages[@]} > 0))
sudo dpkg -i "${packages[@]}"

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: This installs every cached .deb, including archives not listed in SHA256SUMS; sha256sum --check does not reject extra files. Reject any unlisted archive or install only the verified manifest entries.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/scripts/native-audio-replay-deps.sh, line 68:

<comment>This installs every cached `.deb`, including archives not listed in `SHA256SUMS`; `sha256sum --check` does not reject extra files. Reject any unlisted archive or install only the verified manifest entries.</comment>

<file context>
@@ -0,0 +1,70 @@
+
+# No apt repair or live mirror fallback: a bad closure must fail visibly.
+((${#packages[@]} > 0))
+sudo dpkg -i "${packages[@]}"
+ffmpeg -version
+python3 -c 'import ctypes; ctypes.CDLL("libopus.so.0")'
</file context>

self.command('dpkg', 'echo dpkg >> "$EVENTS"; exit "${DPKG_STATUS:-0}"')
self.command('ffmpeg', 'echo ffmpeg >> "$EVENTS"')
self.command('python3', 'echo opus >> "$EVENTS"')
self.command('timeout', '''

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: Every failure in these tests is a timeout (exit 124). A non-timeout apt-get error, such as a signature or snapshot failure, is never exercised, so the test cannot show that it fails without saving SHA256SUMS or installing. Add a test where the apt-get stub exits non-zero during --download-only and assert the outcome the PR specifies.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/scripts/test_native_audio_replay_deps.py, line 29:

<comment>Every failure in these tests is a timeout (exit 124). A non-timeout apt-get error, such as a signature or snapshot failure, is never exercised, so the test cannot show that it fails without saving SHA256SUMS or installing. Add a test where the apt-get stub exits non-zero during `--download-only` and assert the outcome the PR specifies.</comment>

<file context>
@@ -0,0 +1,107 @@
+        self.command('dpkg', 'echo dpkg >> "$EVENTS"; exit "${DPKG_STATUS:-0}"')
+        self.command('ffmpeg', 'echo ffmpeg >> "$EVENTS"')
+        self.command('python3', 'echo opus >> "$EVENTS"')
+        self.command('timeout', '''
+echo "timeout $*" >> "$EVENTS"
+n=0; if [[ -f $STATE ]]; then n=$(cat "$STATE"); fi
</file context>

self.command('sudo', 'exec "$@"')
self.command('sleep', 'echo "sleep $*" >> "$EVENTS"')
self.command('dpkg', 'echo dpkg >> "$EVENTS"; exit "${DPKG_STATUS:-0}"')
self.command('ffmpeg', 'echo ffmpeg >> "$EVENTS"')

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: No test makes the ffmpeg or python3 stub fail, so the stated hard failure for missing ffmpeg/libopus is unverified. Add a case where the ffmpeg stub exits non-zero (or the opus check fails) and assert a non-zero return code.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/scripts/test_native_audio_replay_deps.py, line 27:

<comment>No test makes the `ffmpeg` or `python3` stub fail, so the stated hard failure for missing ffmpeg/libopus is unverified. Add a case where the ffmpeg stub exits non-zero (or the opus check fails) and assert a non-zero return code.</comment>

<file context>
@@ -0,0 +1,107 @@
+        self.command('sudo', 'exec "$@"')
+        self.command('sleep', 'echo "sleep $*" >> "$EVENTS"')
+        self.command('dpkg', 'echo dpkg >> "$EVENTS"; exit "${DPKG_STATUS:-0}"')
+        self.command('ffmpeg', 'echo ffmpeg >> "$EVENTS"')
+        self.command('python3', 'echo opus >> "$EVENTS"')
+        self.command('timeout', '''
</file context>

shift 3
exec "$@"
''')
self.command('apt-get', '''

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: The apt-get stub never reads the Dir::Etc::sourcelist file, so nothing asserts the snapshot URL, the 20261022T000000Z pin, or the signed-by keyring. Have the stub copy that sourcelist into EVENTS and assert the snapshot URL and keyring in a cold-fetch test.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/scripts/test_native_audio_replay_deps.py, line 37:

<comment>The apt-get stub never reads the `Dir::Etc::sourcelist` file, so nothing asserts the snapshot URL, the `20261022T000000Z` pin, or the `signed-by` keyring. Have the stub copy that sourcelist into EVENTS and assert the snapshot URL and keyring in a cold-fetch test.</comment>

<file context>
@@ -0,0 +1,107 @@
+shift 3
+exec "$@"
+''')
+        self.command('apt-get', '''
+echo "apt $*" >> "$EVENTS"
+for arg in "$@"; do
</file context>

reason: "One episodes-branch push took four attempts, each failing minutes into preflight on a missing local prerequisite (app package_config.json, backend/.venv, a SwiftPM .build recording absent binary artifacts); the doctor must stay the first phase and keep its triggers in step with the hook"
- id: native-audio-replay-deps-tests
command: ["python3", ".github/scripts/test_native_audio_replay_deps.py"]
triggers: [".github/scripts/native-audio-replay-deps.sh", ".github/scripts/test_native_audio_replay_deps.py", ".github/workflows/backend-unit-tests.yml"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Add .github/checks-manifest.yaml to this check's triggers, as the other entries do. Without it, a PR that only changes this entry's manifest fields will not select the new test.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/checks-manifest.yaml, line 311:

<comment>Add `.github/checks-manifest.yaml` to this check's triggers, as the other entries do. Without it, a PR that only changes this entry's manifest fields will not select the new test.</comment>

<file context>
@@ -306,6 +306,11 @@ checks:
     reason: "One episodes-branch push took four attempts, each failing minutes into preflight on a missing local prerequisite (app package_config.json, backend/.venv, a SwiftPM .build recording absent binary artifacts); the doctor must stay the first phase and keep its triggers in step with the hook"
+  - id: native-audio-replay-deps-tests
+    command: ["python3", ".github/scripts/test_native_audio_replay_deps.py"]
+    triggers: [".github/scripts/native-audio-replay-deps.sh", ".github/scripts/test_native_audio_replay_deps.py", ".github/workflows/backend-unit-tests.yml"]
+    lanes: ["local", "ci"]
+    reason: "Native audio dependency fetches must retry with backoff, fail after exhaustion, and keep verified warm-cache installs offline"
</file context>
Suggested change
triggers: [".github/scripts/native-audio-replay-deps.sh", ".github/scripts/test_native_audio_replay_deps.py", ".github/workflows/backend-unit-tests.yml"]
triggers: [".github/scripts/native-audio-replay-deps.sh", ".github/scripts/test_native_audio_replay_deps.py", ".github/workflows/backend-unit-tests.yml", ".github/checks-manifest.yaml"]

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Folding batch (2026-11-04): this branch's tip was merged into the survivor PR #24477 (feat/cv1-release-safety), which now carries origin/main plus all sixteen folded branches; pushed as 88c7ec5. Both sides' conflict intents were preserved (main's evolved implementations win where a successor of the same intent had already landed). Closing here so the batch lives on one PR. Reopen if something you need is missing from the survivor.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hey @Git-on-my-level 👋

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:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

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!

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