Skip to content

feat: enterprise M365 Copilot (Cowork) driver + OpenAI bridge routing#37

Open
Rithmatist wants to merge 2 commits into
sums001:masterfrom
Rithmatist:feat/m365-copilot-cowork
Open

feat: enterprise M365 Copilot (Cowork) driver + OpenAI bridge routing#37
Rithmatist wants to merge 2 commits into
sums001:masterfrom
Rithmatist:feat/m365-copilot-cowork

Conversation

@Rithmatist

Copy link
Copy Markdown

What

Adds a headless driver for work / school (Entra ID) accounts, which Microsoft redirects off consumer Copilot to the enterprise Microsoft 365 Copilot ("Cowork") — a different backend the existing driver can't speak.

copilot/m365 mints resource tokens via a public-client refresh-token grant (bootstrapped once interactively, then fully headless), sends prompts to the Copilot Studio "Aether" runtime, and reads the streamed reply off a Trouter (Teams Socket.IO) push channel after registering the endpoint. Reverse-engineered from live captures (tests/capture_*.py).

Server

  • New model copilot-work → M365 driver; copilot → consumer (unchanged).
  • Client title-generation meta-call answered locally (saves a full upstream turn).
  • Server binds instantly (dropped the blocking startup browser pre-warm).
  • Text tool-call bridging (server/tool_calls.py) so OpenAI-compatible agent clients get executable tool_calls.

Extras

  • work-chat.ps1 — launches OpenClaude against the bridge as a local coding agent.
  • New README section "Usage 3: Work / school account + coding agents".
  • 44 unit tests (tests/test_m365_*.py, tests/test_tool_calls.py), all green.

Notes

  • Work turns are slow (~20–60s each — the Cowork backend, not the bridge); the server serializes upstream calls.
  • Requires an M365 Copilot–licensed tenant that permits token-based access; some tenants block non-interactive tokens via conditional access.
  • No secrets committed: session tokens/logs are gitignored; test fixtures use placeholder GUIDs.

🤖 Generated with Claude Code

Rithmatist and others added 2 commits July 7, 2026 21:52
Work/school (Entra) accounts are redirected off consumer Copilot to the
enterprise M365 Copilot "Cowork" agent, which the existing driver can't
speak. Add copilot/m365: a headless driver that mints resource tokens via
a public-client refresh-token grant (bootstrapped once interactively),
sends prompts to the Copilot Studio "Aether" runtime, and reads the reply
off a Trouter (Teams Socket.IO) push channel after registering the
endpoint. Reverse-engineered from live captures (tests/capture_*.py).

Server: route model `copilot-work` -> M365 driver, `copilot` -> consumer;
short-circuit the client's title-gen meta-call; bind instantly (drop the
startup browser pre-warm); text tool-call bridging (server/tool_calls.py)
so OpenAI-compatible agent clients get executable tool_calls. work-chat.ps1
launches openclaude against the bridge. 44 unit tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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