Skip to content

fix(agents): reset conversation with new session - #10056

Open
Zhijie Huang (hund030) wants to merge 3 commits into
mainfrom
fix/7866-new-session-conversation
Open

Zhijie Huang (hund030) wants to merge 3 commits into
mainfrom
fix/7866-new-session-conversation

Conversation

@hund030

@hund030 Zhijie Huang (hund030) commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make --new-session also force a new conversation for Responses invocations.
  • Apply the behavior consistently to local and remote invocation paths.
  • Cover all --new-session and --new-conversation flag combinations.

Fixes #7866

Validation

  • go test ./internal/cmd -count=1
  • Live test with an active hosted Responses agent using the locally built extension:
    • Baseline conversation: conv_09cfa...; session: b8b9308e...
    • With --new-session: conversation: conv_01610f...; session: 0d210fee...
    • Both identifiers changed as expected.

The target agent returned HTTP 500 after assigning the identifiers, but the session/conversation lifecycle covered by this change completed and demonstrated the expected reset behavior.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag Rick Winter (@RickWinter) and Kristen Womack (@kristenwomack) to let us know.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The managed Responses path remains unaffected, and the existing Tier 2 scenario asserts the obsolete behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates Responses invocations so --new-session also resets conversation state.

Changes:

  • Adds a shared conversation-reset predicate.
  • Applies it to local and remote hosted invocations.
  • Tests all flag combinations.
File summaries
File Description
invoke.go Resets conversations when starting new sessions.
invoke_test.go Tests reset-flag combinations.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/invoke.go
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/invoke_test.go
@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Sep 16, 2026
Copilot AI review requested due to automatic review settings September 16, 2026 06:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation consistently covers all Responses paths with focused unit and scenario validation.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@glharper Glenn Harper (glharper) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One flag-conflict case remains in #10056.

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/invoke.go
Copilot AI review requested due to automatic review settings September 17, 2026 05:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new conflict validation incorrectly rejects invocations and A2A protocol combinations where conversations are unused.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

return err
}

if flags.newSession && flags.conversation != "" {
@github-actions github-actions Bot added the ext-foundry azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes}, microsoft.foundry label Sep 17, 2026
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.agents PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10056/azure-ai-agents.zip"
  • Version: 1.0.0-beta.15.pr.10056.6847446
  • Merge commit: 4880e1e

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

Labels

ext-agents azure.ai.agents extension ext-foundry azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes}, microsoft.foundry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--new-session doesn't create a new session when an existing conversation ID is present

3 participants