You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Note-Taking Agent does not invoke tools when starting a new session in remote #1038
Description:
When the new-session parameter is passed to remote invoke, the agent does not execute the included request, although this works correctly locally.
For example, after running azd ai agent invoke --new-session "save a note - hosted session files smoke test", the saved note remains empty, while the same command without new-session saves the note successfully.
Also, the saved notes cannot be retrieved across sessions remotely as it does locally:
Steps to Reproduce:
Run azd ai agent init --manifest "https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/bring-your-own/responses/notetaking-agent/azure.yaml".
Run azd up.
Run azd ai agent invoke --new-session "save a note - hosted session files smoke test". Receive message Saved to note.
Run azd ai agent invoke "show me all my notes". Receive You don’t have any saved notes yet.
Run azd ai agent invoke "save a note - hosted session files smoke test".
Rerun azd ai agent invoke "show me all my notes". The note hosted session files smoke test is present.
Rerun azd ai agent invoke --new-session "save a note - hosted session files smoke test".
Run azd ai agent invoke "show me all my notes". The saved notes return empty, although they are able to be retrieved across sessions with local invoke.
changed the title [-]Note-Taking Agent does not invoke tools when starting a new session.[/-][+]Note-Taking Agent does not invoke tools when starting a new session in remote.[/+]on Sep 30, 2026
changed the title [-]Note-Taking Agent does not invoke tools when starting a new session in remote.[/-][+]Note-Taking Agent does not invoke tools when starting a new session in remote[/+]on Sep 30, 2026
I dug through both the sample and the azure.ai.agents invoke path. There are two separate behaviors here:
The initial remote --new-session failure is in the sample. On the first request, azd intentionally leaves agent_session_id out so the hosted platform can create the session. The platform supplies that ID to the container through FOUNDRY_AGENT_SESSION_ID and returns it to azd in x-agent-session-id. The sample only reads agent_session_id from the request body, so the first tool call writes to notes_default.jsonl. The next invoke sends the assigned session ID and reads notes_<session-id>.jsonl, which makes the original note appear lost. Fix notetaking Responses samples losing notes on new hosted sessions #1039 has the right fix by falling back to FOUNDRY_AGENT_SESSION_ID, and the retest confirms that it resolves this part.
Notes not being available after starting another new remote session is expected. Hosted sessions have isolated persistent $HOME filesystems. State persists across turns and idle/resume for the same session, but it is not shared across different session IDs.
The local cross-session behavior is misleading rather than the expected reference behavior. The current azd extension sends the local Responses session as session_id, while the Responses contract and this sample use agent_session_id. The sample therefore falls back to default locally, causing different local sessions to share notes_default.jsonl. That mismatch should be tracked separately in Azure/azure-dev.
Conclusion: merge #1039 for the reported first-invocation failure. The remaining remote cross-session isolation is by design, not an azd core bug.
Activity
[-]Note-Taking Agent does not invoke tools when starting a new session.[/-][+]Note-Taking Agent does not invoke tools when starting a new session in remote.[/+][-]Note-Taking Agent does not invoke tools when starting a new session in remote.[/-][+]Note-Taking Agent does not invoke tools when starting a new session in remote[/+]JeffreyCA commentedon Sep 30, 2026
Chenxi Jiang (@ChenxiJiang333) can you try updating your local sample code according to #1039 and re-test?
ChenxiJiang333 commentedon Oct 8, 2026
Hi JeffreyCA, notes can now be saved with new-session, but they still aren't accessible across sessions as they are locally. Is that expected?
RickWinter commentedon Oct 12, 2026
I dug through both the sample and the
azure.ai.agentsinvoke path. There are two separate behaviors here:The initial remote
--new-sessionfailure is in the sample. On the first request, azd intentionally leavesagent_session_idout so the hosted platform can create the session. The platform supplies that ID to the container throughFOUNDRY_AGENT_SESSION_IDand returns it to azd inx-agent-session-id. The sample only readsagent_session_idfrom the request body, so the first tool call writes tonotes_default.jsonl. The next invoke sends the assigned session ID and readsnotes_<session-id>.jsonl, which makes the original note appear lost. Fix notetaking Responses samples losing notes on new hosted sessions #1039 has the right fix by falling back toFOUNDRY_AGENT_SESSION_ID, and the retest confirms that it resolves this part.Notes not being available after starting another new remote session is expected. Hosted sessions have isolated persistent
$HOMEfilesystems. State persists across turns and idle/resume for the same session, but it is not shared across different session IDs.The local cross-session behavior is misleading rather than the expected reference behavior. The current azd extension sends the local Responses session as
session_id, while the Responses contract and this sample useagent_session_id. The sample therefore falls back todefaultlocally, causing different local sessions to sharenotes_default.jsonl. That mismatch should be tracked separately in Azure/azure-dev.Conclusion: merge #1039 for the reported first-invocation failure. The remaining remote cross-session isolation is by design, not an azd core bug.