Skip to content

[Bug] 决策模型协议 SystemOne 的 noul 类型请求未兼容标准格式 #10920

Closed

Description

@AlionSSS

问题描述

问题

TypeSafe 官方 SytemOne 协议文档指出 noul 类型的 Questions 需要添加 criteria
源码中 noul 类型判断,只有 instructions,没有 criteria,如下图

Image

导致部分兼容性协议没法调用。例如使用 书生端砚平台的 SytemOne 协议接口就会出问题,报错 400。

相关链接

建议的调用方式示例

  • curl 示例
curl https://discovery-api.intern-ai.org.cn/v1/systemone \
  --request POST \
  --header "Authorization: Bearer {{YOUR_API_KEY}}" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "{{MODEL}}",
    "state": {
      "message": "Please end my monthly plan after this billing period."
    },
    "questions": {
      "cancellation": {
        "type": "noul",
        "instructions": "Does the message explicitly request cancellation of a subscription?",
        "criteria": {
          "true": "",
          "false": ""
        }
      }
    }
  }'
  • 正常响应示例
HTTP/1.1 200 OK
content-type: application/json
traceparent: 00-5709a7df5bdb388b99ca863c013c7acb-1c73c23d5e5e60d1-01
x-request-id: req_8f59c1f8-0f07-4b8e-a9d6-b0071ace5a6c
date: Sun, 01 Nov 2026 06:35:51 GMT
content-length: 203
req-cost-time: 190
req-arrive-time: 1793514951395
resp-start-time: 1793514951585
x-envoy-upstream-service-time: 189
server: istio-envoy
connection: close

{
  "answers": {
    "cancellation": {
      "type": "noul",
      "noul": 0.7318060918170457
    }
  },
  "model": "intern-decision-4b",
  "request_id": "req_8f59c1f8-0f07-4b8e-a9d6-b0071ace5a6c",
  "usage": {
    "input_tokens": 179,
    "output_tokens": 12
  }
}
  • 若未带 criteria 的响应示例
HTTP/1.1 400 Bad Request
content-type: application/json; charset=utf-8
traceparent: 00-96baa35be27b7214c7243fae0221be8c-3347ad43fad4bd97-01
x-request-id: req_9307344d-b58f-4d3d-ad80-0f8478c47a47
date: Sun, 01 Nov 2026 06:49:30 GMT
content-length: 286
req-cost-time: 5
req-arrive-time: 1793515770188
resp-start-time: 1793515770194
x-envoy-upstream-service-time: 5
server: istio-envoy
connection: close

{
  "error": {
    "message": "question \"cancellation\" field `criteria` must be an object with `true`/`false` keys",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request_error",
    "trace_id": "96baa35be27b7214c7243fae0221be8c"
  },
  "request_id": "req_9307344d-b58f-4d3d-ad80-0f8478c47a47"
}

如何复现?

在模型提供商页面,选判断,填好模型,点击测试会报错 400

Image

AstrBot 版本

v4.29.4

操作系统

Windows

部署方式

Windows 桌面,使用 uv 部署

使用的消息平台适配器

onebot v11

错误日志

[14:32:43.352] [Core] [ERRO] [v4.29.4] [sources.system_one_decision_source:194]: [System One Decision] HTTP 400 from https://discovery-api.intern-ai.org.cn/v1/systemone
[14:34:06.733] [Core] [ERRO] [v4.29.4] [sources.system_one_decision_source:194]: [System One Decision] HTTP 400 from https://discovery-api.intern-ai.org.cn/v1/systemone
[14:34:13.746] [Core] [ERRO] [v4.29.4] [sources.system_one_decision_source:194]: [System One Decision] HTTP 400 from https://discovery-api.intern-ai.org.cn/v1/systemone

辅助信息

No response

检查清单

  • 我已在 Issue 列表中搜索过相关问题仍无法解决,或该问题从未被报告过。
  • 我已尝试过禁用所有插件,排除了可能是因插件导致的问题。
  • 我报告的问题与 AstrBot 本体相关,而非在报告某一插件的问题。
  • 我已阅读并同意本项目的贡献者行为准则。
  • (可选)我愿意提交 PR 以帮助修复该问题。

Activity

  1. added
    bug
    on Nov 1, 2026
  2. dosubot commented on Nov 1, 2026

    @dosubot

    你好 @AlionSSS!我是 Dosu,正在协助 AstrBotTeam 团队。

    请求构造确实缺少 criteria:SystemOneDecisionProvider.ask() 的 noul 分支只发送 type 和 instructions,现有测试也将不含 criteria 的请求作为预期结果。[1] [2]

    不过,TypeSafe 当前文档将 criteria 描述为 object | null,未标为必填,并给出了省略该字段的 noul 示例。因此更准确的定位是与书生端砚接口的兼容性差异,而不能直接认定所有 SystemOne 接口都要求它。[3]

    建议修复方向:先按你提供的成功请求,在 noul 分支补充 "criteria": {"true": "", "false": ""},并同步更新请求体测试。当前 DecisionBooleanQuestion 也只有 instructions 字段,如果后续需要自定义是非判据,还需扩展该数据模型。[1] [2] [4]

    另一个需要区分的点:你贴出的 400 文案是 JSON 语法解析错误,并非明确的“缺少 criteria”。复测时应保证删去 criteria 后没有留下尾逗号,这样才能排除 JSON 格式本身的影响。

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about AstrBot with Dosu Add Dosu to your team

  3. AlionSSS commented on Nov 1, 2026

    @AlionSSS
    Author

    2. 你好 @AlionSSS!我是 Dosu,正在协助 AstrBotTeam 团队。
    请求构造确实缺少 criteria:SystemOneDecisionProvider.ask() 的 noul 分支只发送 type 和 instructions,现有测试也将不含 criteria 的请求作为预期结果。[1] [2]
    不过,TypeSafe 当前文档将 criteria 描述为 object | null,未标为必填,并给出了省略该字段的 noul 示例。因此更准确的定位是与书生端砚接口的兼容性差异,而不能直接认定所有 SystemOne 接口都要求它。[3]
    建议修复方向:先按你提供的成功请求,在 noul 分支补充 "criteria": {"true": "", "false": ""},并同步更新请求体测试。当前 DecisionBooleanQuestion 也只有 instructions 字段,如果后续需要自定义是非判据,还需扩展该数据模型。[1] [2] [4]
    另一个需要区分的点:你贴出的 400 文案是 JSON 语法解析错误,并非明确的“缺少 criteria”。复测时应保证删去 criteria 后没有留下尾逗号,这样才能排除 JSON 格式本身的影响。

    _To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=AstrBotDevs%2FAstrBot)._
    
    Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=AstrBotDevs%2FAstrBot).
    [![Leave Feedback](https://camo.githubusercontent.com/36dab98b8d4c28691f39c02dac135dc55eafb15d1194cd4c3280d181fde2f178/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c65617665253230466565646261636b2d3535353535353f7374796c653d666c6174)](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=AstrBotDevs%2FAstrBot&message_id=099552f6-f5f2-4166-9891-702cc8408e26) [![Learn about AstrBot with Dosu](https://camo.githubusercontent.com/7c4ba5625906bd85630368a904030afa597cd3d4f37bb2639ebfa46729897ef3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6561726e25323061626f757425323041737472426f7425323077697468253230446f73752d3266376233663f7374796c653d666c6174266c6f676f3d64617461253341696d616765253246737667253242786d6c25334262617365363425324350484e325a79423361575230614430694f4459694947686c6157646f644430694f446b6949485a705a58644362336739496a41674d4341344e6941344f5349675a6d6c7362443069626d39755a53496765473173626e4d39496d6830644841364c79393364336375647a4d7562334a6e4c7a49774d44417663335a6e496a3438634746306143426b50534a4e4e5334794f54497a4e6941784d6934334f544934544445334c6a63314f544d674e6934324f4445344f4659334d6934314e6a5933544455754d6a6b794d7a59674f4451754d4459784f4659784d6934334f544934576949675a6d6c736244306949304930516b49354d534976506a78775958526f49475139496b30784f4334794e5463314944637a4c6a45784f545a4d4e546b754d544d794f5341334d6934334e44684d4e5445754e7a41784d5341344d6934304d446b31544449354c6a417a4d7a67674f4459754d6a6b78544459754d6a4d354e6a49674f4455754d5455314e4577784f4334794e5463314944637a4c6a45784f545a614969426d615778735053496a4e7a63344e54597849693825324250484268644767675a443069545445334c6a51354d5459674d7934334d7a597a4d30777a4c6a55344e545533494445794c6a63774f546c574f444d754e5463354d6b4d7a4c6a55344e545533494467304c6a63314e4449674e4334354f4455324d7941344e53347a4e6a5579494455754f4451334d4455674f4451754e545932544445354c6a59794f5459674e7a45754e7a67774d534967633352796232746c50534a696247466a61794967633352796232746c4c5864705a48526f505349324c6a51794f4451304969427a64484a766132557462476c755a574e6863443069636d3931626d51694c7a34386257467a617942705a4430695a47397a6453316b4c574e3164473931644349675a6d6c73624430696432687064475569506a78775958526f49475a7062477774636e56735a5430695a585a6c626d396b5a43496759327870634331796457786c50534a6c646d56756232526b4969426b50534a4e4e4441754e7a4130494441754e5445344d445932534445334c6a41304d7a6c574e7a59754d6a49794d5567304d4334334d4452494e4449754e5467774e5567304e7934344d44457a517a59344c6a63774e6a51674e7a59754d6a49794d5341344e5334324e544d7a494455354c6a49334e5449674f4455754e6a557a4d79417a4f43347a4e7a4178517a67314c6a59314d7a4d674d5463754e445931494459344c6a63774e6a4d674d4334314d5467774e6a59674e4463754f4441784d7941774c6a55784f4441324e6b67304d6934314f444131534451774c6a63774e466f694c7a34384c32316863327325324250484268644767675a6d6c73624331796457786c50534a6c646d56756232526b4969426a62476c774c584a3162475539496d56325a5735765a47516949475139496b30304d4334334d4451674d4334314d5467774e6a5a494d5463754d44517a4f5659334e6934794d6a4978534451774c6a63774e4567304d6934314f444131534451334c6a67774d544e444e6a67754e7a41324e4341334e6934794d6a4978494467314c6a59314d7a4d674e546b754d6a63314d6941344e5334324e544d7a49444d344c6a4d334d4446444f4455754e6a557a4d7941784e7934304e6a55674e6a67754e7a41324d7941774c6a55784f4441324e6941304e7934344d44457a494441754e5445344d445932534451794c6a55344d4456494e4441754e7a4130576949675a6d6c73624430694930597a526a5a474d534976506a78775958526f49475139496b30784e7934774e444d35494441754e5445344d445932566930324c6a55334f54453553446b754f5451324e6a6c574d4334314d5467774e6a5a494d5463754d44517a4f56704e4d5463754d44517a4f5341334e6934794d6a497853446b754f5451324e6a6c574f444d754d7a45354e4567784e7934774e444d35566a63324c6a49794d6a4661545445334c6a41304d7a6b674e7934324d54557a4d6b67304d4334334d4452574c5459754e5463354d546c494d5463754d44517a4f5659334c6a59784e544d79576b30794e4334784e444579494463324c6a49794d6a46574d4334314d5467774e6a5a494f5334354e4459324f5659334e6934794d6a4978534449304c6a45304d544a61545451774c6a63774e4341324f5334784d6a5135534445334c6a41304d7a6c574f444d754d7a45354e4567304d4334334d4452574e6a6b754d5449304f56704e4e4449754e5467774e5341324f5334784d6a5135534451774c6a63774e4659344d79347a4d546b30534451794c6a55344d4456574e6a6b754d5449304f56704e4e4463754f4441784d7941324f5334784d6a5135534451794c6a55344d4456574f444d754d7a45354e4567304e7934344d44457a566a59354c6a45794e446c61545463344c6a55314e69417a4f43347a4e7a4178517a63344c6a55314e6941314e53347a4e545531494459304c6a63344e6a63674e6a6b754d5449304f5341304e7934344d44457a494459354c6a45794e446c574f444d754d7a45354e454d334d6934324d6a59784944677a4c6a4d784f5451674f5449754e7a55774e5341324d7934784f54513549446b794c6a63314d4455674d7a67754d7a63774d5567334f4334314e545a61545451334c6a67774d544d674e7934324d54557a4d6b4d324e4334334f445932494463754e6a45314d7a49674e7a67754e545532494449784c6a4d344e4463674e7a67754e54553249444d344c6a4d334d4446494f5449754e7a55774e554d354d6934334e5441314944457a4c6a55304e544d674e7a49754e6a4932494330324c6a55334f544535494451334c6a67774d544d674c5459754e5463354d546c574e7934324d54557a4d6c704e4e4449754e5467774e5341334c6a59784e544d79534451334c6a67774d544e574c5459754e5463354d546c494e4449754e5467774e5659334c6a59784e544d79576b30304d4334334d4451674e7934324d54557a4d6b67304d6934314f444131566930324c6a55334f544535534451774c6a63774e4659334c6a59784e544d79576949675a6d6c7362443069596d7868593273694947316863327339496e56796243676a5a47397a6453316b4c574e316447393164436b694c7a3438634746306143426b50534a4e4e6a67754f5449784e53417a4e6934774d544d31517a59344c6a6b794d5455674d7a59754d44457a4e5341324e5334334d7a5935494451354c6a51334d7a67674e5445754e44497a4d5341304f5334304e7a4d34517a4d334c6a45774f544d674e446b754e44637a4f43417a4d6934314e7a673349444d334c6a4d314f5459674d7a49754e5463344e79417a4e6934774d544d314969427a64484a7661325539496d4a7359574e724969427a64484a766132557464326c6b64476739496a63754e6a6b784e6a456949484e30636d39725a5331736157356c5932467750534a79623356755a434967633352796232746c4c577870626d567162326c7550534a79623356755a434976506a78775958526f49475139496b30774c6a4d304f44597a4d7941344e5334304f545132517a41754d7a51344e6a4d7a494467314c6a51354e4459674d6a6b754e4467314e6941344e5334344d7a413549444d304c6a67774f5341344e5334324f5468444e4451754f444d7a4e7941344e5334304e446333494455784c6a49344e7a49674f4451754e444179494455334c6a55794e6a6b674e7a67754f5463794e454d324d6934344d544935494463304c6a4d334d6a63674e7a55754d544d304d6941314f5334324f444d32494463314c6a457a4e4449674e546b754e6a677a4e694967633352796232746c50534a696247466a61794967633352796232746c4c5864705a48526f505349324c6a45324e4467794969382532425043397a646d63253242)](https://github.dosu.com/AstrBotDevs/AstrBot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=AstrBotDevs%2FAstrBot) [![Add Dosu to your team](https://camo.githubusercontent.com/f634153e769499c79d913816ceb17aa06cc187e19f63b56e0f343713c699cfa7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f416464253230446f7375253230746f253230796f75722532307465616d2d3166366665623f7374796c653d666c6174)](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=AstrBotDevs%2FAstrBot)
    

    之前若未带 criteria 的响应示例填错了,已修改。

  4. moved this from Todo to In Progress in AstrBot Roadmapon Nov 9, 2026
  5. moved this from In Progress to Done in AstrBot Roadmapon Nov 18, 2026
  6. added a commit that references this issue on Nov 18, 2026
    ef5a83f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions