Repository navigation
fix(pusher): exclude imageio_ffmpeg from the pusher image dependency probe - #22891
Merged
Merged
Conversation
…probe #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]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
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:(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_framestoutils/other/chat_file.py. The probe inbackend/scripts/runtime_image_contracts.pywalks 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_ffmpegThe video imports are already lazy, so there is no import-time break to fix.
backend/pusher/pylock.tomldoes not shipimageio-ffmpeg.Fix
Add
imageio_ffmpegto the pusher'sdependency_probe_exclusions, with its reason, the same wayonnxruntimeis handled. Two facts make the exclusion safe:get_media_decoder()catchesImportErrorand falls back to the systemffmpeg, which the pusher Dockerfile installs with apt.test_messaging_decoder.pyalready 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:
backendreaches the module too, but itspylock.runtime.tomlalready locksimageio-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_jsonschemanow also asserts thatimageio_ffmpegis absent from the pusher probe set.test_pusher_imageio_ffmpeg_exclusion_keeps_its_system_ffmpeg_fallbackis a static tripwire. It fails if the decoder moves the wheel import to module level, drops theshutil.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.third_party_dependency_modules()for every registered contract. Before the change,pusherlistedimageio_ffmpeg; after it, it doesn't.backendstill lists it, and its lock has it.🤖 Generated with Claude Code