Skip to content

fix: remove hosted-agent deploy session carryover#9150

Draft
huimiu wants to merge 1 commit into
mainfrom
hui/remove-session-carryover
Draft

fix: remove hosted-agent deploy session carryover#9150
huimiu wants to merge 1 commit into
mainfrom
hui/remove-session-carryover

Conversation

@huimiu

@huimiu huimiu commented Jul 15, 2026

Copy link
Copy Markdown
Member

Why

Hosted-agent deployments should not retain a live agent session across versions. Removing this unrelated deploy behavior prevents a post-deploy invocation from resuming a prior session.

Approach

Removed the predeploy session capture and postdeploy session resume hooks while preserving the existing deployment setup, RBAC checks, activity bot handling, and optimization reporting.

Copilot AI review requested due to automatic review settings July 15, 2026 08:07
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 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

🔗 Linked Issue Required

Thanks for the contribution! Please link a GitHub issue to this PR by adding Fixes #123 to the description or using the sidebar.
No issue yet? Feel free to create one!

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.

Pull request overview

Removes hosted-agent session carry-over from deployment hooks.

Changes:

  • Removes predeploy session capture.
  • Removes postdeploy session resume and unused API import.
  • Existing carry-over docs and dead code still need cleanup.

agentClient := agent_api.NewAgentClient(endpoint, cred)
carryOverSessionAfterDeploy(ctx, azdClient, agentClient, svc, envName)

return nil
@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jul 15, 2026

@jongio jongio 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.

Two things look like they got left behind by this removal:

  1. session_carryover.go and session_carryover_test.go are now dead. captureSessionForCarryover and carryOverSessionAfterDeploy have no production callers after this change, and the rest of that file only exists to support those two. Go doesn't flag unused package functions, and the tests keep the unused-code linters quiet, so CI stays green even though none of it runs anymore. Is the plan to keep the plumbing for a follow-up, or should that file and its tests be removed with this change?

  2. The README still has the "Session carry-over across deploys" section telling users to export AZD_AGENT_RESUME_SESSION_ON_DEPLOY=true. After this PR that variable is inert (sessionCarryoverEnabled() is only read from the now-dead functions), so the docs describe behavior that no longer exists. Worth updating or dropping that section in the same PR.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants