Skip to content

Add error recovery hooks and PyInstaller frozen build recipes - #1388

Merged
aaronpowell merged 2 commits into
github:stagedfrom
tilakpatell:staged
Apr 28, 2026
Merged

aaronpowell merged 2 commits into
github:stagedfrom
tilakpatell:staged

Conversation

@tilakpatell

Copy link
Copy Markdown
Contributor

Pull Request Checklist


Description

Adds two new Python cookbook recipes for the Copilot SDK:

  • Error Recovery Hooks — Uses the SDK's on_post_tool_use and on_error_occurred hooks to classify tool failures (shell errors, permission denials, transient/non-recoverable SDK errors) and append continuation instructions so the LLM keeps investigating instead of giving up.
  • PyInstaller Frozen Build — Shows how to package a Copilot SDK app into a standalone executable with PyInstaller or Nuitka, handling CLI binary resolution via _MEIPASS, SSL certificate injection with certifi, and restoring execute permissions on Unix.

Each recipe includes a markdown write-up (cookbook/copilot-sdk/python/) and a runnable example (cookbook/copilot-sdk/python/recipe/). Both READMEs are updated accordingly.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • Update to existing instruction, prompt, agent, plugin, skill, or workflow.
  • Other (please specify): New Copilot SDK cookbook recipes (markdown + runnable Python examples)

Additional Notes

Files added:

  • cookbook/copilot-sdk/python/error-recovery-hooks.md
  • cookbook/copilot-sdk/python/recipe/error_recovery_hooks.py
  • cookbook/copilot-sdk/python/pyinstaller-frozen-build.md
  • cookbook/copilot-sdk/python/recipe/pyinstaller_frozen_build.py

Files updated:

  • cookbook/copilot-sdk/python/README.md
  • cookbook/copilot-sdk/python/recipe/README.md

By submitting this pull request, I confirm that my contribution abides by the [Code of Conduct](../CODE_OF_CONDUCT.md) and will be licensed under the MIT License.

@aaronpowell aaronpowell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor spelling issue with datas in one of the markdown files. Either change it to data or if it has to be datas then we'll need to update the codespell file to allow it.

@tilakpatell
tilakpatell requested a review from aaronpowell April 14, 2026 01:02
@aaronpowell
aaronpowell merged commit 5f69546 into github:staged Apr 28, 2026
8 checks passed
@tilakpatell
tilakpatell deleted the staged branch April 28, 2026 02:09
fizznix pushed a commit to fizznix/awesome-copilot that referenced this pull request Apr 29, 2026
…#1388)

* Add error recovery hooks and PyInstaller frozen build recipes

* fixed datas to data
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