Skip to content

Refresh agent-background-responses skill reference for current Agent Framework API#25

Merged
KSemenenko merged 3 commits intomainfrom
copilot/update-agent-background-responses-docs
Mar 17, 2026
Merged

Refresh agent-background-responses skill reference for current Agent Framework API#25
KSemenenko merged 3 commits intomainfrom
copilot/update-agent-background-responses-docs

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Upstream documentation for agent-background-responses changed (ETag mismatch detected by watch). The existing reference snapshot used stale sample paths and a renamed API surface.

Reference file updates (agent-background-responses.md)

  • Sample links: GettingStarted/Agents/Agent_Step17_BackgroundResponsesdotnet/samples/02-agents/Agents/Agent_Step14_BackgroundResponses
  • API renames across all code examples:
    • AgentThread / GetNewThreadAsync()AgentSession / CreateSessionAsync()
    • GetOpenAIResponseClient()GetResponsesClient()
    • AzureCliCredentialDefaultAzureCredential (with production caution note)
  • New sectionBackground Responses with Tools and State Persistence — covering the new Agent_Step10_BackgroundResponsesWithToolsAndPersistence sample: function tools during background ops, SerializeSessionAsync/DeserializeSessionAsync, and AgentAbstractionsJsonUtilities.DefaultOptions for ResponseContinuationToken round-tripping
// Before
AIAgent agent = new AzureOpenAIClient(new Uri("https://<myresource>.openai.azure.com"), new AzureCliCredential())
    .GetOpenAIResponseClient("<deployment-name>")
    .AsAIAgent();
AgentThread thread = await agent.GetNewThreadAsync();

// After
AIAgent agent = new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
    .GetResponsesClient(deploymentName)
    .AsAIAgent();
AgentSession session = await agent.CreateSessionAsync();
  • Limitations tightened: explicitly scopes background response support to GetResponsesClient-based agents only

SKILL.md

Incorporated AgentWorkflowBuilder additions from main (BuildConcurrent factory method in Core Knowledge and Decision Cheatsheet). Version bumped 1.4.01.5.1 to reflect both the merged main changes and the material reference update.

Original prompt

This section details on the original issue you should resolve

<issue_title>Upstream update: learn.microsoft.comagent-framework/user-guide/agents/agent-background-responses documentation documentation changed</issue_title>
<issue_description>Automation detected an upstream change for learn.microsoft.comagent-framework/user-guide/agents/agent-background-responses documentation.

Observed detail:

  • Agent Background Responses | Microsoft Learn | ETag "Z5AWyJ81Ik5+oZHwI22rDjf9qJ0="

Why this matters:

Likely skills to review:

  • dotnet-microsoft-agent-framework

Suggested follow-up:

  • Review the upstream release notes or documentation diff
  • Update the affected files under skills/
  • Update README.md if framework coverage or guidance changed
  • Close this issue after the catalog has been refreshed

<agent_instructions>Review all tasks and if needed make jsut one pr an done branch with all updates for skills and docs </agent_instructions>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…s, tools+persistence section

Co-authored-by: KSemenenko <4385716+KSemenenko@users.noreply.github.com>
Copilot AI changed the title [WIP] Update agent background responses documentation due to upstream change Refresh agent-background-responses skill reference for current Agent Framework API Mar 17, 2026
Copilot AI requested a review from KSemenenko March 17, 2026 21:24
@KSemenenko KSemenenko marked this pull request as ready for review March 17, 2026 21:42
Copilot AI review requested due to automatic review settings March 17, 2026 21:42
@KSemenenko
Copy link
Member

@copilot resolve conflict

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3247cc44fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lastReceivedUpdate = update;

// Simulate connection loss after first piece of content received
if (update.Text.Length > 0)

Choose a reason for hiding this comment

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

P2 Badge Guard stream update text before checking length

This new interruption condition dereferences update.Text directly, but streaming updates are not guaranteed to carry text content (for example, tool-call or metadata updates), so update.Text can be null. In that case this sample throws NullReferenceException before storing a continuation token, which breaks the resume flow it is trying to demonstrate.

Useful? React with 👍 / 👎.

while (response.ContinuationToken is not null)
{
// Persist session and continuation token to durable storage
await PersistAgentState(agent, session, response.ContinuationToken);

Choose a reason for hiding this comment

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

P2 Badge Persist the restored session state inside polling loop

Inside the new tools/persistence example, each iteration persists session even after the run is resumed with restoredSession. On the second and later iterations this can save an outdated session snapshot paired with a newer continuation token, causing state drift when restoring after interruptions. The persisted session should be the same session instance used for the latest RunAsync call.

Useful? React with 👍 / 👎.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the .NET Microsoft Agent Framework skill package metadata and refreshes the “Agent Background Responses” reference doc to reflect newer samples and guidance around continuation tokens, streaming resumption, and tool/state persistence.

Changes:

  • Bump skill version from 1.4.0 to 1.4.1.
  • Update background responses doc metadata date and sample link, and revise C# examples (client setup, polling, streaming resumption).
  • Add a new section describing background responses with function tools and session/state persistence, plus updated best practices/limitations notes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
skills/dotnet-microsoft-agent-framework/SKILL.md Version bump for the skill package.
skills/dotnet-microsoft-agent-framework/references/official-docs/user-guide/agents/agent-background-responses.md Refreshes background responses documentation, examples, and adds tools/persistence guidance.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +60 to +62
new Uri(endpoint),
new DefaultAzureCredential())
.GetResponsesClient(deploymentName)
Comment on lines +67 to +73
AgentSession session = await agent.CreateSessionAsync();

// Get initial response - may return with or without a continuation token
AgentResponse response = await agent.RunAsync("Write a very long novel about otters in space.", thread, options);
AgentResponse response = await agent.RunAsync("Write a very long novel about otters in space.", session, options);

// Continue to poll until the final response is received
while (response.ContinuationToken is not null)
while (response.ContinuationToken is { } token)
Comment on lines +170 to +171
options.ContinuationToken = continuationToken;
response = await agent.RunAsync(restoredSession, options);

- Background responses are dependent on the underlying AI service supporting long-running operations
- Not all agent types may support background responses
- Currently only agents using the OpenAI Responses API (`GetResponsesClient`) support background responses
…p SKILL.md to 1.5.1

Co-authored-by: KSemenenko <4385716+KSemenenko@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 17, 2026

@copilot resolve conflict

Resolved in ba9cbea. SKILL.md now incorporates the AgentWorkflowBuilder additions merged from main, with version bumped to 1.5.1.

@KSemenenko
Copy link
Member

@copilot resolve conflicts

@KSemenenko
Copy link
Member

@codex resolve conflicts

@chatgpt-codex-connector
Copy link

Summary

Testing

  • curl -L --max-time 30 'https://learn.microsoft.com/agent-framework/user-guide/agents/agent-background-responses?tabs=csharp' | rg -n "CreateSessionAsync|AgentSession|GetResponsesClient|GetOpenAIResponseClient|update.Text.Length|DefaultAzureCredential|endpoint|deploymentName"
  • python3 -m py_compile scripts/generate_catalog.py
  • python3 scripts/generate_catalog.py --validate-only

View task →

@KSemenenko KSemenenko merged commit 878d381 into main Mar 17, 2026
4 of 5 checks passed
@KSemenenko KSemenenko deleted the copilot/update-agent-background-responses-docs branch March 17, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upstream update: learn.microsoft.comagent-framework/user-guide/agents/agent-background-responses documentation documentation changed

3 participants