Skip to content

[FEATURE] Add Context ID to the task that is being submitted to the A2A Server #158

Description

@edenreich

Summary

Currently the CLI is only sending the Task ID created initially by the A2A Servers, ideally the CLI should also send the Context ID.

This allows the A2A Server to be aware of previously created tasks (each Context ID has a group of Task IDs).

The CLI should send also the Context ID.

Acceptance Criteria

  • Context ID is also sent to the A2A server
  • Context ID is being tracked per chat session
  • Context ID is sent regardless of the tasks status - if it was created by the first task it will be kept sending it to keep all the tasks grouped by the context and maintain conversation context (conversation context is maintained on the A2A server)

Activity

  1. added
    enhancement
    on Sep 17, 2025
  2. edenreich commented on Sep 17, 2025

    @edenreich
    ContributorAuthor

    @claude Can you implement it?

  3. claude commented on Sep 17, 2025

    @claude
    Contributor

    Claude finished @edenreich's task —— View job • claude/issue-158-20250917-1558 • Create PR ➔


    Implementing Context ID for A2A Server Communication ✅

    I've successfully implemented Context ID support for A2A server communication as requested!

    Todo List

    • Read CLAUDE.md and understand repo guidelines
    • Search codebase for A2A communication implementation
    • Understand current Task/Query tool structure
    • Check if ADK Message struct supports ContextID field
    • Extend TaskTracker interface to include Context ID support
    • Update SimpleTaskTracker implementation to track Context ID
    • Modify A2A Task tool to include Context ID in message parameters
    • Update A2A Query tool (if applicable) to include Context ID
    • Update tests to cover Context ID functionality
    • Run 'task check' to validate changes
    • Commit changes and create PR

    Implementation Summary

    ✅ All Acceptance Criteria Met:

    1. Context ID is sent to A2A server - The A2A Task tool now generates a UUID Context ID and includes it in all messages sent to A2A servers
    2. Context ID is tracked per chat session - The TaskTracker interface and SimpleTaskTracker implementation now persist Context ID across the entire chat session
    3. Context ID is sent regardless of task status - Context ID is always included when available, maintaining conversation grouping even when tasks complete or fail

    Key Changes Made:

    • Extended TaskTracker interface (internal/domain/interfaces.go): Added GetContextID(), SetContextID(), and ClearContextID() methods
    • Updated SimpleTaskTracker (internal/utils/task_tracker.go): Implemented Context ID storage and management with thread-safe operations
    • Enhanced A2A Task tool (internal/services/tools/a2a_task.go):
      • Auto-generates UUID Context ID on first task in session
      • Includes Context ID in all A2A message parameters
      • Ensures Context ID persists across all tasks
    • Comprehensive testing (internal/utils/task_tracker_test.go): Added full test coverage for Context ID functionality

    Technical Details:

    • Context ID is automatically generated using github.com/google/uuid when first needed
    • Once set, Context ID persists for the entire chat session until explicitly cleared
    • The ADK Message struct already supported ContextID field - implementation was straightforward
    • All existing functionality remains unchanged - this is purely additive

    The implementation ensures that A2A servers can now group related tasks by Context ID and maintain proper conversation context across multiple task submissions.


  4. inference-gateway-releaser commented on Sep 17, 2025

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.50.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions