Skip to content

feat(github-copilot): add example for running GitHub Copilot CLI in O… - #2053

Open
kinfey wants to merge 8 commits into
opensandbox-group:mainfrom
kinfey:main
Open

kinfey wants to merge 8 commits into
opensandbox-group:mainfrom
kinfey:main

Conversation

@kinfey

@kinfey kinfey commented Sep 29, 2026

Copy link
Copy Markdown

This pull request adds a new example for running the official GitHub Copilot CLI inside an OpenSandbox container. It includes a complete, well-documented workflow, a sample script, and supporting documentation to help users set up and run the Copilot CLI in an isolated environment.

New GitHub Copilot CLI Example in OpenSandbox:

Documentation and Usage Instructions

  • Added a detailed guide (docs/examples/github-copilot-cli-sandbox.md) explaining how to run the GitHub Copilot CLI inside a local OpenSandbox container, including prerequisites, environment variables, and security notes.
  • Added a short README (examples/github-copilot-cli-sandbox/README.md) pointing to the full documentation.

Example Implementation

  • Added a Python script (examples/github-copilot-cli-sandbox/main.py) that:
    • Loads environment variables and checks for a required GitHub token.
    • Connects to the local OpenSandbox server and creates a sandbox container.
    • Installs the Copilot CLI using the official installation script.
    • Runs a prompt non-interactively with copilot -sp and prints logs.
    • Cleans up the sandbox after execution.…penSandbox

Copilot AI balanced review requested due to automatic review settings September 29, 2026 02:25
@github-actions github-actions Bot added documentation Improvements or additions to documentation size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 29, 2026

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The documented setup contains failing commands, incorrect paths, and undiscoverable documentation.

Review effort: Balanced
Findings: 2 Medium severity · 4 Low severity

Open (6)
What changed in this PR

Adds a GitHub Copilot CLI example running inside an OpenSandbox container.

Changes:

  • Adds an asynchronous Python example with token handling and cleanup.
  • Documents local setup, configuration, and security guidance.
  • Adds a short example README.
File Description
examples/​github-copilot-cli-sandbox/​README.md Links to the full guide.
examples/​github-copilot-cli-sandbox/​main.py Creates a sandbox and runs Copilot CLI.
docs/​examples/​github-copilot-cli-sandbox.md Documents setup and usage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/examples/github-copilot-cli-sandbox.md
Comment thread docs/examples/github-copilot-cli-sandbox.md Outdated
Comment thread docs/examples/github-copilot-cli-sandbox.md
Comment thread docs/examples/github-copilot-cli-sandbox.md
Comment thread docs/examples/github-copilot-cli-sandbox.md
Comment thread examples/github-copilot-cli-sandbox/README.md

Copilot AI 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.

Comment thread docs/examples/github-copilot-cli-sandbox.md
Comment thread docs/examples/github-copilot-cli-sandbox.md
Comment thread docs/examples/microsoft-agent-framework.md
Comment thread docs/examples/microsoft-agent-framework.md Outdated
Comment thread docs/examples/microsoft-agent-framework.md Outdated
Comment thread docs/examples/microsoft-agent-framework.md
Comment thread docs/examples/microsoft-agent-framework.md
Comment thread examples/microsoft-agent-framework/main.py Outdated
Updated license comments to include warranty disclaimer.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Setup commands and links are broken, navigation entries are missing, and unrelated framework changes are outside the stated scope.

Review effort: Balanced
Findings: None

Resolved since last review (8)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Add project metadata or explicit dependency installation instructions

docs/​examples/​github-copilot-cli-sandbox.md:31

uv sync cannot prepare this example from the repository root because there is no root pyproject.toml or uv.lock, and this example has no manifest declaring opensandbox or python-dotenv. As written, the setup stops here (or the script later fails to import its dependencies); document explicit installs or add runnable project metadata.

This issue also appears in the following locations of the same file:

  • line 46
  • line 56
  • line 89
Low severity Link directly to the example source on GitHub

docs/​examples/​microsoft-agent-framework.md:128

Source-code links in docs are required to use full GitHub URLs, and this relative repository path will also resolve as a VitePress page rather than a browsable source directory. Link directly to the example directory on GitHub.

@kinfey kinfey left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

confirmed all

@jwx0925 jwx0925 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed ee84a61. Reproduced the documentation build failure and setup/path failures below. The Microsoft Agent Framework workflow passed a mock smoke test with the documented package versions; live Docker and model calls were not exercised.

Comment thread docs/examples/microsoft-agent-framework.md
Comment thread docs/examples/microsoft-agent-framework.md
Comment thread docs/examples/github-copilot-cli-sandbox.md Outdated
Comment thread docs/examples/microsoft-agent-framework.md
@github-actions github-actions Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 30, 2026
@kinfey

kinfey commented Sep 30, 2026

Copy link
Copy Markdown
Author

@jwx0925 please check it again

@kinfey
kinfey requested review from jwx0925 and a balanced review from Copilot September 30, 2026 08:52

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The documented Copilot setup is not currently runnable, links and navigation remain incorrect, and unrelated Microsoft example work conflicts with the stated scope.

Review effort: Balanced
Findings: 1 Medium severity · 5 Low severity

Open (6)

Comment on lines +1 to +3
# Microsoft Agent Framework Example

Run a general-purpose Microsoft Agent Framework agent with OpenSandbox.
Comment on lines +31 to +33
uv sync
uv run opensandbox-server init-config ~/.sandbox.toml --example docker
OPENSANDBOX_INSECURE_SERVER=YES uv run opensandbox-server

- [GitHub Copilot CLI](https://github.com/github/copilot-cli)
- [GitHub Copilot CLI quickstart](https://docs.github.com/en/copilot/get-started/cli-quickstart)
- [Source code](https://github.com/opensandbox-group/OpenSandbox/tree/main/examples/github-copilot)
Comment on lines +47 to +48
unrelated integrations. The Microsoft package proxy matches the package
source configured by the example project's `pyproject.toml`.
- [Microsoft Agent Framework Python samples](https://github.com/microsoft/agent-framework/tree/main/python/samples)
- [Functional workflow with agents](https://github.com/microsoft/agent-framework/blob/main/python/samples/01-get-started/05_functional_workflow_with_agents.py)
- [OpenSandbox](https://github.com/opensandbox-group/OpenSandbox)
- [Source code](../../examples/microsoft-agent-framework)

Run GitHub Copilot CLI in OpenSandbox.

> **Full documentation**: [docs/examples/github-copilot.md](../../docs/examples/github-copilot-cli-sandbox.md)

This branch has not been deployed

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

Labels

documentation Improvements or additions to documentation size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants