Skip to content

Add error recovery hooks and PyInstaller frozen build recipes#1388

Open
tilakpatell wants to merge 2 commits intogithub:stagedfrom
tilakpatell:staged
Open

Add error recovery hooks and PyInstaller frozen build recipes#1388
tilakpatell wants to merge 2 commits intogithub:stagedfrom
tilakpatell:staged

Conversation

@tilakpatell
Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Contributor

@aaronpowell aaronpowell left a comment

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
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