fix: avoid /wait webhook crash on InlineObject workflow results#2245
Merged
daryllimyt merged 8 commits intomainfrom Mar 3, 2026
Merged
fix: avoid /wait webhook crash on InlineObject workflow results#2245daryllimyt merged 8 commits intomainfrom
daryllimyt merged 8 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tracecat/webhooks/router.py">
<violation number="1" location="tracecat/webhooks/router.py:197">
P2: `/wait` now always wraps non-stored results in a `{kind: "value"}` envelope, changing the response shape for plain values despite the docstring saying only StoredObject variants should be normalized. This can break existing clients expecting raw result values.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
Author
|
Follow-up on the What changed:
Why this fixes the regression:
Coverage added:
|
Contributor
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tracecat/webhooks/router.py">
<violation number="1" location="tracecat/webhooks/router.py:179">
P2: CollectionObject.index is ignored when materializing values for /wait, so a CollectionObject pointing at a single item will return the entire collection. This can expose extra data and create large responses. Handle collection.index by fetching only the indexed item (e.g., get_collection_item) before materializing.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
Summary
/webhooks/{workflow_id}/{secret}/waitregression where debug logging raisedTypeErrorwhen workflow results included non-JSON-serializable objects (for exampleInlineObject)json.dumps(result)in_dispatch_workflowwith structured logger field output_dispatch_workflowregression test to assert dispatch returns successfully when workflow result contains anInlineObject/waithandler test to assertincoming_webhook_waitreturnsresponse["result"]unchanged and forwardsTriggerType.WEBHOOKRoot cause
WorkflowExecutionsService._dispatch_workflowwas logging workflow results with:When Temporal returned a result containing
InlineObject,json.dumpsraisedTypeError: Object of type InlineObject is not JSON serializable, which bubbled up and caused the webhook/waitrequest to return HTTP 500.Example
Testing
PG_PORT=5732 TEMPORAL_PORT=7533 MINIO_PORT=9300 REDIS_PORT=6679 TRACECAT__SERVICE_KEY=test-service-key uv run pytest tests/unit/test_webhook_execution_path.py -xuv run ruff check tracecat/workflow/executions/service.py tests/unit/test_webhook_execution_path.pyuv run pyright tracecat/workflow/executions/service.py tests/unit/test_webhook_execution_path.py