Skip to content

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

Closed as not planned

Description

@lkk7

What happened?

Spec:

Agents MUST infer contextId from the task if only taskId is provided

Code:

        request_context = await self._request_context_builder.build(
            params=params,
            task_id=original_task_id,
            context_id=original_context_id,
            task=None,
            context=call_context,
        )

Then further...

if not self._context_id and not self._params.message.context_id:
    self._params.message.context_id = self._context_id_generator.generate(...)

I found no sight of using the task's context, it seems to generate it anyway. But please correct me if I'm wrong.

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added theissue type on Aug 25, 2026
  2. samrusani commented on Aug 25, 2026

    @samrusani

    I can send a focused fix for this: carry the stored task’s context ID into the V2 request context when a request supplies only taskId, while preserving deferred task loading, and add a regression test for that continuation path. I’ll keep the patch limited to this behavior.

  3. self-assigned this
    on Aug 25, 2026
  4. rohityan commented on Aug 28, 2026

    @rohityan

    Hi @lkk7 , thanks for reporting this issue. As a temporary workaround you could subclass DefaultRequestHandlerV2 and override _setup_active_task to infer original_context_id from the retrieved task.context_id

  5. github-actions commented on Sep 11, 2026

    @github-actions

    Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

  6. github-actions commented on Sep 24, 2026

    @github-actions

    This issue was closed because it has been inactive for 27 days. Please post a new issue if you need further assistance. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions