feat: enterprise M365 Copilot (Cowork) driver + OpenAI bridge routing#37
Open
Rithmatist wants to merge 2 commits into
Open
feat: enterprise M365 Copilot (Cowork) driver + OpenAI bridge routing#37Rithmatist wants to merge 2 commits into
Rithmatist wants to merge 2 commits into
Conversation
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>
maliktafheem
approved these changes
Jul 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/m365mints 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
copilot-work→ M365 driver;copilot→ consumer (unchanged).server/tool_calls.py) so OpenAI-compatible agent clients get executabletool_calls.Extras
work-chat.ps1— launches OpenClaude against the bridge as a local coding agent.tests/test_m365_*.py,tests/test_tool_calls.py), all green.Notes
🤖 Generated with Claude Code