feat: add session id to task tool metadata#3559
Conversation
275427b to
820c797
Compare
820c797 to
a28097c
Compare
Can you explain what you mean by this? I may just be blanking but of what use is it to primary agent to give it a session id? Also I don't think the metadata of a tool is ever presented to the llm anyway but I could be wrong |
This is helpful for retrieving it with the SDK, not so much for use by the LLM. For more context, my use case is building a UI that supports threads in a chat. So when a subagent is spun up, it creates a thread that users can open up. When rendering the Task tool in the primary agent's chat, I want to have a button that opens up the thread from there. In order to do this, I need the session ID that the specific thread spun up. |
|
Oh okay cool, just wanted to see what the reasoning was. In that case it makes sense |
Co-authored-by: Brandon Wisnicki <bwisnicki@palantir.com>
Co-authored-by: Brandon Wisnicki <bwisnicki@palantir.com>
Co-authored-by: Brandon Wisnicki <bwisnicki@palantir.com>
Co-authored-by: Brandon Wisnicki <bwisnicki@palantir.com>
Co-authored-by: Brandon Wisnicki <bwisnicki@palantir.com>
Co-authored-by: Brandon Wisnicki <bwisnicki@palantir.com>
When an agent invokes a Task/subagent, it has no good way of knowing the session that the subagent created (as far as I'm aware). While you are able to get it from the summary, this array is only populated when tools are called, so there could be a delay or not appear at all if the subagent does not invoke a tool.
This PR surfaces the subagent's session ID to the invoking agent right after the session is created. This allows the invoking agent to have a UI around the specific subagent's session in a more first class way.
Thank you!