fix(dynamic-blocks): tee stdout/stderr so print() still reaches Docke…#2258
Open
rafel-roboflow wants to merge 6 commits intomainfrom
Open
fix(dynamic-blocks): tee stdout/stderr so print() still reaches Docke…#2258rafel-roboflow wants to merge 6 commits intomainfrom
rafel-roboflow wants to merge 6 commits intomainfrom
Conversation
Make `inner_error_type` and `inner_error_message` optional on `WorkflowErrorResponse` so errors raised without an `inner_error` (e.g. from the Modal/OCI executors) don't fail pydantic validation and surface as a 500 instead of the intended 400.
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.
What does this PR do?
Restores
print()output from Custom Python blocks to Docker / process stdout._ThreadDispatchStreaminerror_utils.pywas redirecting writes to per-threadStringIObuffers that were only read on error, silently swallowing output on the happy path. Writes are now teed to both the capture buffer (forDynamicBlockCodeError.stdout/stderr) and the original stream.Related Issue(s): Fixes DG-464
Type of Change
Testing
Test details:
Ran a workflow with a Custom Python block containing
print(...)in local execution mode; output now appears indocker logsagain, and captured stdout/stderr is still attached toDynamicBlockCodeErrorwhen the block raises.Checklist
Additional Context
N/A
Note
Medium Risk
Changes global stdout/stderr capturing for dynamic blocks and alters remote-execution response payloads, which could affect logging behavior and error reporting across workflow runs.
Overview
Restores visible
print()output for Custom Python workflow blocks by changingcapture_output()to tee writes to both the per-thread buffer (for error context) and the originalsys.stdout/sys.stderr.For Modal-based execution, the remote sandbox now returns captured
stdout/stderr, and the client (ModalExecutor) forwards those streams to the local process logs on success.Makes
WorkflowErrorResponse.inner_error_type,inner_error_message, andblocks_errorsoptional (defaulting toNone) to avoid requiring these fields in error responses.Reviewed by Cursor Bugbot for commit cbffe85. Bugbot is set up for automated code reviews on this repo. Configure here.