fix(modal): surface repo image build failure details#652
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughStreams structured build logs, extracts a concise redacted/truncated failure message when present, returns (sha, complete, error) from the log streamer, and raises BuildError with the extracted message if the sandbox exits without completion; aligns supervisor fatal logging field and updates tests. ChangesImage Build Error Reporting Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/modal-infra/src/scheduler/image_builder.py`:
- Around line 53-63: The failure events list is missing "supervisor.fatal", so
update the constants: add "supervisor.fatal" to the _BUILD_LOG_EVENTS tuple and
include it in the _BUILD_FAILURE_EVENTS set (which is _SETUP_FAILURE_EVENTS |
{...}) so supervisor.fatal is treated as a build/fatal error; this will allow
_stream_build_logs and the error-extraction logic that inspects supervisor
events to pick up the structured fatal messages instead of falling back to
generic failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 018208cd-7e99-4263-9a04-6fc34f4838bf
📒 Files selected for processing (4)
packages/modal-infra/src/scheduler/image_builder.pypackages/modal-infra/tests/test_image_builder_v2.pypackages/sandbox-runtime/src/sandbox_runtime/entrypoint.pypackages/sandbox-runtime/tests/test_supervisor_monitor.py
3f5574b to
d3a4ce4
Compare
d3a4ce4 to
be9088d
Compare
Summary
image_build.completesupervisor.fatallogging so it does not collide with the reservedLogRecord.messagefieldWhy
Repo image builds currently fall back to
Build sandbox exited without completing (exit_code=...)even when the build sandbox already emitted a more useful structured failure such assetup.failedorsupervisor.error. That makes failed image builds hard to diagnose from the settings UI.There is also a separate fatal-error logging path that passes
message=throughlogging.extra, which raisesKeyError: "Attempt to overwrite 'message' in LogRecord"before the fatal error can be reported.Validation
cd packages/modal-infra && ./.venv/bin/ruff check . && ./.venv/bin/ruff format --check . && ./.venv/bin/pytest tests/ -qcd packages/sandbox-runtime && ./.venv/bin/ruff check . && ./.venv/bin/ruff format --check . && ./.venv/bin/pytest tests/ -qnpm run lintnpm run typechecknpm testcurrently fails in unrelated control-plane model tests for GPT 5.5 default reasoning expectations; this PR does not touch TypeScript model metadata or tests.Summary by CodeRabbit