Repository navigation
Commit 606eba1
committed
fix(codebuddy_intl): 补首条 system prompt,国际站 11128 修复
国际站网关硬性要求 messages[0] 是 system prompt,否则整单
400 + {"code":11128,"msg":"first message is not system prompt"}。
国内站无此要求,存量凭证不带 system 也正常出站。
2026-10-12 用真实国际站凭证对照实测(同请求体):
无 system -> 400 / 11128
前置中性 system -> 200
现象链(usage_events 与日志时间戳逐秒对齐):
上游 400 -> executor 判 kind=request 换号 -> 国际站池里只有 1 条凭证
-> 轮换立即耗尽 -> 503 no_healthy_credential -> 前端显示「无可用凭证」。
gpt-5.6-luna 三次失败(17:38:40 / 18:06:02 / 18:47:10)与同秒的
11128 日志完全对应;deepseek-v4.1-flash 当时能通是因为那几次请求自带
system。所以「无可用凭证」与「渠道风控」是同一 bug 的两张脸,不是翻墙
问题(国际站出口本身在境外,gpt-5.6-sol / 5.5 / luna 实测全部 200)。
改动:
- client: 新增 ensure_leading_system() 与 DEFAULT_LEADING_SYSTEM;
构造参数 require_leading_system(默认关)
- main: 仅国际站装配时置 require_leading_system=True;国内站出站 body
一个字节不变(挡住「为让国际站通而全局注入」)
三条约束:
1. 判首条必须在 developer->system 归一之后(PI 等客户端把 system 转成
developer,归一已满足要求,再补就成了重复首条)
2. 客户端自带 system 时不注入、不覆盖、不重排(system 正文与位置是
客户端的意图)
3. 正文取中性最小句且不带厂商指纹,否则撞 11128 内容风控
注入只改 deepcopy 出的出站副本,不穿透 request.raw(会话粘性按原文
算指纹,穿透会让粘性静默失效)。
测试 +15:国际站补/不补各形态(含 developer 归一不重复)、国内站出站
body 不变、注入不穿透、不可用 message 形态一律不动、装配层两渠道开关
取值。行/分支覆盖率仍 100%(2381 passed)。
同步记入 TECHNICAL §3.17b 与 PROPOSAL Q76,并记下国际站签到实测报
「签到活动未开启或已过期」(路径存在,属账号侧活动未开启,不改代码)。1 parent a7ee8c8 commit 606eba1
6 files changed
Lines changed: 191 additions & 5 deletions
File tree
- src
- provider/codebuddy
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
| 588 | + | |
| 589 | + | |
588 | 590 | | |
589 | 591 | | |
| 592 | + | |
| 593 | + | |
590 | 594 | | |
591 | 595 | | |
592 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
56 | 82 | | |
57 | 83 | | |
58 | 84 | | |
| |||
162 | 188 | | |
163 | 189 | | |
164 | 190 | | |
| 191 | + | |
165 | 192 | | |
166 | 193 | | |
167 | 194 | | |
168 | 195 | | |
169 | 196 | | |
170 | 197 | | |
| 198 | + | |
171 | 199 | | |
172 | 200 | | |
173 | 201 | | |
| |||
209 | 237 | | |
210 | 238 | | |
211 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
212 | 245 | | |
213 | 246 | | |
214 | 247 | | |
| |||
0 commit comments