test(a2a): assert TaskResult content for rejected and auth-required states#270
Draft
test(a2a): assert TaskResult content for rejected and auth-required states#270
Conversation
…tates Closes #263 (item 3 — test coverage gaps for A2A 1.0 states). Prior tests for TASK_STATE_REJECTED and TASK_STATE_AUTH_REQUIRED only asserted adapter.active_task_id behavior. These new tests also capture the full TaskResult: status, data, message, and metadata["status"]. The gap-documenting test (adcp_error DataPart not extracted for non-COMPLETED states) explicitly asserts data=None today and flags the future fix path in a comment. https://claude.ai/code/session_01MxALGppjocjuZzDVp48tps
Contributor
IPR Policy Agreement RequiredThank you for your contribution! Before we can accept your pull request, you must agree to our Intellectual Property Rights Policy. By making a Contribution, you agree that:
To agree, please comment below with the exact phrase: You can read the full IPR Policy here. I have read the IPR Policy You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
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.
Closes #263 (item 3 of 5 — test coverage gaps for A2A 1.0 states)
Summary
test_rejected_task_result_content: assertsTaskResultshape forTASK_STATE_REJECTED—status=SUBMITTED,data=None,metadata["status"]="rejected", text message from TextPart.test_rejected_task_adcp_error_datapart_not_extracted: documents the known gap — aREJECTEDtask'sadcp_errorDataPart is silently dropped because_process_task_responseonly calls_extract_result_from_taskforCOMPLETEDtasks. The test asserts current behavior (data=None) and comments the future fix path.test_auth_required_task_result_content: assertsTASK_STATE_AUTH_REQUIREDreturnsstatus=SUBMITTED,data=None,metadata["status"]="auth-required", TextPart message, plustask_idandcontext_idin metadata.Prior tests for these two states (
test_task_id_retained_on_auth_required_state,test_task_id_cleared_on_rejected_state) only assertedadapter.active_task_id; these tests close theTaskResultcontent gap called out in the issue.Items NOT in this PR (flagged for @bokelley — see triage comment on #263)
StreamResponse-wrapped): requires A2A 1.0 §4.3.3 spec read before any code changesMIGRATION_v3_to_v4.mdbut @bokelley should confirm scopeWhat was tested
pytest tests/test_protocols.py— 76 passed (3 new + 73 existing)ruff check src/— cleanKnown nits (not fixed — surface for reviewer)
result.successisTrueforTASK_STATE_REJECTEDin the else-branch of_process_task_response— semantically wrong but pre-dates this PRpytest.mark.xfailmarker once a fix is planned; left as a comment for now to keep this PR minimalPre-PR review
context_idassertion in auth test (added)Session: https://claude.ai/code/session_01MxALGppjocjuZzDVp48tps
Generated by Claude Code