msco-pi-lot

Microsoft Copilot provider extension for pi coding agent.

Package details

extension

Install msco-pi-lot from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:msco-pi-lot
Package
msco-pi-lot
Version
0.1.0
Published
Mar 23, 2026
Downloads
26/mo · 11/wk
Author
atomic-mg
License
MIT
Types
extension
Size
105.8 KB
Dependencies
2 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

msco-pi-lot

Microsoft Copilot provider extension for pi.

Install

Install directly from GitHub:

pi install https://github.com/atomic-reactor/msco-pi-lot

You can also pin a ref:

pi install https://github.com/atomic-reactor/msco-pi-lot@main

After install, restart pi and select the microsoft-copilot/copilot model.

For interactive use, log in once from inside pi:

/login microsoft-copilot

Paste your Microsoft Copilot access token when prompted. pi stores the credential in ~/.pi/agent/auth.json. You can remove it later with:

/logout microsoft-copilot

Configuration

Interactive login only supports pasting an access token. For headless or non-interactive use, you can still set Copilot credentials in your shell or in a local .env file next to the installed package:

MICROSOFT_COPILOT_ACCESS_TOKEN=
MICROSOFT_COPILOT_COOKIE=
MICROSOFT_COPILOT_CONVERSATION_ID=
MICROSOFT_COPILOT_CLIENT_SESSION_ID=
MICROSOFT_COPILOT_MODE=reasoning
MICROSOFT_COPILOT_TRACE=0
MICROSOFT_COPILOT_TRACE_FILE=logs/copilot-session.ndjson

Legacy COPILOT_* variable names are still accepted.

Only MICROSOFT_COPILOT_ACCESS_TOKEN is required. Cookie-based settings remain optional transport tweaks, not a login method.

Behavior

  • Registers one pi model: microsoft-copilot/copilot
  • Maps pi thinking levels to Copilot modes:
    • off, minimal, low -> smart
    • medium, high, xhigh -> reasoning
  • Bootstraps a Copilot conversation over HTTP when needed
  • Persists conversation state per pi session
  • Supports local tool use through a prompt-mediated tool loop
  • Uses Copilot server config to size prompts conservatively against the live maxTextMessageLength

Known Issues

  • This is still a basic integration. It gets Microsoft Copilot working inside pi, but it is not yet on par with a full agentic coding agent.
  • Microsoft Copilot will sometimes fail to respond at all. In those cases the request may stall or end without a useful answer, and retrying is often the only workaround.
  • Microsoft Copilot will sometimes behave as if it is running in a browser context. When that happens it may try to inspect browser tabs or page state that do not exist in pi, which can cause the response to stall or go off track.

Development

Install dependencies:

npm install

Run tests:

npm test

For local extension loading during development:

pi -e ./src/index.ts

Tracing

Enable websocket and bootstrap tracing with:

MICROSOFT_COPILOT_TRACE=1
MICROSOFT_COPILOT_TRACE_FILE=logs/copilot-session.ndjson

Trace output is masked, but you should still treat it as sensitive and keep it out of git.