Skip to content

fix(workflow): keep schema defaults for missing resume fields - #8370

Open
feiiiiii5 wants to merge 1 commit into
google:mainfrom
feiiiiii5:feiiiiii5/1126-D269
Open

feiiiiii5 wants to merge 1 commit into
google:mainfrom
feiiiiii5:feiiiiii5/1126-D269

Conversation

@feiiiiii5

Copy link
Copy Markdown
Contributor

Please ensure you have read the contribution guide before creating this pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

2. Or, if no issue exists, describe the change:

Problem: _validate_resume_response() built non-required object fields as (prop_type | None, None), ignoring the default declared in the JSON schema. A partial resume answer such as {"approved": true} for Decision(approved: bool, priority: int = 3, tags: list = [], reviewer: str = "manager") produced None for the other fields, so the next node failed Pydantic validation.

Solution: use prop_schema.get("default") for non-required fields. Required fields keep (prop_type, ...), and fields without a JSON-schema default behave exactly as before. Field(default_factory=...) emits no default and remains out of scope per the issue.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Two new tests: declared defaults retained for missing fields, and explicit values overriding defaults. Base-red: 1 failed / 81 passed ({'priority': None} != {'priority': 3}); with fix 82/82 passed. Broader workflow utils: 283 passed. ruff check on the source file clean (one pre-existing unused import in the test file is outside the repo's ruff scope).

Manual End-to-End (E2E) Tests:

Not run offline: no real model, credentials, or network available. This is pure schema handling verified at unit level.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end (offline environment; see above).
  • Any dependent changes have been merged and published in downstream modules.

Additional context

The repo uses pyink (unavailable offline), so ruff format was not used; new code matches surrounding 2-space/single-quote style. Full suite could not be collected offline due to a pre-existing missing a2a module.

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.

1 participant