Skip to content

fix: inherit stored task context id - #1208

Draft
samrusani wants to merge 1 commit into
a2aproject:mainfrom
samrusani:fix/1206-inherit-task-context-id
Draft

fix: inherit stored task context id#1208
samrusani wants to merge 1 commit into
a2aproject:mainfrom
samrusani:fix/1206-inherit-task-context-id

Conversation

@samrusani

Copy link
Copy Markdown

Description

When a V2 message continues an existing task with taskId but omits
contextId, the handler fetches the stored task but previously allowed the
request context to generate a new context ID.

This patch carries the stored task's context ID into request-context
construction while continuing to defer loading the mutable task into the
executor context. A focused regression verifies that both the request context
and message retain the stored conversation context.

Validation:

  • Pre-fix regression failed because a generated UUID replaced
    stored_context.

  • Focused regression: 1 passed.

  • V2 request-handler suite: 65 passed.

  • ./scripts/lint.sh: passed (three pre-existing ty unused-ignore warnings).

  • uv run pytest: 1970 passed, 90 skipped, 3 xfailed, 1 xpassed.

  • uv run pytest --cov=src --cov-report=term-missing: 1970 passed, 90 skipped,
    3 xfailed, 1 xpassed. Database-backed tests skipped because their optional
    test DSNs were not configured.

  • Follow the CONTRIBUTING Guide.

  • Make the Pull Request title follow the Conventional Commits specification.

  • Ensure the tests and linter pass.

  • Appropriate docs were updated (not needed for this behavioral fix).

Fixes #1206 🦕

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/request_handlers/default_request_handler_v2.py 94.25% 94.35% 🟢 +0.10%
Total 93.12% 93.12% ⚪️ 0.00%

Generated by coverage-comment.yml

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.

[Bug]: taskId without contextId creates a new context instead of inheriting it

1 participant