Repository navigation
Done
Description
Summary
After Orca desktop on Windows auto-updated and restarted from 1.4.277 (daemon protocol v62) to 1.4.280 (daemon protocol v63), Pi (@earendil-works/pi-coding-agent 1.6.0) bot sessions with Orca-managed Notion MCP (https://mcp.notion.com/mcp) consistently end up with 0 Notion tools registered (searchTools("notion") returns []), even though:
orca bot tools --jsonreportsnotionassigned-inwithproblems: {},- Orca injects
- mcp__notion (codemode)into Pi's<mcp_servers>system prompt section viaorca-bot-tools.ts, and - Pi reaches the local
bot-tool-relayat startup and triggers an OAuth credential refresh on disk (~3 seconds after session start).
On the exact same machine and Orca 1.4.280 instance, Codex and Antigravity bot sessions using the exact same Notion MCP setup continue to work normally.
Reproduction Timeline (Windows, Orca 1.4.277 → 1.4.280)
| Time (CST / UTC+8) | Bot & Agent | Orca Version | Outcome |
|---|---|---|---|
| 2026-11-27 10:30 | bot-36 (Pi 1.6.0) |
1.4.277 (v62) |
Connected; created Notion DB and wrote 8 pages |
| 2026-11-28 07:00 | bot-35 (Pi 1.6.0) |
1.4.277 (v62) |
Connected; queried and updated Notion DB + uploaded images |
| 2026-11-28 09:56 | Orca daemon restart | 1.4.280 (v63) |
daemon.log: protocolVersion 62 → 63 |
| 2026-11-28 10:30 | bot-36 (Pi 1.6.0) |
1.4.280 (v63) |
0 Notion tools (searchTools("notion") === []) |
| 2026-11-28 10:51 | bot-21 (Codex) |
1.4.280 (v63) |
Connected & working normally |
| 2026-11-28 11:00 | notion (Pi 1.6.0) |
1.4.280 (v63) |
0 Notion tools (searchTools("notion") === []), also reproduced in a fresh Pi worker |
| 2026-11-28 11:19 | bot-2 (Antigravity) |
1.4.280 (v63) |
Connected & working (notion-get-self succeeded) |
Technical Observations
- Injection succeeds: In both failed Pi sessions (
bot-36at02:30:58Zandnotionat03:00:58Z), Pi's session.jsonlrecords<mcp_servers>... - mcp__notion (codemode)</mcp_servers>, confirmingorca-bot-tools.tsandORCA_PI_BOT_TOOLSexecuted. - Relay is reached and OAuth refreshes: Both bots' sealed credential files under
~/.orca/bot-tool-credentials/updated their mtimes at+3s(02:31:01Zand03:01:01Z), confirming Pi's@earendil-works/pi-mcpclient contacted Orca's localbot-tool-relayand passed relay auth. - Zero tools registered & silent failure in chat: Calling
searchTools("notion")in Pi'scodemodereturns[]in 0.1s (ALL_TOOLScontains only built-in/extension tools, zeromcp__notion__*entries). Meanwhileorca bot tools --jsonshowssignIn.state: "signed-in"andproblems: {}, and Pi's startupctx.ui.notifywarning is not surfaced in Orca chat (related to feat(pi): draw extension notify, setStatus and setWidget in the chat #45081), so the bot cannot see the underlying transport error. - Possible regression area: Between
1.4.277and1.4.280,bot-tool-relaychanged request/response header forwarding (fix(tools): agent tool relay forwards every header except hop-by-hop and its own credentials #49535, forwarding Nodeundiciheaders such asuser-agent: node,sec-fetch-mode: cors,accept-language: *that Pi sends viafetch(), unlike non-undici clients).
Environment
- OS: Windows (Orca desktop
1.4.280) - Pi:
@earendil-works/pi-coding-agent1.6.0(unchanged since2026-11-20;~/.pi/agent/mcp.jsonempty) - MCP server: Notion official remote MCP (
https://mcp.notion.com/mcp) via Orca Bot Tools OAuth - Workaround: Switching affected bot automations from
pitocodexrestores Notion MCP immediately.
Metadata
Metadata
Assignees
Labels
No labels
Activity
nwparker commentedon Nov 28, 2026
Thanks for the report. One change between 1.4.279 and 1.4.280 touched how Orca's bot tool relay forwards HTTP headers to MCP servers, which is our main suspect, but we can't yet see which header trips Notion for Pi. Could you share:
relay,mcpornotionfrom the Pi bot's terminal or the Orca dev tools console (Ctrl/Cmd+Shift+I → Console) when the bot starts. Please redact any tokens.pi --version).ayisuplus commentedon Nov 28, 2026
Thanks for the quick look! Here are the details for all three items:
1. Codex / Claude on the same machine & same Notion connector
https://mcp.notion.com/mcp,ownbot tool,signIn: { state: "signed-in", limited: false }, unchanged):1.4.280, we ran one-shot Codex (gpt-6.2-sol) backfill runs inside the exact same two affected bots (冲浪-商机Notionand冲浪-开源notion). Both connected to Notion MCP on the first try using that exact connector, created a database / wrote 5 + 8 pages, and read them back cleanly.https://mcp.notion.com/mcpconnector both still see all Notion tools on1.4.280.2. Logs (
relay/mcp/notion) when the Pi bot startsWe re-triggered a fresh Pi bot run on
1.4.280right after an Orca restart (2026-11-28T13:03:45Z):- mcp__notion (codemode)(confirmingorca-bot-tools.tsregistered the server), yetsearchTools('notion')returned[](0 Notion tools out of 17 total tools).orca bot tools --bot <name> --jsonstill reported:{ "agent": "pi", "own": [{ "name": "notion", "detail": "https://mcp.notion.com/mcp", "remote": false, "signIn": { "state": "signed-in", "limited": false } }], "inherited": [], "problems": {} }"problems": {}— sobot-tool-relaydid not hit the401/403branch that populatesthis.problems(pointing to a non-401/403 status or an error beforerelayResponse).relay,mcp, ornotionappear in%APPDATA%\orca\logs\daemon.log,%APPDATA%\orca\logs\main.trace.ndjson, or~/.pi/acp.log. (Also, Orca's Pi RPC bridge appears to ignoreextension_ui_requestnotifyevents, so Pi'sMCP servers need attention: ...startup failure message is not persisted in the chat/session journal.)1.6.0(@earendil-works/pi-mcp1.6.0on Nodev24.22.3undiciglobalThis.fetch) sends to a local loopbackhttp://127.0.0.1:<port>/bot-tools/.../mcpendpoint:{ "host": "127.0.0.1:<port>", "connection": "keep-alive", "authorization": "Bearer [REDACTED]", "accept": "application/json, text/event-stream", "content-type": "application/json", "accept-language": "*", "sec-fetch-mode": "cors", "user-agent": "node", "accept-encoding": "gzip, deflate", "content-length": "151" }bot-tool-relay's denylist (host,connection,content-length,expect,accept-encoding,authorization,cookie), the three headers forwarded for Pi that Codex doesn't send aresec-fetch-mode: cors,accept-language: *, anduser-agent: node.Ctrl+Shift+I) yet — if you still need the live[bot-tool-relay]console output when the Pi bot starts, let me know and I'll grab and paste it redacted.)3. Pi version
pi --version:1.6.0(@earendil-works/pi-coding-agent1.6.0,@earendil-works/pi-mcp1.6.0)v24.22.3· OS: Windows · Orca:1.4.280nwparker commentedon Nov 28, 2026
Thank you, the header comparison is extremely useful. The three Pi-only headers (
sec-fetch-mode: cors,accept-language: *,user-agent: node) are our lead:sec-fetch-*is browser fetch metadata, which a server-side relay shouldn't forward, and a server may treat it as a cross-origin browser request. Unauthenticated probes can't distinguish them (Notion returns 401 either way), so yes, please grab the live[bot-tool-relay]lines from the DevTools Console (Ctrl+Shift+I → Console, filterbot-tool-relay) while the Pi bot starts. The upstream status code or error there would confirm it. Redact any tokens.ayisuplus commentedon Nov 28, 2026
We opened DevTools (
Ctrl+Shift+I → Console, filteredbot-tool-relay) on packaged Windows Orca1.4.280and started a fresh chat on the affected Pi bot — nothing appeared in the renderer Console.Checking why it came up empty, there look to be two visibility gaps on packaged Windows builds:
console.warn("[bot-tool-relay] ...")runs in the main /orcadprocess (bot-tool-relay.ts), so the renderer DevTools Console doesn't receive those lines; andbot-tool-relay.tsonly logs on401/403/>=500anyway, so any other4xx(e.g.,400/406/415) passes through unlogged.McpHttpErrorstatus and body viactx.ui.notify("MCP servers need attention: ..."), which Orca's Pi RPC bridge drops (notifyis ignored alongsidesetStatus/setWidget/etc.), so it never reaches the chat UI or session log.(Side note:
withRelayProblemsinbot-launch-tools.tsonly attachesbotToolRelay.lastProblem(...)whenout[server.name]is already present, which may also explain whyorca bot tools --jsonstayed"problems": {}.)If there's a flag or env var to dump main-process
orcad/bot-tool-relaylogs to a file on packaged Windows, let us know and we're happy to run a quick capture. Otherwise, strippingsec-fetch-*from the relay's forwarded headers sounds like the right fix regardless — happy to verify on Windows as soon as a build with that change ships!nwparker commentedon Nov 28, 2026
Thanks to your header comparison we found it: Pi's Node fetch sends
sec-fetch-mode: cors, Orca's tool relay forwarded it since 1.4.280, and Electron's fetch rejects a CORS-mode request with no origin. The relay then answered 502, so Pi registered 0 tools. #51894 strips those browser-only headers before forwarding. Once it ships, could you confirm your Pi bots see the Notion tools again?fix(bots): stop the tool relay forwarding Sec-Fetch-* headers upstream (
nwparker commentedon Dec 1, 2026
Closing as completed — verified on
origin/main. PR #51894 (b3b282a) updatessendUpstreamin src/main/bots/tool-relay/bot-tool-relay-upstream.ts to stripsec-fetch-*headers (!name.startsWith('sec-fetch-')) onorigin/main, preventing Electron'snetfetch from rejecting Node/undiciSec-Fetch-Mode: corsMCP requests without anOriginheader from Pi bots.