-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat(http_server): add /a2a/threads and /a2a/threads/{thread}/messages endpoints #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -953,9 +953,17 @@ def _dispatch(self, method: str) -> None: | |||||||||||||||||||||
| self._handle_a2a_members(query) | ||||||||||||||||||||||
| elif method == "GET" and path == "/a2a/messages": | ||||||||||||||||||||||
| self._handle_a2a_messages(query) | ||||||||||||||||||||||
| elif method == "GET" and path == "/a2a/threads": | ||||||||||||||||||||||
| self._handle_a2a_threads(query) | ||||||||||||||||||||||
| elif method == "GET" and path.startswith("/a2a/threads/") and "/messages" in path: | ||||||||||||||||||||||
| self._handle_a2a_thread_messages(query) | ||||||||||||||||||||||
|
Comment on lines
+956
to
+959
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Missing thread handlers http_server._dispatch routes GET /a2a/threads and /a2a/threads/{thread}/messages to
_handle_a2a_threads/_handle_a2a_thread_messages, but those handlers are not defined, so matching
requests raise AttributeError and fail with a 500.
Agent Prompt
|
||||||||||||||||||||||
| elif method == "GET" and path == "/a2a/stream": | ||||||||||||||||||||||
| self._handle_a2a_stream(query) | ||||||||||||||||||||||
| return # SSE response already sent; skip _send_json error path | ||||||||||||||||||||||
| elif method == "GET" and path == "/a2a/threads": | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Duplicate route registration — Reply with |
||||||||||||||||||||||
| self._handle_a2a_threads(query) | ||||||||||||||||||||||
| elif method == "GET" and path.startswith("/a2a/threads/") and "/messages" in path: | ||||||||||||||||||||||
| self._handle_a2a_thread_messages(query) | ||||||||||||||||||||||
|
Comment on lines
960
to
+966
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Lines 963-966 are unreachable duplicates of Lines 956-959. The same two 🧹 Proposed fix elif method == "GET" and path == "/a2a/stream":
self._handle_a2a_stream(query)
return # SSE response already sent; skip _send_json error path
- elif method == "GET" and path == "/a2a/threads":
- self._handle_a2a_threads(query)
- elif method == "GET" and path.startswith("/a2a/threads/") and "/messages" in path:
- self._handle_a2a_thread_messages(query)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Comment on lines
+963
to
+966
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6. Duplicate thread code paths The PR introduces duplicated /a2a/threads routing branches and duplicate definitions of a2a_threads/a2a_thread_messages in service.py; one set becomes unreachable/overridden, increasing the risk that future fixes are applied to the wrong copy. Agent Prompt
|
||||||||||||||||||||||
| # Task graph endpoints — prefix matching for /tasks/{id} paths | ||||||||||||||||||||||
| elif method == "POST" and path == "/tasks": | ||||||||||||||||||||||
| self._handle_task_create() | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: jaylfc/taosmd
Length of output: 151
🏁 Script executed:
Repository: jaylfc/taosmd
Length of output: 40229
🏁 Script executed:
Repository: jaylfc/taosmd
Length of output: 32743
🏁 Script executed:
Repository: jaylfc/taosmd
Length of output: 348
Add the A2A thread routes before exposing them.
_handle_a2a_threadsand_handle_a2a_thread_messagesare referenced from theTaosmdHandlerrouting but are not defined intaosmd/http_server.py, so any request to these routes can escape to the generic exception handler and return500. Implement these handlers or remove the routes. For the per-thread messages route, also parse the URL-decoded thread segment and pass it toservice.a2a_thread_messages, whose signature requiresthreadplusbefore/after/limit.🤖 Prompt for AI Agents