feat: include endpoints to interact with specific agent sessions#943
Open
miguelangarano wants to merge 6 commits intoRightNow-AI:mainfrom
Open
feat: include endpoints to interact with specific agent sessions#943miguelangarano wants to merge 6 commits intoRightNow-AI:mainfrom
miguelangarano wants to merge 6 commits intoRightNow-AI:mainfrom
Conversation
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
This PR introduces the ability to interact with and retrieve specific agent sessions directly, bypassing the agent's default active session. This enables clients to multiplex multiple independent conversations with the same agent simultaneously over HTTP or a single WebSocket connection, while keeping the context and memory of each session strictly isolated.
Changes
GET /api/sessions/{id}to fetch the conversation history of any specific session.POST /api/agents/{id}/sessions/{session_id}/messageto send a synchronous message to a specific session.POST /api/agents/{id}/sessions/{session_id}/message/streamfor SSE streaming to a specific session.send_message_with_handle_and_blocksandsend_message_streamingto accept an optionaltarget_session_id.execute_llm_agentto use the target session if provided, otherwise falling back to the agent's active session.session_idto route messages.session_idas a mandatory field in all outgoing WS events (typing,text_delta,response,error, etc.) to allow clients to reliably filter and route incoming streams. If the client doesn't provide one, it resolves and returns the agent's active session ID.test_specific_session_messaginginapi_integration_test.rsto verify session isolation, message routing, and specific session retrieval.Testing
cargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepassesSecurity