Skip to content

Track official SDK PR #427: Add session context, filtering, and context_changed event#6

Merged
kawax merged 4 commits intomainfrom
copilot/update-official-sdk
Feb 14, 2026
Merged

Track official SDK PR #427: Add session context, filtering, and context_changed event#6
kawax merged 4 commits intomainfrom
copilot/update-official-sdk

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

Ports changes from official SDK PR #427 adding session context tracking and filtering capabilities.

Changes

New Types

  • SessionContext - Working directory and Git metadata (cwd, gitRoot, repository, branch)
  • SessionListFilter - Filter criteria for session listing

Updated Types

  • SessionMetadata.context - Optional session context field
  • SessionEventType::SESSION_CONTEXT_CHANGED - Event for directory changes during session

API Changes

  • Client::listSessions() - Now accepts optional SessionListFilter|array|null parameter
  • CopilotClient interface updated to match

Usage

use Revolution\Copilot\Facades\Copilot;

// Filter sessions by repository
$sessions = Copilot::client()->listSessions(['repository' => 'owner/repo']);

// Access context information
foreach ($sessions as $metadata) {
    if ($metadata->context) {
        echo "{$metadata->context->repository} @ {$metadata->context->branch}\n";
    }
}

// Handle context changes
$session->on(function ($event) {
    if ($event->type === 'session.context_changed') {
        // Context changed during session
    }
});

Compatibility

  • Requires Copilot CLI v0.0.409+ for context fields
  • Fully backward compatible - filter parameter and context field are optional
  • Maintains parity with official SDK implementations (Node.js, Python, Go, .NET)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/copilot_internal/user
    • Triggering command: /home/REDACTED/.local/bin/copilot copilot --headless --stdio --log-level info /usr/lib/git-core/git-submodule stty /bin/stty (http block)
    • Triggering command: /home/REDACTED/.local/bin/copilot copilot --headless --stdio --log-level info (http block)
    • Triggering command: /home/REDACTED/.local/bin/copilot copilot --headless --stdio --log-level info /bin/stty stty de/node/bin/stty (http block)
  • https://api.github.com/repos/github/copilot-sdk/pulls/427
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 14, 2026 03:53
…iltering

Co-authored-by: kawax <1502086+kawax@users.noreply.github.com>
…context field

Co-authored-by: kawax <1502086+kawax@users.noreply.github.com>
… event

Co-authored-by: kawax <1502086+kawax@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to follow official SDK changes Track official SDK PR #427: Add session context, filtering, and context_changed event Feb 14, 2026
Copilot AI requested a review from kawax February 14, 2026 04:08
@kawax kawax marked this pull request as ready for review February 14, 2026 04:09
@kawax kawax merged commit ed214c4 into main Feb 14, 2026
5 checks passed
@kawax kawax deleted the copilot/update-official-sdk branch February 14, 2026 04:10
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.

2 participants