Skip to content

Note-Taking Agent does not invoke tools when starting a new session in remote #1038

Closed

Description

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:
Image

Steps to Reproduce:

  1. 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".
  2. Run azd up.
  3. Run azd ai agent invoke --new-session "save a note - hosted session files smoke test". Receive message Saved to note.
  4. Run azd ai agent invoke "show me all my notes". Receive You don’t have any saved notes yet.
  5. Run azd ai agent invoke "save a note - hosted session files smoke test".
  6. Rerun azd ai agent invoke "show me all my notes". The note hosted session files smoke test is present.
  7. Rerun azd ai agent invoke --new-session "save a note - hosted session files smoke test".
  8. 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.

Environment:

Expected:
Confirm whether this is by design.

JeffreyCA and Rick Winter (@RickWinter) for notification.

Activity

  1. 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
  2. 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
  3. JeffreyCA commented on Sep 30, 2026

    @JeffreyCA
    Contributor

    Chenxi Jiang (@ChenxiJiang333) can you try updating your local sample code according to #1039 and re-test?

  4. ChenxiJiang333 commented on Oct 8, 2026

    @ChenxiJiang333
    Author

    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?

    Image
  5. RickWinter commented on Oct 12, 2026

    @RickWinter

    I dug through both the sample and the azure.ai.agents invoke path. There are two separate behaviors here:

    1. 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.

    2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions