Skip to content

Document missing PR #162 CopilotSession APIs in advanced guide#166

Merged
brunoborges merged 2 commits intomainfrom
copilot/add-documentation-for-new-methods
Mar 3, 2026
Merged

Document missing PR #162 CopilotSession APIs in advanced guide#166
brunoborges merged 2 commits intomainfrom
copilot/add-documentation-for-new-methods

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

PR #162 introduced new CopilotSession capabilities, but the site docs did not cover key runtime APIs for agent control and explicit compaction. This PR closes that gap by adding focused guidance where users already look for advanced session behavior.

  • Documentation gap addressed

    • Added coverage for CopilotSession.compact() in Infinite Sessions as a new Manual Compaction subsection.
    • Added coverage for custom-agent runtime APIs in Custom Agents as a new Programmatic Agent Selection subsection.
  • Navigation updates

    • Updated advanced.md table of contents with anchors for:
      • Manual Compaction
      • Programmatic Agent Selection
  • What’s now documented (new methods)

    • session.compact()
    • session.listAgents()
    • session.getCurrentAgent()
    • session.selectAgent(String)
    • session.deselectAgent()
var available = session.listAgents().get();

var current = session.getCurrentAgent().get();
if (current != null) {
    System.out.println("Current agent: " + current.name());
}

var selected = session.selectAgent("reviewer").get();
System.out.println("Selected: " + selected.name());

session.deselectAgent().get(); // Return to the default agent
session.compact().get();       // Trigger immediate compaction
Original prompt

This section details on the original issue you should resolve

<issue_title>PR #162 needs documentation</issue_title>
<issue_description>PR #162 added couple new methods. Make sure these are properly documented.</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for new methods in PR #162 Document missing PR #162 CopilotSession APIs in advanced guide Mar 3, 2026
@brunoborges brunoborges marked this pull request as ready for review March 3, 2026 18:42
@brunoborges brunoborges requested a review from edburns as a code owner March 3, 2026 18:42
@brunoborges brunoborges merged commit 0127bec into main Mar 3, 2026
6 checks passed
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.

PR #162 needs documentation

3 participants