feat: replace custom ContextStore with A2A-native task history#121
Open
feat: replace custom ContextStore with A2A-native task history#121
Conversation
ab4cbf2 to
e204981
Compare
d0b5b45 to
8a81d55
Compare
Use A2A Tasks as the single source of truth for conversation history,
eliminating the duplicate ContextStore abstraction.
adk-server:
- Implement on_list_tasks in A2A proxy (forwards to agent transport)
- Remove context history endpoints (POST/GET/DELETE /contexts/{id}/history)
- Remove title generation job and worker
- Remove history-related service, repository, and schema code
adk-py:
- Delete ContextStore, InMemoryContextStore, PlatformContextStore
- Rewire RunContext to use TaskStore (load_history reads from task store)
- Remove store(), store_sync(), delete_history_from_id() from RunContext
- Remove context_store parameter from create_app() and Server.serve()
- Remove ContextHistoryItem and history methods from platform SDK
adk-ui:
- Add listTasks to A2A JSON-RPC client
- Create fetchTasksForContext for server-side task fetching
- Add convertTasksToUIMessages for task-to-UI conversion
- Rewire AgentRun/PlatformContextProvider/MessagesProvider to use tasks
- Remove useListContextHistory, context history API functions and types
Closes #116
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Radek Ježek <radek.jezek@ibm.com>
e204981 to
fbb30a3
Compare
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.
Summary
ContextStoreabstraction with A2A's nativeTaskStoreas the single source of truth for conversation historyon_list_tasksin the A2A proxy so the UI can fetch history viaListTasksJSON-RPC/contexts/{id}/historyREST endpointThis is a breaking change — the
context_storeparameter,context.store(), and/contexts/historyendpoints are all removed.Closes #116
Changes by layer
adk-server
on_list_tasksinProxyRequestHandler(forwards to agent transport)POST/GET/DELETE /contexts/{id}/history)adk-py
ContextStore,InMemoryContextStore,PlatformContextStoreRunContextto useTaskStore—load_history()now reads fromtask_store.get(task_id)store(),store_sync(),delete_history_from_id()fromRunContextcontext_storeparameter fromcreate_app()andServer.serve()ContextHistoryItemand history methods from platform SDKcontext.store()callsadk-ui
listTasksto A2A JSON-RPC clientfetchTasksForContextfor server-side RSC task fetchingconvertTasksToUIMessagesfor task→UI message conversionAgentRun→PlatformContextProvider→MessagesProviderto use tasksuseListContextHistoryhook and context history API codeTest plan
mise run checkpasses (linting, type checking, doc snippets)ListTasksload_history)