Goal
azd ai agent invoke --new-session results in a new session ID from the backend.
Context
The backend derives sessions from a conversation ID, so when --new-session is used and an existing conversation ID is present in the .foundry-agent.json, the same session ID is returned by the server.
This is unexpected because we have --new-session and --new-conversation as separate flags.
To workaround this and always get a new session, you have to pass both --new-session and --new-conversation.
I think we can make these mutually exclusive. new session always does a new conversation too.
Current Behavior
when --new-session is used and an existing conversation ID is present in the .foundry-agent.json, the same session ID is returned by the server.
Desired Behavior
when --new-session is used it also starts a new conversation so that a new session ID is received.
Implementation Notes (optional but powerful)
--new-session automatically includes the behavior of --new-conversation, like if I do --new-session --new-conversation today.
--new-session --new-conversation is still valid, its just not necessary anymore since --new-session will include it.
--new-conversation is valid alone, and continues to use the same session.
Acceptance Criteria
How to Test
azd ai agent init -m "https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/agent-framework/echo-agent/agent.yaml"
azd up
azd ai agent invoke "hello"
azd ai agent invoke "hi" --new-session
Verify the session id between 3 and 4 are different.
Goal
azd ai agent invoke --new-sessionresults in a new session ID from the backend.Context
The backend derives sessions from a conversation ID, so when --new-session is used and an existing conversation ID is present in the .foundry-agent.json, the same session ID is returned by the server.
This is unexpected because we have
--new-sessionand--new-conversationas separate flags.To workaround this and always get a new session, you have to pass both
--new-session and --new-conversation.I think we can make these mutually exclusive. new session always does a new conversation too.
Current Behavior
when --new-session is used and an existing conversation ID is present in the .foundry-agent.json, the same session ID is returned by the server.
Desired Behavior
when --new-session is used it also starts a new conversation so that a new session ID is received.
Implementation Notes (optional but powerful)
--new-sessionautomatically includes the behavior of--new-conversation, like if I do--new-session --new-conversationtoday.--new-session --new-conversationis still valid, its just not necessary anymore since--new-sessionwill include it.--new-conversationis valid alone, and continues to use the same session.Acceptance Criteria
How to Test
azd ai agent init -m "https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/agent-framework/echo-agent/agent.yaml"azd upazd ai agent invoke "hello"azd ai agent invoke "hi" --new-sessionVerify the session id between 3 and 4 are different.