fix(a2a): Support to_a2a(Workflow) and reject non-agent root nodes#5710
Open
sokoliva wants to merge 1 commit into
Open
fix(a2a): Support to_a2a(Workflow) and reject non-agent root nodes#5710sokoliva wants to merge 1 commit into
sokoliva wants to merge 1 commit into
Conversation
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.
Link to Issue
Problem:
to_a2a(workflow)fails becauseAgentCardBuilderrequires fieldsub_agentswhichWorkflowdoes not have.Solution:
to_a2a()andAgentCardBuilderacceptWorkflow(the v2 graph orchestrator) as a root, not justBaseAgent. Previously crashed withRuntimeError: 'Workflow' object has no attribute 'sub_agents'.BaseAgent | Workflowand reject otherBaseNodesubtypes (e.g.FunctionNode,JoinNode) at call time withTypeError. They previously produced a degenerate "custom agent" card silently.Testing Plan
tests/unittests/a2a/utils/test_agent_card_builder.py — 9 new tests:
tests/unittests/a2a/utils/test_agent_to_a2a.py — 2 new tests, 1 rewritten:
Unit Tests:
Please include a summary of passed
pytestresults.ran
uv run pytest tests/unittests6275 passed, 14 skipped, 25 xfailed, 10 xpassed, 2532 warningsChecklist