Require onPermissionRequest handler, auto-inject via CopilotManager#10
Merged
Require onPermissionRequest handler, auto-inject via CopilotManager#10
Conversation
- Client.createSession() and resumeSession() now require onPermissionRequest
(matching official SDK PR #554)
- CopilotManager auto-injects PermissionHandler::approveAll() based on
config('copilot.permission_approve') setting (default: true)
- Added permission_approve config option to config/copilot.php
- Updated CopilotClient contract to remove default params
- Updated docs/jp/permission-request.md documentation
- Added tests for missing permission handler validation
- Updated existing tests to provide onPermissionRequest handler
Co-authored-by: kawax <1502086+kawax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update permission request handling in SDK
Require onPermissionRequest handler, auto-inject via CopilotManager
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows official SDK PRs #554 and #555 — makes
onPermissionRequestmandatory on session creation/resume. To avoid burdening Laravel users who callCopilot::run()/Copilot::start(), the Manager auto-injectsPermissionHandler::approveAll()by default.Changes
Client.createSession()/resumeSession()— config param is now required (no default), throwsInvalidArgumentExceptionifonPermissionRequestis missing. Always callsregisterPermissionHandler()unconditionally.CopilotClientcontract — removed= []defaults fromcreateSessionandresumeSessionsignaturesCopilotManager— newensurePermissionHandler()injectsPermissionHandler::approveAll()when handler is absent andconfig('copilot.permission_approve')is trueconfig/copilot.php— addedpermission_approveoption (defaulttrueviaCOPILOT_PERMISSION_APPROVEenv)docs/jp/permission-request.md— rewritten to reflect auto-approve default, direct Client usage requirement, andcustom-toolpermission kind from PR #555Usage
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/home/REDACTED/.local/bin/copilot copilot --headless --stdio --log-level info(http block)/home/REDACTED/.local/bin/copilot copilot --headless --stdio --log-level info ash stty n/stty(http block)/home/REDACTED/.local/bin/copilot copilot --headless --stdio --log-level info pilot-sdk/vendor/bin/stty stty ndor/bin/stty(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 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.