Skip to content

fix(executor): materialize annotated field defaults#2811

Open
Harshirchauhan-log wants to merge 2 commits into
TracecatHQ:mainfrom
Harshirchauhan-log:fix/issue-2620-annotated-field-defaults
Open

fix(executor): materialize annotated field defaults#2811
Harshirchauhan-log wants to merge 2 commits into
TracecatHQ:mainfrom
Harshirchauhan-log:fix/issue-2620-annotated-field-defaults

Conversation

@Harshirchauhan-log

@Harshirchauhan-log Harshirchauhan-log commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • materialize registry manifest defaults before action execution
  • apply Annotated Field defaults in direct UDF runner paths
  • preserve optional defaults when round-tripping generated action schemas
  • add regression coverage for Optional Parameter Bug & Deployment Notes #2620

Testing

  • uv run pytest -q tests/unit/test_registry_repository.py tests/unit/executor/test_service_arg_defaults.py tests/unit/executor/test_minimal_runner_protocol.py tests/unit/executor/test_test_backend_no_registry_action.py tests/unit/executor/test_untrusted_runner.py
  • uv run ruff check tracecat/executor/service.py tracecat/executor/minimal_runner.py tracecat/executor/backends/test.py tracecat/executor/untrusted_runner.py tracecat/validation/common.py tests/unit/test_registry_repository.py tests/unit/executor/test_service_arg_defaults.py tests/unit/executor/test_minimal_runner_protocol.py tests/unit/executor/test_test_backend_no_registry_action.py tests/unit/executor/test_untrusted_runner.py
  • uv run basedpyright tracecat/executor/service.py tracecat/executor/minimal_runner.py tracecat/executor/backends/test.py tracecat/executor/untrusted_runner.py tracecat/validation/common.py tests/unit/test_registry_repository.py tests/unit/executor/test_service_arg_defaults.py tests/unit/executor/test_minimal_runner_protocol.py tests/unit/executor/test_test_backend_no_registry_action.py tests/unit/executor/test_untrusted_runner.py
  • git diff --check

Related Issues

Fixes #2620

Screenshots / Recordings

N/A, backend execution fix.

Steps to QA

Run the regression tests above, or create a workflow using an action with Annotated[..., Field(default=...)], omit that input, and confirm execution succeeds.


Summary by cubic

Materializes Annotated Field defaults for omitted UDF inputs across runners and applies frozen registry manifest defaults in the service layer to prevent runtime errors. Preserves optional defaults during JSON Schema → pydantic round-trips. Fixes #2620.

  • Bug Fixes
    • Apply defaults pre-call via materialize_annotated_field_defaults in minimal, untrusted (after stripping __tracecat), and test backends; support mutable defaults (copy on use), per-call and data-aware default factories; do not deep-copy factory results.
    • Apply registry manifest defaults (deep-copied) to evaluated args in prepare_resolved_context and _prepare_step_context without overwriting provided values.
    • JSON Schema to pydantic conversion: preserve optional defaults, support anyOf/oneOf unions and null, and avoid replacing provided defaults with None.

Written for commit 45d10ed. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@Harshirchauhan-log Harshirchauhan-log force-pushed the fix/issue-2620-annotated-field-defaults branch from 452e806 to 3bccfd1 Compare June 4, 2026 16:10
@zeropath-ai

zeropath-ai Bot commented Jun 6, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 45d10ed.

Security Overview
Detected Code Changes

| Change Type | Relevant files

... (code changes summary truncated to fit VCS comment limits.)

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.

Optional Parameter Bug & Deployment Notes

1 participant