Skip to content

Conversation

@0xrushi
Copy link
Contributor

@0xrushi 0xrushi commented May 17, 2025

The session-id and task-ids are inconsistent because python_a2a/client/streaming.py was creating a new task on each run instead of reusing the existing session.

before


INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://localhost:64914
INFO:werkzeug:Press CTRL+C to quit
Task streaming client initialized with URL: http://localhost:64914/a2a/tasks/stream

Creating task for query: "Process this text and extract key information"
Streaming task progress:
------------------------------------------------------------
INFO:werkzeug:127.0.0.1 - - [17/May/2025 10:44:39] "GET /agent.json HTTP/1.1" 200 -
Task streaming request received: {"id": "841bff66-5b08-47b4-aa7b-d07b1725883c", "sessionId": "788f8680-3454-4ccc-8a80-8008a7acde87", ...
INFO:werkzeug:127.0.0.1 - - [17/May/2025 10:44:39] "POST /a2a/tasks/stream HTTP/1.1" 200 -
[Server] Processing task 841bff66-5b08-47b4-aa7b-d07b1725883c
[Server] Query: Process this text and extract key information...
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Yielding SUBMITTED state
Put task update 0 in queue
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Yielding initial WAITING state
Put task update 1 in queue
Raw update 1 artifacts:
[Status] SUBMITTED
Task for processing artifact: Task(id='fd325555-fada-444d-b3a7-e5d9a94e47ca', session_id='d654d66a-a808-4b10-a226-f76cb819227a', status=TaskStatus(state=<TaskState.SUBMITTED: 'submitted'>, message=None, timestamp='2025-05-17T10:44:39.646880'), message=None, history=[], artifacts=[], metadata={})
Raw update 2 artifacts:
[Status] SUBMITTED
Task for processing artifact: Task(id='889f3ad7-0be6-4e42-86c8-8ed55f4b8ae9', session_id='61c30ffb-5874-4551-a149-b0a9d606bfa2', status=TaskStatus(state=<TaskState.SUBMITTED: 'submitted'>, message=None, timestamp='2025-05-17T10:44:39.658086'), message=None, history=[], artifacts=[], metadata={})
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Step 1/3 - Analyzing input
Put task update 2 in queue
Raw update 3 artifacts:
[Status] SUBMITTED
Task for processing artifact: Task(id='b6071580-7ffd-46ef-8775-c1348cb86626', session_id='232ec86c-64d9-493c-a1b7-4d6473430798', status=TaskStatus(state=<TaskState.SUBMITTED: 'submitted'>, message=None, timestamp='2025-05-17T10:44:40.835694'), message=None, history=[], artifacts=[], metadata={})
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Step 2/3 - Processing content
Put task update 3 in queue
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Adding partial result (243 chars)
Put task update 4 in queue
Raw update 4 artifacts:
[Status] SUBMITTED
Task for processing artifact: Task(id='9786e3ac-e489-47b8-ac32-3517cd7d116b', session_id='50051178-6aca-49f4-a048-41619eb5782f', status=TaskStatus(state=<TaskState.SUBMITTED: 'submitted'>, message=None, timestamp='2025-05-17T10:44:41.435175'), message=None, history=[], artifacts=[], metadata={})
Raw update 5 artifacts:
[Status] SUBMITTED
Task for processing artifact: Task(id='aca10784-ac78-45d1-ac01-2e6e1ed70e82', session_id='7d60152c-8b2e-49c0-a35e-2dafeb40bb38', status=TaskStatus(state=<TaskState.SUBMITTED: 'submitted'>, message=None, timestamp='2025-05-17T10:44:41.446563'), message=None, history=[], artifacts=[], metadata={})
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Step 3/3 - Generating results
Put task update 5 in queue
Raw update 6 artifacts:
[Status] SUBMITTED
Task for processing artifact: Task(id='01a0db8b-037f-45de-89aa-27c164d13926', session_id='29404be9-b17f-4812-a1dd-c9a06c3bf9ed', status=TaskStatus(state=<TaskState.SUBMITTED: 'submitted'>, message=None, timestamp='2025-05-17T10:44:42.092829'), message=None, history=[], artifacts=[], metadata={})
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Yielding final COMPLETED state
Put task update 6 in queue
[Server] Task 841bff66-5b08-47b4-aa7b-d07b1725883c: Processing complete
Task streaming complete

------------------------------------------------------------
Task Completed
✓ Received 6 task updates in 3.71 seconds
✓ Processed 0 artifacts
✓ Update rate: 1.6 updates/second

after

python examples/streaming/04_task_based_streaming.py
Starting task streaming server on port 64877...
Server configured for 3 processing steps
Starting A2A server on http://localhost:64877/a2a
 * Serving Flask app 'python_a2a.server.http'
 * Debug mode: off
INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://localhost:64877
INFO:werkzeug:Press CTRL+C to quit
Task streaming client initialized with URL: http://localhost:64877/a2a/tasks/stream

Creating task for query: "Process this text and extract key information"
Streaming task progress:
------------------------------------------------------------
INFO:werkzeug:127.0.0.1 - - [17/May/2025 10:41:52] "GET /agent.json HTTP/1.1" 200 -
Task streaming request received: {"id": "e783531c-8d4d-4a18-a687-b95375261409", "session_id": "84a241f2-4369-461d-9e8f-404e733f333e",...
INFO:werkzeug:127.0.0.1 - - [17/May/2025 10:41:52] "POST /a2a/tasks/stream HTTP/1.1" 200 -
[Server] Processing task e783531c-8d4d-4a18-a687-b95375261409
[Server] Query: Process this text and extract key information...
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Yielding SUBMITTED state
Put task update 0 in queue
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Yielding initial WAITING state
Put task update 1 in queue
Raw update 1 artifacts:
[Status] SUBMITTED
Task for processing artifact: Task(id='e783531c-8d4d-4a18-a687-b95375261409', session_id='84a241f2-4369-461d-9e8f-404e733f333e', status=TaskStatus(state=<TaskState.SUBMITTED: 'submitted'>, message=None, timestamp='2025-05-17T10:41:52.374263'), message={'content': {'text': 'Process this text and extract key information', 'type': 'text'}, 'role': 'user', 'message_id': '80693408-8400-4f68-a1c6-722aa28506e3'}, history=[], artifacts=[], metadata={})
Raw update 2 artifacts:
[Status] WAITING
Task for processing artifact: Task(id='e783531c-8d4d-4a18-a687-b95375261409', session_id='84a241f2-4369-461d-9e8f-404e733f333e', status=TaskStatus(state=<TaskState.WAITING: 'waiting'>, message=None, timestamp='2025-05-17T10:41:52.374283'), message={'content': {'text': 'Process this text and extract key information', 'type': 'text'}, 'role': 'user', 'message_id': '80693408-8400-4f68-a1c6-722aa28506e3'}, history=[], artifacts=[], metadata={})
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Step 1/3 - Analyzing input
Put task update 2 in queue
Raw update 3 artifacts:
  Artifact 0 type: progress_update
  Artifact 0 raw: {"type": "progress_update", "role": "system", "step": 1, "total_steps": 3, "action": "Analyzing input", "progress": 0.3333333333333333}...
[Status] WAITING | Step 1/3: Analyzing input
Task for processing artifact: Task(id='e783531c-8d4d-4a18-a687-b95375261409', session_id='84a241f2-4369-461d-9e8f-404e733f333e', status=TaskStatus(state=<TaskState.WAITING: 'waiting'>, message={'step': 1, 'total_steps': 3, 'action': 'Analyzing input'}, timestamp='2025-05-17T10:41:52.374283'), message={'content': {'text': 'Process this text and extract key information', 'type': 'text'}, 'role': 'user', 'message_id': '80693408-8400-4f68-a1c6-722aa28506e3'}, history=[], artifacts=[{'type': 'progress_update', 'role': 'system', 'step': 1, 'total_steps': 3, 'action': 'Analyzing input', 'progress': 0.3333333333333333}], metadata={})
Progress: [==========                    ] 33.3%
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Step 2/3 - Processing content
Put task update 3 in queue
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Adding partial result (243 chars)
Put task update 4 in queue
Raw update 4 artifacts:
  Artifact 0 type: progress_update
  Artifact 0 raw: {"type": "progress_update", "role": "system", "step": 2, "total_steps": 3, "action": "Processing content", "progress": 0.6666666666666666}...
  Artifact 1 type: progress_update
  Artifact 1 raw: {"type": "progress_update", "role": "system", "step": 1, "total_steps": 3, "action": "Analyzing input", "progress": 0.3333333333333333}...
[Status] WAITING | Step 2/3: Processing content
Task for processing artifact: Task(id='e783531c-8d4d-4a18-a687-b95375261409', session_id='84a241f2-4369-461d-9e8f-404e733f333e', status=TaskStatus(state=<TaskState.WAITING: 'waiting'>, message={'step': 2, 'total_steps': 3, 'action': 'Processing content'}, timestamp='2025-05-17T10:41:52.374283'), message={'content': {'text': 'Process this text and extract key information', 'type': 'text'}, 'role': 'user', 'message_id': '80693408-8400-4f68-a1c6-722aa28506e3'}, history=[], artifacts=[{'type': 'progress_update', 'role': 'system', 'step': 2, 'total_steps': 3, 'action': 'Processing content', 'progress': 0.6666666666666666}, {'type': 'progress_update', 'role': 'system', 'step': 1, 'total_steps': 3, 'action': 'Analyzing input', 'progress': 0.3333333333333333}], metadata={})
Progress: [====================          ] 66.7%
Progress: [==========                    ] 33.3%
Raw update 5 artifacts:
  Artifact 0 type: MISSING
  Artifact 0 raw: {"parts": [{"type": "text", "text": "## Partial Analysis (Step 1/3)\n\nInitial processing of your query: \"Process this text and extract ...\"\n\nCurrently analyzing the input and preparing for furthe...
  Artifact 1 type: progress_update
  Artifact 1 raw: {"type": "progress_update", "role": "system", "step": 2, "total_steps": 3, "action": "Processing content", "progress": 0.6666666666666666}...
  Artifact 2 type: progress_update
  Artifact 2 raw: {"type": "progress_update", "role": "system", "step": 1, "total_steps": 3, "action": "Analyzing input", "progress": 0.3333333333333333}...
[Status] WAITING | Step 2/3: Processing content
Task for processing artifact: Task(id='e783531c-8d4d-4a18-a687-b95375261409', session_id='84a241f2-4369-461d-9e8f-404e733f333e', status=TaskStatus(state=<TaskState.WAITING: 'waiting'>, message={'step': 2, 'total_steps': 3, 'action': 'Processing content'}, timestamp='2025-05-17T10:41:52.374283'), message={'content': {'text': 'Process this text and extract key information', 'type': 'text'}, 'role': 'user', 'message_id': '80693408-8400-4f68-a1c6-722aa28506e3'}, history=[], artifacts=[{'parts': [{'type': 'text', 'text': '## Partial Analysis (Step 1/3)\n\nInitial processing of your query: "Process this text and extract ..."\n\nCurrently analyzing the input and preparing for further processing. This is an intermediate result and will be expanded in subsequent steps.'}]}, {'type': 'progress_update', 'role': 'system', 'step': 2, 'total_steps': 3, 'action': 'Processing content', 'progress': 0.6666666666666666}, {'type': 'progress_update', 'role': 'system', 'step': 1, 'total_steps': 3, 'action': 'Analyzing input', 'progress': 0.3333333333333333}], metadata={})

Partial Result:
## Partial Analysis (Step 1/3)

Initial processing of your query: "Process this text and extract ..."

Currently analyzing the input and preparing for further processing. This is an intermediate result and will be expanded in subsequent steps.
Progress: [====================          ] 66.7%
Progress: [==========                    ] 33.3%
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Step 3/3 - Generating results
Put task update 5 in queue
Raw update 6 artifacts:
  Artifact 0 type: progress_update
  Artifact 0 raw: {"type": "progress_update", "role": "system", "step": 3, "total_steps": 3, "action": "Generating results", "progress": 1.0}...
  Artifact 1 type: MISSING
  Artifact 1 raw: {"parts": [{"type": "text", "text": "## Partial Analysis (Step 1/3)\n\nInitial processing of your query: \"Process this text and extract ...\"\n\nCurrently analyzing the input and preparing for furthe...
  Artifact 2 type: progress_update
  Artifact 2 raw: {"type": "progress_update", "role": "system", "step": 2, "total_steps": 3, "action": "Processing content", "progress": 0.6666666666666666}...
  Artifact 3 type: progress_update
  Artifact 3 raw: {"type": "progress_update", "role": "system", "step": 1, "total_steps": 3, "action": "Analyzing input", "progress": 0.3333333333333333}...
[Status] WAITING | Step 3/3: Generating results
Task for processing artifact: Task(id='e783531c-8d4d-4a18-a687-b95375261409', session_id='84a241f2-4369-461d-9e8f-404e733f333e', status=TaskStatus(state=<TaskState.WAITING: 'waiting'>, message={'step': 3, 'total_steps': 3, 'action': 'Generating results'}, timestamp='2025-05-17T10:41:52.374283'), message={'content': {'text': 'Process this text and extract key information', 'type': 'text'}, 'role': 'user', 'message_id': '80693408-8400-4f68-a1c6-722aa28506e3'}, history=[], artifacts=[{'type': 'progress_update', 'role': 'system', 'step': 3, 'total_steps': 3, 'action': 'Generating results', 'progress': 1.0}, {'parts': [{'type': 'text', 'text': '## Partial Analysis (Step 1/3)\n\nInitial processing of your query: "Process this text and extract ..."\n\nCurrently analyzing the input and preparing for further processing. This is an intermediate result and will be expanded in subsequent steps.'}]}, {'type': 'progress_update', 'role': 'system', 'step': 2, 'total_steps': 3, 'action': 'Processing content', 'progress': 0.6666666666666666}, {'type': 'progress_update', 'role': 'system', 'step': 1, 'total_steps': 3, 'action': 'Analyzing input', 'progress': 0.3333333333333333}], metadata={})
Progress: [==============================] 100.0%

Partial Result:
## Partial Analysis (Step 1/3)

Initial processing of your query: "Process this text and extract ..."

Currently analyzing the input and preparing for further processing. This is an intermediate result and will be expanded in subsequent steps.
Progress: [====================          ] 66.7%
Progress: [==========                    ] 33.3%
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Yielding final COMPLETED state
Put task update 6 in queue
[Server] Task e783531c-8d4d-4a18-a687-b95375261409: Processing complete
Task streaming complete

------------------------------------------------------------
Task Completed
✓ Received 6 task updates in 4.20 seconds
✓ Processed 10 artifacts
✓ Update rate: 1.4 updates/second

@themanojdesai themanojdesai merged commit 1cbcacc into themanojdesai:main May 22, 2025
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.

2 participants