Skip to content

Chat reads videos: numbered frame sheets plus speech, sampled on device - #22839

Merged
Git-on-my-level merged 14 commits into
mainfrom
chat-video-frames
Oct 20, 2026
Merged

Git-on-my-level merged 14 commits into
mainfrom
chat-video-frames

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

What

Omi chat now reads videos. Until now a video, including a Telegram video note, an iMessage clip or an in-app attachment, was treated as a voice note. The audio was transcribed, the picture was dropped, and the model replied "I can't see a video".

A video is now read as stills plus speech:

  • One sandboxed FFmpeg decode (backend/utils/media/video_frames.py):
    • samples up to 48 candidate frames (at most 4 per second, 384 px, from 0 to just before the end). Each frame keeps its real timestamp, read from FFmpeg's showinfo.
    • Clips over 120 s decode keyframes only. If every frame is a keyframe, as in an all-intra screen recording, it falls back to one accurate seek per target.
    • FFmpeg's stderr is drained with a cap on how much is kept;
    • tiles the most distinct frames (up to 6, first and last always included, chosen by farthest-point selection on 16×16 luma) into one numbered, time-labelled contact sheet. That sheet is the chat file, so a clip costs about one image no matter its length. A static clip stops at 3 frames.
  • Filmstrip: every candidate frame is kept in a filmstrip grid. search_files_tool(start_seconds=, end_seconds=) answers from up to 6 frames inside that window, which covers "look closer at 0:12". The original clip is never stored.
  • Speech goes through the existing voice-note STT, in parallel with the frames.
    • A muted clip still answers from its frames.
    • A clip with no picture falls back to its transcript.
    • Only when both fail does the user get the voice-note reply.
    • The transcript is encrypted at rest (FileChat.video.transcript, via utils.encryption) and never returned to clients.
  • The model sees a note next to the sheet: [Video, 5 s: 4 frames (0:00.0, 0:01.5, …) attached as one numbered image … Audio transcript: …].

Surfaces

Surface How
Telegram / iMessage (Linq) prepare_video in the messaging media bridge
In-app, any client POST /v2/files now accepts a clip; the server samples it
iOS / Android (Flutter) samples on device: AVFoundation, or MediaMetadataRetriever plus an AAC remux with MediaMuxer → POST /v2/files/video (frames + frame_times + duration_seconds + optional audio). The gallery picker now allows videos.
macOS AVFoundation sampler → /v2/files/video. Audio is AAC on macOS 15+ and 16 kHz WAV on macOS 14. The file picker accepts movies.

When a platform can't sample a clip, the whole clip is uploaded and the server samples it.

Cost

  • LLM: about one image per video, typically 3–6 frames on one sheet, compared with roughly 260 tokens per second for native video input.
  • CPU: 0.1–1.1 s of single-threaded FFmpeg per clip locally (5–300 s clips). Clips over 120 s are decoded keyframe-only.
  • STT: unchanged; we already transcribed videos.
  • Storage: the clip is gone. What remains is one sheet (about 50 KB) and one filmstrip (about 150–350 KB) in OpenAI files. Chat cleanup now deletes filmstrips too.

Rollout

On by default, with no flag. This only adds frames to a path that already accepted videos and threw the picture away. Rollback is a revert.

Product invariants affected

  • INV-AUTH-1: APIClient.uploadChatVideo reuses the existing authenticated multipart path: buildHeaders(requireAuth: true) + performRequest, the same as uploadChatFiles. It adds no session, 401 or credential handling of its own.
  • INV-CHAT-1: the desktop chat change is confined to attachment upload. A picked movie is sampled on device and uploaded to /v2/files/video before send, using the same pendingAttachments state machine as other attachments. Transcript ownership, the message stream and send are untouched.

Review

Luna (codex, read-only) ran five rounds:

  1. BLOCK: decompression bomb, parser limits, timestamps, end coverage, response order, the STT pool, temp-file cleanup.
  2. BLOCK: unbounded keyframe output, sample spacing, frame_times validation.
  3. BLOCK: stderr memory, macOS 14 audio, all-intra decode cost.
  4. SHIP WITH FIXES: seek labels, macOS 14 clips over 50 MB.
  5. SHIP WITH FIXES: unreadable audio could upload silently.

Every finding is fixed in this branch, with one exception, left as is: when a video fails after the non-video batch succeeded, it can orphan that batch's rows. That is the same behaviour /v2/files already has when a later file returns 400. Transcripts: data/run-2026-10-20-chat-video/luna-*.out in omi-workspace.

Verification

  • Backend: tests/unit/test_chat_video.py, 26 tests:
    • real FFmpeg on generated clips (moving, static, 200 s, audio-only and garbage input);
    • keyframe choice and window crop;
    • client-frame validation;
    • the messaging matrix (frames only, speech only, both, neither);
    • storage with an encrypted transcript;
    • the file-tool overview and window, sync and async;
    • search_files_tool window arguments;
    • /v2/files/video validation (NaN, inf and huge numbers in frame_times, oversized frames), plus the check that it doesn't leak the transcript or filmstrip id;
    • keyframe timestamps on a long clip, end coverage on a short one, and the all-intra seek fallback;
    • the stderr retention cap.
  • Existing tests: test_messaging_modalities.py (139), the chat router and file-chat test files (53), and test_rate_limiting.py pass.
  • Contract: OpenAPI app-client contract plus Dart, TS and Swift clients regenerated. check_app_client_openapi_compatibility and the route-policy baseline pass.
  • Flutter: flutter analyze clean on the changed files; test/unit/chat_video_sampler_test.dart passes.
  • macOS: local swift build --build-tests and ChatVideoSamplerTests (6 tests) pass on Xcode 27. This is a smoke check only; Desktop Swift CI is authoritative.
  • iOS and Android native samplers: not run on a device in this PR. They are covered by CI builds; device QA follows.

Failure-Class: none

The fix commit addresses review findings on code that is new in this PR; nothing that shipped failed.

UI-Evidence: none -- the only visible change is the existing composer attachment chip showing the standard Material videocam icon instead of the generic file icon for a picked video, and pickers accepting movies; no layout or new screen

Line-Count-Exception: backend/routers/chat.py | 1789 -> 1800 | /v2/files hands video uploads to routers/chat_video.py; the route and logic live there
Line-Count-Exception: desktop/macos/Desktop/Sources/Providers/ChatProvider.swift | 6879 -> 6884 | one branch hands video attachments to ChatProvider+VideoAttachments.swift

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

Git-on-my-level and others added 10 commits October 20, 2026 16:05
Videos in Telegram/iMessage and in-app chat were transcribed and their picture
dropped. One sandboxed FFmpeg pass now samples up to 48 frames; the most
distinct (up to 6) become one numbered contact sheet stored as the chat
file, the rest a filmstrip for closer looks. Speech still goes through the
voice-note STT path, in parallel; either alone answers.

- search_files_tool takes start_seconds/end_seconds for denser frames
- /v2/files accepts video; /v2/files/video takes device-sampled frames+audio
- the clip is never stored; transcript encrypted at rest

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clients send stills + the audio track to /v2/files/video instead of the
whole clip: AVFoundation on iOS/macOS, MediaMetadataRetriever +
MediaMuxer (AAC remux) on Android. Same candidate set as the server
(<=48 frames, <=4 fps, 384 px). Gallery and file pickers now accept
videos; a platform without a sampler uploads the clip and the server
samples it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iles

Keeps routers/chat.py and ChatProvider.swift under the line-count
ratchet; adds route tests for /v2/files/video.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- refuse oversized client frames before decoding; parse-time multipart limits
- samples reach the clip end; long clips decode keyframes with real pts
- exact frame times on Android/iOS/macOS; Android non-AAC audio uploads the clip
- /v2/files answers in upload order; shared in-app STT pool; temp dir cleanup
- mobile changelog fragment

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- one bounded select pass with real showinfo times for every clip length
- samples never closer than 0.25 s and reach the clip end (server and clients)
- strict frame_times validation (finite, in range, bounded field)
- Dart cleans up after a malformed sampler result; e2e covers entries

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- drain FFmpeg stderr line by line with a retained-line cap
- all-intra long clips fall back to per-target seeks inside a budget
- macOS 14 clips with audio upload whole so the server transcribes them

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- seek fallback labels frames with their decoded pts (-copyts + showinfo)
- macOS 14 exports 16 kHz mono WAV via AVAssetReader instead of uploading the clip
- stdlib shutil import in routers/chat_video.py (pyright)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Oct 20, 2026, 1:16 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-20T13:27:51.850547Z ec949ec New commits
ℹ️ 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: 86601fa1a9

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


# In-app uploads are sync routes; their STT runs here so concurrent uploads on one instance
# share a small bound instead of each starting its own thread.
_STT_POOL = ThreadPoolExecutor(max_workers=4, thread_name_prefix='chat-video-stt')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use the managed executor registry for video STT

This process-global pool is outside utils.executors, so its four workers are absent from executor capacity metrics and shutdown_executors(); under active video transcription, a deployment shutdown can therefore wait on untracked work while the configured backend pools report no corresponding load. Route this work through a managed executor or an async coordinator instead of creating an ad-hoc pool.

AGENTS.md reference: backend/AGENTS.md:L263-L268

Useful? React with 👍 / 👎.

.image, .jpeg, .png, .gif, .heic, .heif, .webP, .tiff, .bmp,
.pdf, .plainText, .json, .commaSeparatedText, .html,
.text, .content,
.text, .content, .movie,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add movies to the QueryShell attachment picker

The main/home QueryShell composer uses QueryHeroBar.pickFiles, whose explicit allowedContentTypes still omits .movie even though that method declares it shares this picker's vocabulary. Consequently users on that primary chat surface cannot select a video through the attachment button; video selection only works in ChatInputView or via drag-and-drop. Update the shared QueryShell picker in the same change.

AGENTS.md reference: desktop/macos/AGENTS.md:L363-L367

Useful? React with 👍 / 👎.

Comment thread backend/models/chat.py
openai_file_id: str
created_at: datetime
thumb_name: Optional[str] = ""
video: Optional[ChatFileVideo] = None

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 Keep internal video metadata out of message responses

When an attached video is later returned by GET /v2/messages, database.chat attaches the raw stored file document and the List[Message] response serializes it through this FileChat model without calling client_dump(). The response therefore exposes the encrypted transcript, OpenAI filmstrip file ID, frame times, and layout metadata, despite client_dump() promising duration-only output; the generated public OpenAPI schema now advertises those internal fields as well. Use a separate public response model or serializer exclusion for every client-facing FileChat path.

Useful? React with 👍 / 👎.

..., description='JPEG or PNG stills sampled from the clip, in time order (at most 48).'
),
frame_times: str = Form(..., max_length=4096, description="JSON array of each frame's time in seconds."),
duration_seconds: float = Form(..., ge=0, le=36000),

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 Reject or mark videos whose audio is truncated

This route accepts device-sampled videos up to 10 hours, but the iOS, Android, and macOS samplers export at most the first 600 seconds of audio while still sending the full clip duration and frames spanning the whole video. For a clip longer than 10 minutes, the stored prompt labels the resulting text as the video's audio transcript without indicating that later speech is missing, so questions about speech after 10:00 can receive confidently incorrect answers. Either cap accepted duration at 600 seconds or persist and disclose the transcript's covered interval.

Useful? React with 👍 / 👎.

Comment on lines +67 to +70
/// A clip still on disk: uploaded as sampled frames + audio, never as the whole file.
var isVideo: Bool {
mimeType.hasPrefix("video/")
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Classify every accepted desktop video before upload

Desktop video detection relies only on this hand-written MIME value, but mimeType(for:) maps just MOV, MP4/M4V, and WebM; dragged or picker-accepted AVI, MKV, and 3GP clips become application/octet-stream. Those files bypass uploadVideoAttachment, fall through to the generic Data(contentsOf:) plus /v2/files path, and therefore upload the entire clip even though the new desktop contract says the whole file never leaves the Mac and the backend explicitly recognizes these video extensions. Match the backend's supported video suffixes here or reject unsupported clips before generic upload.

Useful? React with 👍 / 👎.

Comment thread backend/routers/chat.py
Comment on lines +1475 to +1478
if chat_video.is_video_upload(safe_suffix, file.content_type):
stored_videos[len(files_chat) + len(stored_videos)] = chat_video.store_uploaded_clip(
uid, temp_file, safe_suffix
)

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 Defer video persistence until the multipart batch succeeds

For a multi-file /v2/files request, store_uploaded_clip immediately writes each video row to the user's file collection, unlike the non-video rows that are committed only after the loop. If any later attachment is unsupported or fails processing, the endpoint returns an error and the client receives no video ID, but the earlier video, its OpenAI files, thumbnail, and database row remain permanently unlinked to a session; retrying the batch creates another copy. Defer the video database commit until every part succeeds or explicitly roll back prior video artifacts on failure.

Useful? React with 👍 / 👎.

Comment thread backend/utils/other/chat_file.py Fixed

@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: ec949ec3d6

ℹ️ 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 +14 to +15
if let mime = server.mimeType { pendingAttachments[idx].mimeType = mime }
if let name = server.name { pendingAttachments[idx].fileName = name }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the original macOS video metadata

After every successful macOS video upload, the backend response describes the generated contact sheet as image/jpeg, so assigning that MIME here turns the attachment from a video into an image while its localFileURL still points to the original movie. queryAttachments consequently sends the agent a movie URI labeled as an image (and line 15 also replaces its display name with a .jpg name), causing the primary attachment-inspection path to use the wrong media type. Keep the original video name/MIME while applying the returned server ID and thumbnail.

Useful? React with 👍 / 👎.

Comment on lines +396 to +398
return (jsonDecode(response.body) as List<dynamic>)
.map((file) => MessageFile.fromGenerated(wire.GeneratedFileChat.fromJson(file as Map<String, dynamic>)))
.first;

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 Retain the video marker in the mobile upload result

For a successful video upload, the returned file is the generated image/jpeg contact sheet and includes the new video metadata, but this conversion produces a MessageFile that discards that metadata. When the local sent message is built, addMessageLocally therefore treats it as an ordinary image and replaces the valid server thumbnail with the original .mp4/.mov path; FilesHandlerWidget then passes that movie to FileImage, yielding a broken thumbnail until history is reloaded. Preserve a video flag in MessageFile or avoid the local-image substitution for video selections.

Useful? React with 👍 / 👎.

Comment on lines +367 to +368
for (var i = 0; i < files.length; i++) {
if (results[i] == null) results[i] = await uploadVideoServer(files[i], appId: appId);

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 Roll back earlier files when a later video upload fails

When a selection contains multiple attachments, the non-video batch and each video are committed in separate requests before this method returns. If any later video sampling/upload fails, MessageProvider.uploadFiles receives no results and removes the whole selection, while every earlier successful file remains stored server-side with no ID available to the client; retrying creates duplicates. This remains possible even if /v2/files itself becomes transactional, so the client needs rollback or a batch-level transaction spanning these requests.

Useful? React with 👍 / 👎.

Comment on lines +15 to +16
- desktop/macos/Desktop/Sources/Chat/ChatVideoSampler.swift
- desktop/macos/Desktop/Sources/Providers/ChatProvider+VideoAttachments.swift

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove unexercised video files from this flow's coverage

This flow's only actions stage and inspect a recent screen frame; it never selects, samples, uploads, or sends a video, and the new comment explicitly acknowledges that these files are not driven by the flow. Adding the sampler and video uploader to covers: therefore lets the changed-file E2E selector report unrelated screen-frame checks as coverage for this feature. Remove these entries or add a flow that actually exercises the video path.

AGENTS.md reference: desktop/macos/AGENTS.md:L465-L466

Useful? React with 👍 / 👎.

Comment on lines +88 to +89
frames.add(file.path)
times.add(t)

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 Record the decoded Android frame timestamp

getScaledFrameAtTime(..., OPTION_CLOSEST, ...) returns the closest available bitmap but does not return that frame's presentation timestamp, so storing the requested t here labels the bitmap as though it occurred exactly then. For low-frame-rate, variable-frame-rate, or gapped videos, the generated contact sheet and time-window lookup can therefore assign a frame to the wrong moment, unlike the iOS, macOS, and backend samplers that retain actual decoded times. Use a decoder that exposes the selected frame's PTS or otherwise avoid presenting the requested time as exact.

Useful? React with 👍 / 👎.

Comment on lines +60 to +61
except MediaPreparationError:
return ''

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 Do not turn transcription failures into silent videos

MediaPreparationError represents decoder and STT-provider failures as well as genuinely empty speech, so returning '' here makes describe() assert No speech in the audio. during an STT outage or rejected transcription. The parallel messaging-adapter path catches the same broad exception, meaning affected videos are stored and answered from with a confidently false audio status and no fallback signal. Preserve an unavailable/error state or fail the upload instead of mapping every failure to silence, and record the degraded fallback when it is intentional.

AGENTS.md reference: backend/AGENTS.md:L314-L314

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 4724af1 into main Oct 20, 2026
62 checks passed
@Git-on-my-level
Git-on-my-level deleted the chat-video-frames branch October 20, 2026 13:55
Git-on-my-level added a commit that referenced this pull request Oct 20, 2026
…probe (#22891)

## Problem

`Auto Deploy Backend Pusher to GKE (Development)` has failed on main
since 42fb4ff (first run after #22839 landed). The image builds, then
the offline dependency probe fails:

```
Smoke checking pusher's 283 reachable third-party modules in gcr.io/based-hardware-dev/pusher:45e71a7
AssertionError: missing installed dependency modules: imageio_ffmpeg
```

(run 39440281508). Production pusher promotion selects a
development-qualified digest, so no pusher build after #22839 can reach
prod until this is fixed.

## Cause

#22839 (chat video) added function-local imports of
`utils.media.video_frames` to `utils/other/chat_file.py`. The probe in
`backend/scripts/runtime_image_contracts.py` walks every import in a
module, function-local ones included, so the pusher now reaches the
messaging FFmpeg decoder:

`pusher.main -> routers.pusher -> utils.pusher_finalization ->
utils.conversations.finalizer -> process_conversation ->
calendar_linking -> retrieval.tools.calendar_tools -> integration_base
-> retrieval.agentic -> retrieval.tools -> file_tools ->
utils.other.chat_file -> (lazy) utils.media.video_frames -> (lazy)
utils.messaging.adapters.decoder -> (in function) imageio_ffmpeg`

The video imports are already lazy, so there is no import-time break to
fix. `backend/pusher/pylock.toml` does not ship `imageio-ffmpeg`.

## Fix

Add `imageio_ffmpeg` to the pusher's `dependency_probe_exclusions`, with
its reason, the same way `onnxruntime` is handled. Two facts make the
exclusion safe:

- The pusher never handles chat video.
- `get_media_decoder()` catches `ImportError` and falls back to the
system `ffmpeg`, which the pusher Dockerfile installs with apt.
`test_messaging_decoder.py` already covers that fallback.

I didn't add the wheel to the pusher lock. That would put an unused ~30
MB FFmpeg binary into the image next to the apt one.

Other images: `backend` reaches the module too, but its
`pylock.runtime.toml` already locks `imageio-ffmpeg==0.6.0`. No other
registered image reaches it. The prod Cloud Run backend deploy of
42fb4ff (run 39438007788) succeeded.

## Guard

- `test_pusher_dependency_probe_includes_jsonschema` now also asserts
that `imageio_ffmpeg` is absent from the pusher probe set.
- New
`test_pusher_imageio_ffmpeg_exclusion_keeps_its_system_ffmpeg_fallback`
is a static tripwire. It fails if the decoder moves the wheel import to
module level, drops the `shutil.which('ffmpeg')` fallback, or the pusher
Dockerfile stops installing ffmpeg.

Failure-Class: FC-runtime-image-boundary

## Verification

- `BACKEND_UNIT_TEST_FILE_LIST=<list:
tests/unit/test_runtime_image_contracts.py,
tests/unit/test_messaging_decoder.py> bash test.sh`: 8 + 24 passed.
- Ran `third_party_dependency_modules()` for every registered contract.
Before the change, `pusher` listed `imageio_ffmpeg`; after it, it
doesn't. `backend` still lists it, and its lock has it.
- The real image smoke runs in the next dev pusher auto-deploy after
merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/22891?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/22891?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F22891&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
kriegcloud pushed a commit to kriegcloud/omi that referenced this pull request Oct 20, 2026
…probe

BasedHardware#22839 added lazy chat-video imports to utils/other/chat_file.py. The
pusher's static probe walks function-local imports too, so pusher.main
now reaches utils.messaging.adapters.decoder and its in-function
`import imageio_ffmpeg`. The pusher lock does not ship that wheel, and
the dev pusher auto-deploy has failed its image smoke since 42fb4ff.

Pusher never processes chat video, and the decoder already falls back to
the system ffmpeg that the pusher Dockerfile installs with apt. Exclude
the module with its reason (same pattern as onnxruntime) and pin the
premise in a test: the wheel import stays function-local with the system
fallback, and the pusher image installs ffmpeg.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Oct 20, 2026
…e, not every flag (#22924)

## Summary
Prod Pusher promotion run 39433983369 (main `11f97372`) failed with
`qualification evidence contract does not match the current promotion
contract`. The selected dev qualification, run 39423577397, ran on
`506592ee`. Between those two commits only one contract input changed:
flag ruling #22831 (`11f97372`) removed `LIVE_SPEAKER_SPAN_RESOLUTION`
from
`backend/deploy/runtime_env{.yaml,/_base.yaml,/dev.overlay.yaml,/prod.overlay.yaml}`.
Those four files were hashed byte-for-byte into `contract_sha256`. As a
result, any flag ruling for any service invalidated every dev
qualification, and prod Pusher could promote only if it was dispatched
before the next flag PR merged. Main receives several flag PRs a day,
and dev Pusher was red from about 14:30 to 17:15 UTC on 10-20, so prod
Pusher has not deployed since before #22839.

What changed:
- The contract now hashes the promotion scripts and workflows (unchanged
list), plus, from the composed `runtime_env.yaml`, only
`environments.{dev,prod}.gke.pusher`, the shared backend ConfigMap
`gke.config_map` (the prod job writes it before Helm and the Pusher pod
envFroms it), and the per-environment project and region scalars. A real
Pusher env change still invalidates the evidence; another service's flag
ruling no longer does. The prod workflow already re-validates the prod
runtime env at the checked-out main before it publishes, and the Pusher
image source closure is still diffed separately.
- `pusher_release_receipt.py` (the dev writer) imports
`contract_fingerprint` from `verify_pusher_promotion_evidence.py` (the
prod checker). Before this change each file kept its own copy of the
file list.
- The prod selection step runs `pip install pyyaml` before the verifier,
because the projection parses YAML.
- The mismatch error now says what to do: select a dev run from the
current main.

## Review
Grok review: no blockers. Both should-fixes are addressed in `f145eeb5`:
`gke.config_map` is now hashed, and the tests assert
`contract_fingerprint()` itself, including a ConfigMap-change case. For
the nit, only an immutable digest is cached now. Residual risks Grok
noted, unchanged from before this PR: GitHub-var values for `source:
environment` keys were never hashed, and `pip install pyyaml` is
unpinned (a parser change fails closed on hash mismatch).

## Lane / contract
Lane pusher-d0b (10-20 swarm P5 Part A); owner sign-offs for edits to
other lanes' files: none

## Product invariants affected
- INV-DATA-1: path match only
(`.github/workflows/gcp_backend_pusher.yml`). The only workflow edit is
a `pip install pyyaml` line in the prod selection step.
This change does not alter the Firebase/Firestore project or serving
endpoints.

## Verification
- `backend/test.sh` with `BACKEND_UNIT_TEST_FILE_LIST` =
`test_verify_pusher_promotion_evidence.py`,
`test_pusher_auto_deploy_paths.py`,
`test_pusher_deployment_control_workflow.py`: 63 passed, including the
fast-unit CPU guard. Layer: unit.
- New tests:
-
`test_dev_qualification_recorder_output_satisfies_the_prod_promotion_contract`:
the qualification JSON from `record_qualification`, which the dev
workflow writes, passes the prod `validate()` with no errors.
- Unrelated listen or Cloud Run flag flips leave the projection
unchanged.
  - A dev or prod Pusher env flip changes the projection.
  - The real manifest yields a dev/prod Pusher projection.
- Both scripts' CLIs import cleanly when invoked by path, as the
workflows do.
- Not run: a live dev qualification or prod promotion. Merging this
changes contract files, so the dev auto-deploy runs again on the merge
SHA, and that run is the one to promote.

## Rollback
Revert this PR. The old byte-for-byte contract comes back, and dev
evidence recorded under the new fingerprint will then fail prod until
dev re-qualifies.

Failure-Class: FC-promotion-gate-admits-on-recency-not-lineage

🤖 Generated with [Claude Code](https://claude.com/claude-code)
ZhaZhaBei pushed a commit to ZhaZhaBei/omi that referenced this pull request Oct 22, 2026
Conflicts: main.py keeps integration's app_roles mount; main's new chat_video router (BasedHardware#22839)
goes into the app_roles route table after chat_receipts. The duration allowlist and the
cap_hold_recovery imports keep both sides. The completed_status docstring describes integration's
held rule (L10-2) and main's deleted-conversation rule. Main's new held-content label sites are
recorded as reason_label debt for lane 14. Internal desktop changelog fragment for main's desktop changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

1 active deployment
staging - docs — ec949ec3 Deployed Oct 20, 2026 by mintlify[bot]
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.

2 participants