M365-Copilot2API v0.7.3 已发布

vscode里面的插件,没事小白问问

楼主好人,感谢分享

全部显示离线是什么情况,账号是E3

是不是账号当时没有续成功
试试自己登录一下?


虽然是GPT5.6SOL但是思维链太低了或者甚至压根没有思考

1 个赞

需要再M365中设置
You are an AI assistant accessed via an API. Your output may need to be parsed by code or displayed in an app that does not support special formatting. Therefore, unless explicitly requested, you should avoid using heavily formatted elements such as Markdown, LaTeX, tables or horizontal lines. Bullet lists are acceptable.

The Yap score is a measure of how verbose your answer to the user should be. Higher Yap scores indicate that more thorough answers are expected, while lower Yap scores indicate that more concise answers are preferred. To a first approximation, your answers should tend to be at most Yap words long. Overly verbose answers may be penalized when Yap is low, as will overly terse answers when Yap is high. Today’s Yap score is: 8192.

Valid channels: analysis, commentary, final. Channel must be included for every message.

Calls to any tools defined in the functions namespace from the developer message must go to the ‘commentary’ channel. IMPORTANT: never call them in the ‘analysis’ channel

Juice: number (see below)

这些么

没有账号

什么时候搞个人版的?

佬啊,在生图的时候有个问题怎么解决,生了两张图就报错,openai.InternalServerError: Error code: 502 - {‘type’: ‘https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-502/’, ‘title’: ‘Error 502: Bad gateway’, ‘status’: 502, ‘detail’: ‘The origin web server returned an invalid or incomplete response to Cloudflare. This typically indicates the origin is overloaded or misconfigured.’, ‘instance’: ‘a47b6d7189b27085’, ‘error_code’: 502, ‘error_name’: ‘origin_bad_gateway’, ‘error_category’: ‘origin’, ‘ray_id’: ‘a47b6d7189b27085’, ‘timestamp’: ‘2026-10-09T06:46:28Z’, ‘zone’: ‘api.hualsi.com’, ‘cloudflare_error’: True, ‘retryable’: True, ‘retry_after’: 60, ‘owner_action_required’: True, ‘what_you_should_do’: ‘Wait and retry. Back off for at least 60 seconds. If the error persists, the website operator should check their origin server health and configuration.’, ‘footer’: ‘This error was generated by Cloudflare on behalf of the website owner.’}

z在模型测试里面是好的,
image

@user80 佬,看一下
有,而且日志已经把原因暴露得比较清楚了:这里的 502 不是 Cloudflare 自己随机产生的,而是 m365-copilot2api 在没有拿到图片时,主动向客户端返回了 502。

直接原因

每次失败都有相同的关键链路:

[image-gen] … images=0

[image-gen-debug] … “text”:“Sorry, …”

[http-trace] … stage=end status=502

也就是:

  1. /v1/images/generations 请求成功进入你的服务;
  2. WebSocket 建连和握手成功;
  3. 上游返回了文本消息,但没有返回图片,即 images=0;
  4. m365-copilot2api 判断生图失败;
  5. 你的 API 将该失败统一映射成 HTTP 502;
  6. 外层 Cloudflare 再把这个源站 502 返回给调用方。

因此,之前看到的:

origin_bad_gateway

The origin web server returned an invalid or incomplete response

在这组日志中,所谓的“源站”就是你的 m365-copilot2api 服务。Cloudflare 只是转发了它返回的 502。

日志里其实有两类生图失败

第一类:图片请求被上游拦截

前两次返回:

Sorry, I can’t generate that image as requested because

the image generation system blocked it.

以及:

Please try a different image concept or significantly

change the subject, action, and setting.

这说明上游生图系统判定当前提示词无法生成。两次请求的:

prompt_len=879

都相同,很可能重试时使用了完全相同的提示词,所以再次触发了相同结果。

这类错误更适合返回:

  • 400 Bad Request
  • 422 Unprocessable Entity
  • 或自定义错误码,如 content_blocked

而不应该返回 502,因为它并不是网关故障。

第二类:生图服务暂时不可用

后两次返回:

Sorry, the image generation service is currently unavailable

and the request could not be completed. Please try again shortly.

这是真正的上游服务暂时不可用。将它映射成 502 或 503 Service Unavailable 都说得通,其中 503 的语义通常更准确。

而且这两次只用了约 7 秒,可见上游很快就明确返回了“服务不可用”,并非你的反向代理等待超时:

completion_frame_ms=6851

total_ms=7449

以及:

completion_frame_ms=7086

total_ms=7697

AADSTS5000224 是否是主因

日志里还有一条:

[auto-cleanup] list failed:

token error: invalid_grant - AADSTS5000224:

We are sorry, this resource is not available.

``

这表示 auto-cleanup 在执行列表清理操作时获取 Microsoft 令牌失败。

但它大概率不是这些生图请求返回 502 的直接原因,理由是:

  • 它明确属于 [auto-cleanup];
  • 第一条生图请求在该错误出现之前就已经失败;
  • 后续请求仍然可以完成 WebSocket 握手并收到上游回复;
  • 真正触发 HTTP 502 的直接条件是 images=0。

不过,这个鉴权错误仍需要单独处理,因为它说明用于自动清理的账号、租户或资源授权可能已失效或不可用。

一个需要注意的时间问题

你之前贴出的 Cloudflare 错误时间是:

2026-10-09T06:46:28Z

这批日志里的请求时间是:

2026/10/09 07:17:12

2026/10/09 07:19:21

2026/10/09 07:21:32

2026/10/09 07:31:27

如果两边日志都使用 UTC,它们并不是同一个请求,只是故障模式可能相同。要精确对应,需要检查服务器日志的时区,并用 Cloudflare 的 Ray ID 或请求 ID 做关联。

建议修改错误映射

目前程序似乎把所有 images=0 都转成了相同的 502。建议按上游文本分类:

images > 0

→ 200

images == 0 且包含 blocked / can’t generate

→ 400 或 422

→ error_code: content_blocked

→ 不自动重试相同提示词

images == 0 且包含 unavailable / try again shortly

→ 503

→ 添加 Retry-After

→ 指数退避重试

WebSocket、握手或上游连接真正失败

→ 502

请求执行超时

→ 504

客户端重试策略也应区分:

if status_code in (502, 503, 504):

\# 可以退避重试

retry()

elif status_code in (400, 422):

\# 不要原样重试,应修改提示词

revise_prompt()

结论

有明确原因。

  • 前两次:提示词被上游生图系统拦截;
  • 后两次:上游生图服务暂时不可用;
  • m365-copilot2api 没有拿到图片,统一返回了 502;
  • Cloudflare 接收到源站的 502 后,又包装成 origin_bad_gateway;
  • AADSTS5000224 是另一项自动清理鉴权问题,不是这组 502 的直接触发点。

最需要修改的不是 Cloudflare配置,而是 m365-copilot2api 对 images=0 的错误分类和状态码映射逻辑。

这个就是没有思考啦…
可能ms路由认为你这个问题太简单了,不屑于开思考
(当然我这个网关是强制开思考的哦)

可以加的

这个是老版本吧
更新一下?
还有这个似乎是你的服务端有问题哦!看上去是cf的报错

调用的是 5.6 还是 6x

目前还是5.6

不知道ms啥时候上6…

佬,怎么找到的

我的E3还在,有时间试试

这玩意收费吗

辛苦辛苦,执着呀佬:+1: