Skip to content

Fix: Provider github copilot cannot create session#1849

Open
gaaralbakuu wants to merge 7 commits intosipeed:mainfrom
gaaralbakuu:main
Open

Fix: Provider github copilot cannot create session#1849
gaaralbakuu wants to merge 7 commits intosipeed:mainfrom
gaaralbakuu:main

Conversation

@gaaralbakuu
Copy link

@gaaralbakuu gaaralbakuu commented Mar 21, 2026

📝 Description

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

📚 Technical Context (Skip for Docs)

  • Reference URL:
  • Reasoning:

🧪 Test Environment

  • Hardware:
  • OS:
  • Model/Provider:
  • Channels:

📸 Evidence (Optional)

Click to view Logs/Screenshots

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

Copilot AI review requested due to automatic review settings March 21, 2026 05:45
Copy link
Contributor

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

This PR addresses GitHub Copilot provider session creation failures by adding a permission request handler when creating the Copilot SDK session.

Changes:

  • Configure Copilot session creation to auto-handle permission requests via OnPermissionRequest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 43 to 47
session, err := client.CreateSession(context.Background(), &copilot.SessionConfig{
Model: model,
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Hooks: &copilot.SessionHooks{},
})
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

OnPermissionRequest: copilot.PermissionHandler.ApproveAll will automatically grant any permission request coming from the Copilot CLI. That changes the provider’s security posture (potentially allowing filesystem/network/tooling access without user confirmation) and can be surprising as a default. Consider making auto-approval explicitly opt-in via config/env (default deny/prompt), or scope the handler to only approve the specific permission(s) needed to create a session and reject everything else (ideally with logging).

Copilot uses AI. Check for mistakes.
@sipeed-bot sipeed-bot bot added type: bug Something isn't working domain: provider go Pull requests that update go code labels Mar 21, 2026
@CLAassistant
Copy link

CLAassistant commented Mar 21, 2026

CLA assistant check
All committers have signed the CLA.

Copilot AI review requested due to automatic review settings March 24, 2026 02:58
Copy link
Contributor

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

domain: provider go Pull requests that update go code type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants