bailinghub 0.9.4 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +6 -6
- package/README.md +6 -6
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/docker-compose.images.yml +2 -2
- package/docs/AGENT_CLIENT_QUICKSTART.en.md +1 -3
- package/docs/AGENT_CLIENT_QUICKSTART.md +1 -1
- package/docs/AGENT_CLIENT_RUNTIME_API.en.md +87 -2
- package/docs/AGENT_CLIENT_RUNTIME_API.md +36 -2
- package/docs/AGENT_KNOWLEDGE_API.en.md +77 -0
- package/docs/AGENT_KNOWLEDGE_API.md +86 -0
- package/docs/AGENT_TASK_CONTROL.md +4 -4
- package/docs/AGENT_TASK_CONTROL_FOUNDATION.md +1 -1
- package/docs/ARCHITECTURE.md +4 -0
- package/docs/CHANGELOG.en.md +12 -0
- package/docs/CHANGELOG.md +12 -0
- package/docs/COMPATIBILITY.en.md +27 -1
- package/docs/CONTRACT.en.md +1 -1
- package/docs/CONTRACT.md +1 -1
- package/docs/IMPLEMENTATION_STATUS.en.md +19 -15
- package/docs/IMPLEMENTATION_STATUS.md +19 -15
- package/docs/INDEPENDENT_VALIDATION.en.md +6 -4
- package/docs/INDEPENDENT_VALIDATION.md +6 -4
- package/docs/INTEGRATION_WALKTHROUGH.md +65 -0
- package/docs/MODEL_BILLING.en.md +2 -0
- package/docs/MODEL_BILLING.md +6 -2
- package/docs/MODEL_CONTINUATION.en.md +54 -0
- package/docs/MODEL_CONTINUATION.md +54 -0
- package/docs/MODEL_OUTPUT_BUDGET.en.md +69 -0
- package/docs/MODEL_OUTPUT_BUDGET.md +69 -0
- package/docs/OPERATIONS.en.md +16 -4
- package/docs/OPERATIONS.md +16 -4
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.en.md +5 -0
- package/docs/README.md +5 -0
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
- package/docs/RELEASE_NOTES_NEXT.md +3 -3
- package/docs/RELEASE_NOTES_v0.10.0.en.md +58 -0
- package/docs/RELEASE_NOTES_v0.10.0.md +58 -0
- package/docs/UPGRADE_PLAN.en.md +118 -0
- package/docs/UPGRADE_PLAN.md +124 -0
- package/docs/UPGRADE_v0.10.0.en.md +47 -0
- package/docs/UPGRADE_v0.10.0.md +47 -0
- package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +38 -22
- package/package.json +8 -5
- package/schemas/tool-definition.schema.json +13 -0
- package/scripts/check-doc-links.mjs +4 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/doctor-upgrade-plan.test.ts +205 -0
- package/scripts/doctor-upgrade-plan.ts +276 -0
- package/scripts/doctor.ts +4 -1
- package/scripts/e2e-console-approval-details.mjs +134 -0
- package/scripts/e2e-console-config-races.mjs +180 -0
- package/scripts/e2e-console-kb-audit.mjs +170 -0
- package/scripts/e2e-console-operations-audit.mjs +152 -0
- package/scripts/e2e-console-runtime-audit.mjs +179 -0
- package/scripts/e2e-console-settings-audit.mjs +125 -0
- package/scripts/e2e-console-troubleshooting-extra.mjs +267 -0
- package/scripts/e2e-console.mjs +476 -7
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +4 -0
- package/scripts/verify-github-repo.mjs +4 -0
- package/src/app/agent-client-runtime.test.ts +115 -2
- package/src/app/agent-client-runtime.ts +40 -11
- package/src/app/agent-knowledge.test.ts +171 -0
- package/src/app/agent-knowledge.ts +233 -0
- package/src/app/agent-tool-catalog-revision.test.ts +31 -0
- package/src/app/agent-tool-invocations.test.ts +7 -2
- package/src/app/agent-tool-invocations.ts +67 -7
- package/src/app/approval-continuations.test.ts +49 -1
- package/src/app/http.test.ts +16 -1
- package/src/app/http.ts +3 -3
- package/src/app/kernel-boot-recovery.mysql.test.ts +132 -0
- package/src/app/kernel-boot-recovery.test.ts +157 -0
- package/src/app/kernel.ts +12 -8
- package/src/app/readiness.mysql.test.ts +120 -0
- package/src/app/readiness.test.ts +111 -26
- package/src/app/readiness.ts +26 -22
- package/src/app/runtime-lifecycle.ts +34 -3
- package/src/app/tool-approvals.test.ts +83 -0
- package/src/app/tool-approvals.ts +25 -7
- package/src/app/tool-proxy-payload.test.ts +81 -0
- package/src/app/tool-proxy.ts +24 -2
- package/src/core/config/console-diagnostic-location.test.ts +36 -0
- package/src/core/config/console-form-guard.test.ts +69 -0
- package/src/core/config/console-task-location.test.ts +64 -0
- package/src/core/contracts/openapi-tools.ts +16 -5
- package/src/core/contracts/schema-readiness.ts +11 -0
- package/src/core/contracts/tool-definition.ts +26 -0
- package/src/core/contracts/tool-guidance.test.ts +77 -0
- package/src/core/contracts/tool-guidance.ts +31 -0
- package/src/core/contracts/tool-input-limits.ts +15 -0
- package/src/core/contracts/tools-idempotency.test.ts +90 -0
- package/src/core/contracts/tools.ts +52 -9
- package/src/core/runtime/agent-execution-memory.test.ts +64 -0
- package/src/core/runtime/agent-execution-memory.ts +63 -0
- package/src/core/state/state-contracts.ts +3 -0
- package/src/infrastructure/config/config-observability-ledger.ts +2 -0
- package/src/infrastructure/schema/schema-readiness.ts +29 -0
- package/src/infrastructure/state/state-mysql.ts +3 -0
- package/src/modules/usage/contracts.ts +7 -0
- package/src/modules/usage/http.ts +2 -0
- package/src/modules/usage/model-continuation.test.ts +109 -0
- package/src/modules/usage/model-gateway.ts +5 -1
- package/src/modules/usage/output-budget.mysql.test.ts +84 -0
- package/src/modules/usage/output-budget.test.ts +167 -0
- package/src/modules/usage/output-budget.ts +73 -0
- package/src/modules/usage/provider-stream.test.ts +22 -0
- package/src/modules/usage/provider.ts +2 -3
- package/src/modules/usage/repository.ts +6 -0
- package/src/modules/usage/test-harness.ts +4 -2
- package/src/routes/admin-approval-view.test.ts +109 -0
- package/src/routes/admin-approval-view.ts +36 -0
- package/src/routes/admin-readiness.test.ts +52 -0
- package/src/routes/admin-runtime-ux.test.ts +51 -0
- package/src/routes/admin-runtime-ux.ts +25 -0
- package/src/routes/admin-runtime.ts +36 -8
- package/src/routes/admin.ts +9 -0
- package/src/routes/agent-api.test.ts +80 -1
- package/src/routes/agent-api.ts +63 -4
- package/src/routes/agent-tool-detail.test.ts +140 -0
- package/src/routes/public-default.ts +1 -1
- package/src/services/kb-agent.test.ts +84 -0
- package/src/services/kb.ts +73 -0
- package/web/console/assets/Accounts-CjIBO3sU.css +1 -0
- package/web/console/assets/Accounts-Dhyw-7wF.js +3 -0
- package/web/console/assets/AgentClients-BA0M26-I.css +1 -0
- package/web/console/assets/AgentClients-DWxb8-ko.js +1 -0
- package/web/console/assets/AgentTasks-DOyxANnx.css +1 -0
- package/web/console/assets/AgentTasks-DUHD4dzr.js +2 -0
- package/web/console/assets/Approvals-Brl-2uJq.css +1 -0
- package/web/console/assets/Approvals-CQx1YWxW.js +1 -0
- package/web/console/assets/Audit--QcdVlMh.js +1 -0
- package/web/console/assets/Audit-DAdmOnIs.css +1 -0
- package/web/console/assets/{BrandLockup-CffORQse.js → BrandLockup-DQcaW4Nt.js} +1 -1
- package/web/console/assets/Channels-DJJU3ksE.css +1 -0
- package/web/console/assets/Channels-cGS5WfQ-.js +105 -0
- package/web/console/assets/ChatEntries-BYpji27B.css +1 -0
- package/web/console/assets/ChatEntries-nh23Iz5O.js +7 -0
- package/web/console/assets/Clients-CX5EeYio.js +3 -0
- package/web/console/assets/Clients-CbZAou8E.css +1 -0
- package/web/console/assets/Cost-C6oQvz9P.css +1 -0
- package/web/console/assets/Cost-DOZfdNS9.js +1 -0
- package/web/console/assets/Credentials--aHs57yV.css +1 -0
- package/web/console/assets/Credentials-sy6W9Sac.js +1 -0
- package/web/console/assets/Diagnostics-CKs27Dnv.css +1 -0
- package/web/console/assets/Diagnostics-CyoM1XrZ.js +1 -0
- package/web/console/assets/Executors-2Upi6bOS.css +1 -0
- package/web/console/assets/Executors-BQqqiFwt.js +1 -0
- package/web/console/assets/HelpTip-DLlhaGQp.js +1 -0
- package/web/console/assets/HelpTip-bbDEyuqV.css +1 -0
- package/web/console/assets/Kb-5R3ce4UU.js +5 -0
- package/web/console/assets/Kb-BM_PYi11.css +1 -0
- package/web/console/assets/{Login-CGgLGTE1.js → Login-YKeUwdgo.js} +1 -1
- package/web/console/assets/Projects-DHwHrPT9.css +1 -0
- package/web/console/assets/Projects-Grgb6fOv.js +1 -0
- package/web/console/assets/Routes-DR_Yf02e.css +1 -0
- package/web/console/assets/Routes-DYgrXlRJ.js +138 -0
- package/web/console/assets/Runs-CwTddJJj.js +3 -0
- package/web/console/assets/Runs-D4FOvNfu.css +1 -0
- package/web/console/assets/Setup-Ca0b1d1-.css +1 -0
- package/web/console/assets/Setup-D_xUPNDq.js +1 -0
- package/web/console/assets/Shell-BTg8Vw_L.css +1 -0
- package/web/console/assets/Shell-Dfam2Uoj.js +1 -0
- package/web/console/assets/StorageBuckets-7QLBpV4a.css +1 -0
- package/web/console/assets/StorageBuckets-CP6e50wI.js +1 -0
- package/web/console/assets/SystemSettings-BRYKyJNa.js +1 -0
- package/web/console/assets/SystemSettings-HsXGx0aH.css +1 -0
- package/web/console/assets/SystemStatus-B-VfRsQd.css +1 -0
- package/web/console/assets/SystemStatus-CbPsDsGt.js +1 -0
- package/web/console/assets/Targets-1j4-g6rC.css +1 -0
- package/web/console/assets/Targets-C2LkR2AF.js +1 -0
- package/web/console/assets/Tools-C9HPJqJb.css +1 -0
- package/web/console/assets/Tools-C9JNJUS0.js +2 -0
- package/web/console/assets/Usage-D1Mv6vGY.js +1 -0
- package/web/console/assets/Usage-DMOzUsqh.css +1 -0
- package/web/console/assets/UsageAccess-77LmGCm6.js +1 -0
- package/web/console/assets/UsageAccess-C6ZGxEgJ.css +1 -0
- package/web/console/assets/{UsageHelp-CzS2gI40.js → UsageHelp-BmuiE1Ew.js} +1 -1
- package/web/console/assets/client-route-draft-DxZRxKPT.js +1 -0
- package/web/console/assets/console-location-Csv-xsnl.js +1 -0
- package/web/console/assets/form-guard-8GrFpry0.js +1 -0
- package/web/console/assets/{index-65JiiUr4.js → index-B_5UfiTw.js} +1 -1
- package/web/console/assets/index-MjZJEFIN.js +2 -0
- package/web/console/assets/{request-DKycpD7z.js → request-rqm6MT0s.js} +1 -1
- package/web/console/assets/runtime-feedback-gPfZVNvY.js +1 -0
- package/web/console/assets/{schema-SCiNxBlR.js → schema-o3mK4mid.js} +1 -1
- package/web/console/assets/task-page-location-DWiGtAln.js +1 -0
- package/web/console/assets/use-list-location-FvLFt0Tq.css +1 -0
- package/web/console/assets/use-list-location-cIPy2cKM.js +1 -0
- package/web/console/assets/use-unsaved-form-DScKD0h9.js +1 -0
- package/web/console/assets/{util-DZYfJ5Zo.js → util-B40VqOwl.js} +1 -1
- package/web/console/assets/{vendor-element-8cVcdt5T.js → vendor-element-BT8tHCFk.js} +1 -1
- package/web/console/assets/{vendor-mammoth-CnDA23N0.js → vendor-mammoth-CVIXVxTN.js} +1 -1
- package/web/console/assets/{vendor-vue-Co7x2FW6.js → vendor-vue-DhbG0vd4.js} +7 -7
- package/web/console/index.html +3 -3
- package/web-admin/package-lock.json +4 -4
- package/web-admin/package.json +1 -1
- package/web-admin/src/client-route-draft.ts +25 -0
- package/web-admin/src/components/AgentSetupPanel.vue +54 -41
- package/web-admin/src/components/HelpTip.vue +4 -1
- package/web-admin/src/components/ListLocationBar.vue +22 -0
- package/web-admin/src/components/NotificationOutboxPanel.vue +35 -7
- package/web-admin/src/console-entry.test.ts +26 -0
- package/web-admin/src/console-entry.ts +20 -0
- package/web-admin/src/console-location.ts +35 -0
- package/web-admin/src/form-guard.ts +35 -0
- package/web-admin/src/layout/Shell.vue +18 -65
- package/web-admin/src/onboarding-state.test.ts +174 -0
- package/web-admin/src/onboarding-state.ts +122 -0
- package/web-admin/src/pages/Accounts.vue +44 -24
- package/web-admin/src/pages/AgentClients.vue +47 -29
- package/web-admin/src/pages/AgentTasks.vue +57 -12
- package/web-admin/src/pages/Approvals.vue +105 -25
- package/web-admin/src/pages/Audit.vue +15 -6
- package/web-admin/src/pages/Channels.vue +136 -43
- package/web-admin/src/pages/ChatEntries.vue +96 -41
- package/web-admin/src/pages/Clients.vue +87 -26
- package/web-admin/src/pages/Cost.vue +15 -4
- package/web-admin/src/pages/Credentials.vue +63 -32
- package/web-admin/src/pages/Diagnostics.vue +103 -54
- package/web-admin/src/pages/Executors.vue +103 -40
- package/web-admin/src/pages/Kb.vue +278 -128
- package/web-admin/src/pages/Projects.vue +44 -16
- package/web-admin/src/pages/Routes.vue +168 -247
- package/web-admin/src/pages/Runs.vue +163 -91
- package/web-admin/src/pages/Setup.vue +182 -291
- package/web-admin/src/pages/StorageBuckets.vue +61 -25
- package/web-admin/src/pages/SystemSettings.vue +76 -51
- package/web-admin/src/pages/SystemStatus.vue +54 -30
- package/web-admin/src/pages/Targets.vue +45 -17
- package/web-admin/src/pages/Tools.vue +133 -68
- package/web-admin/src/pages/Usage.vue +64 -25
- package/web-admin/src/pages/UsageAccess.vue +11 -8
- package/web-admin/src/route-call-snippets.test.ts +82 -0
- package/web-admin/src/route-call-snippets.ts +178 -0
- package/web-admin/src/router.ts +11 -29
- package/web-admin/src/runtime-feedback.ts +43 -0
- package/web-admin/src/task-page-location.ts +66 -0
- package/web-admin/src/usage-output-budget.test.ts +26 -0
- package/web-admin/src/usage-output-budget.ts +46 -0
- package/web-admin/src/use-list-location.ts +24 -0
- package/web-admin/src/use-unsaved-form.ts +38 -0
- package/web-admin/tests/model-output-budget.browser.mjs +69 -0
- package/web/console/assets/Accounts-Bervi5JU.css +0 -1
- package/web/console/assets/Accounts-Dhj6PjXP.js +0 -3
- package/web/console/assets/AgentClients-CMy8StAH.js +0 -1
- package/web/console/assets/AgentClients-i52AI6YV.css +0 -1
- package/web/console/assets/AgentTasks-BsG850Il.css +0 -1
- package/web/console/assets/AgentTasks-DA1xZdmP.js +0 -2
- package/web/console/assets/Approvals-DIsd7R8N.js +0 -1
- package/web/console/assets/Approvals-DlTSHl_7.css +0 -1
- package/web/console/assets/Audit-AUDABLTX.js +0 -1
- package/web/console/assets/Audit-CSu6_3oD.css +0 -1
- package/web/console/assets/Channels-B8rjsM0S.js +0 -105
- package/web/console/assets/Channels-CCn0L1jg.css +0 -1
- package/web/console/assets/ChatEntries-DsYtcXN6.css +0 -1
- package/web/console/assets/ChatEntries-iZjJMEUZ.js +0 -7
- package/web/console/assets/Clients-CSHIsaWU.css +0 -1
- package/web/console/assets/Clients-CwgpGCSD.js +0 -3
- package/web/console/assets/Cost-B2tNxu71.js +0 -1
- package/web/console/assets/Cost-CjT39DSZ.css +0 -1
- package/web/console/assets/Credentials-BuwFB-fV.js +0 -1
- package/web/console/assets/Credentials-ioLP0qYN.css +0 -1
- package/web/console/assets/Diagnostics-Ya05PTDp.css +0 -1
- package/web/console/assets/Diagnostics-z5glms11.js +0 -1
- package/web/console/assets/Executors-Bc4SvjeH.js +0 -1
- package/web/console/assets/Executors-CjhEM54c.css +0 -1
- package/web/console/assets/HelpTip-CA6Bm7Nx.css +0 -1
- package/web/console/assets/HelpTip-Dtdt2tKR.js +0 -1
- package/web/console/assets/Kb-BRbRHxLy.js +0 -5
- package/web/console/assets/Kb-CzIzd9xr.css +0 -1
- package/web/console/assets/Projects-Bm8AjsNx.css +0 -1
- package/web/console/assets/Projects-CPWw3con.js +0 -1
- package/web/console/assets/Routes-CMIaE0Bx.js +0 -124
- package/web/console/assets/Routes-CyXV4Pba.css +0 -1
- package/web/console/assets/Runs-B8HuE700.js +0 -3
- package/web/console/assets/Runs-Bv6CV_Hk.css +0 -1
- package/web/console/assets/Setup-D7nxgn-9.css +0 -1
- package/web/console/assets/Setup-G8RKzliR.js +0 -1
- package/web/console/assets/Shell-DimHgraJ.js +0 -1
- package/web/console/assets/Shell-ykb-tUfo.css +0 -1
- package/web/console/assets/StorageBuckets-CVgpZRWY.css +0 -1
- package/web/console/assets/StorageBuckets-CiVYXIE2.js +0 -1
- package/web/console/assets/SystemSettings-BjiHyrXO.css +0 -1
- package/web/console/assets/SystemSettings-DF8sZNen.js +0 -1
- package/web/console/assets/SystemStatus-BlHywK13.js +0 -1
- package/web/console/assets/SystemStatus-I11I67rw.css +0 -1
- package/web/console/assets/Targets-BXaoPoAJ.js +0 -1
- package/web/console/assets/Targets-DTb5tn6z.css +0 -1
- package/web/console/assets/Tools-B22lNHXq.js +0 -2
- package/web/console/assets/Tools-DU8ei6sd.css +0 -1
- package/web/console/assets/Usage-C02EzoI2.js +0 -1
- package/web/console/assets/Usage-CAeDGjrb.css +0 -1
- package/web/console/assets/UsageAccess-CGGaWTuj.css +0 -1
- package/web/console/assets/UsageAccess-DOb-cyPE.js +0 -1
- package/web/console/assets/index-CK0ZCTZv.js +0 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 长任务续跑与原请求恢复
|
|
2
|
+
|
|
3
|
+
[English](MODEL_CONTINUATION.en.md)
|
|
4
|
+
|
|
5
|
+
模型每次生成有输出预算;宿主 Agent 的整项任务可以由多次模型调用和工具操作组成。合理预算与自动续跑相互配合,不能靠取消边界、无条件放大预算或重复整项任务解决截断。此文使用现有 `bailing.model-operation.v1`、`bailing.model-stream.v1` 与 `bailing.provider-response.v1`,不新增续跑接口或私有结束字段。
|
|
6
|
+
|
|
7
|
+
## 中枢和宿主的边界
|
|
8
|
+
|
|
9
|
+
中枢按服务配置派发一次模型请求,透传原生供应商 JSON/SSE,将原响应、用量与派发证据保存到原 `operation_id`。`orchestration=host` 表示任务循环、模型语义解析、工具执行、检查点与用户体验由客户端宿主管理。中枢不因 `length`、缺少正文、HTTP 错误或未知供应商结束原因自动再次 POST,不切换模型、协议或凭据。
|
|
10
|
+
|
|
11
|
+
`result_state=complete` 只表示原供应商响应交换已保存。回答是否完整、工具参数是否完整、整项任务是否完成,是不同的宿主判断;`billing_state=pending` 也不是阻止宿主使用已保存响应的理由。单次超时、输入字节、上下文窗口、服务输出上限和账户额度保持各自边界,不能用续跑绕过。
|
|
12
|
+
|
|
13
|
+
## 两条互斥路径
|
|
14
|
+
|
|
15
|
+
| 已确认的状态 | 宿主动作 |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| 最终原 operation 回执可用,供应商适配器明确识别输出预算截断 | 保存原部分内容和检查点;在原任务授权内准备新续段,以新的 operation 调用模型 |
|
|
18
|
+
| 模型 POST 丢失 ACK、流缺少最终 operation 帧、网络或持久化结果未知 | 先按原 operation 查询,只恢复已保存结果;不新建 ID 重发生成 |
|
|
19
|
+
| 原 operation 尚在 pending | 等待或查询原 ID,不并发生成替代请求 |
|
|
20
|
+
| 正常结束,或供应商说明为内容过滤、拒绝、未知结束原因 | 由适配器按原生语义处理,不猜测可以自动续跑 |
|
|
21
|
+
| 已取消、授权终止、原响应过期且本地无可信副本 | 停止自动续跑,保留证据并呈现需要处理的原因 |
|
|
22
|
+
|
|
23
|
+
只有供应商适配器明确识别的输出预算结束原因才能进入截断路径。例如适配器已支持的 `finish_reason=length` 可以作为证据;未知的扩展值不能靠字符串猜测。`outputTokens` 恰好等于预算、答案很短、HTTP 正常 EOF、计费完成或 SSE `[DONE]` 均不能单独证明任务完成,也不能单独授权自动续段。某些模型把思考包含在总输出预算中,预算解释遵循[模型输出预算契约](MODEL_OUTPUT_BUDGET.md)。
|
|
24
|
+
|
|
25
|
+
查询原 operation 与重复原 POST都受既有幂等约束保护,但恢复应优先调用只读查询。相同 ID 的不同内容是冲突,不能用改参数、补上下文或换模型修改已保存的意图。查询返回未找到也不是“已证明没有执行”的授权;恢复缺口需保留并处理。
|
|
26
|
+
|
|
27
|
+
## 宿主续段检查点
|
|
28
|
+
|
|
29
|
+
在发起下一段之前,宿主应持久保存任务、原 operation、选定服务与描述修订、规范化结束原因、已输出片段、工具调用结果以及已完成和未完成步骤。新续段使用新 operation,以明确的父子关联保存在宿主本地;本轮协议不增加父 operation 字段。
|
|
30
|
+
|
|
31
|
+
续段上下文携带已经保存的有效内容与工具结果,要求从未完成步骤接续。不要把原始用户请求重新当作尚未执行的新任务,也不要重发先前模型请求。模型本轮的原生工具调用和工具结果必须保持供应商消息格式及关联标识。针对可见回答的分段展示和重复前缀,可在宿主呈现层合并;不能篡改原响应、摘要或工具结果证据。
|
|
32
|
+
|
|
33
|
+
自动续跑需要有限的连续续段数、累计任务时间/费用或 Token 预算、循环和无进展检测,并允许用户随时取消。默认值由宿主结合其现有任务政策配置,不能无界递归;达到边界时保留检查点,以简洁原因和下一步动作代替反复要求用户手工输入“继续”。上下文接近窗口时,按宿主已有可恢复摘要机制处理,保留原 action 与结果引用,不能通过摘要丢失去重或审批证据。
|
|
34
|
+
|
|
35
|
+
客户端重启、断网恢复和重复流回放也必须复用同一检查点,避免同时开启两个续段。只收到流中的截断终止片段而未收到最终 operation 回执时,先恢复原 operation,再决定新续段。用户取消或任务结束之后的晚到结果不得重新启动循环。
|
|
36
|
+
|
|
37
|
+
## 工具执行不能随文本重跑
|
|
38
|
+
|
|
39
|
+
模型 operation 的幂等只能防止同一模型请求重复派发,不能识别“模型在下一段用新 ID 重复提出同一笔业务操作”。宿主须持久化业务 action 与原 `invocation_id`、输入摘要、审批及结果的关联,并将结果带入续段。仅凭新 `tool_call_id` 或参数相同,不能证明新的业务写入已获得授权;也不能跨任务把所有相同参数一律去重。
|
|
40
|
+
|
|
41
|
+
截断响应中出现的工具调用,即使局部参数恰好能解析为 JSON,也不能直接执行。等待供应商适配器确认完整的工具调用结束语义,并经过原能力 schema、授权、审批和幂等流程。残缺参数不能通过自动补全后当作原调用执行。
|
|
42
|
+
|
|
43
|
+
- 对已完成 invocation,复用原回执和结果,不创建新 invocation 重做。
|
|
44
|
+
- 对执行不确定或 `reconciliation_required` 的 invocation,先只读检查原调用,不能通过续段重试写入。
|
|
45
|
+
- Agent 客户端 SDK 的 `inspectInvocation()` 对应只读原 invocation receipt;它不消费审批,也不触发业务派发。
|
|
46
|
+
- Agent 客户端 SDK 的 `resume()` 可能在原调用审批通过后执行其首次业务派发,不能把它用作轮询或只读检查。只有原状态和原任务授权明确允许时,才能在原 invocation 上继续既有流程。
|
|
47
|
+
|
|
48
|
+
这些约束不替代业务系统自己的幂等和授权,中枢不宣称跨所有外部系统的业务副作用 exactly-once。
|
|
49
|
+
|
|
50
|
+
## 验证与限制
|
|
51
|
+
|
|
52
|
+
`provider-stream.test.ts` 验证 JSON/SSE 的明确截断、中文、多字节正文、思考用量及残缺工具参数的原文保留。`model-continuation.test.ts` 使用真实网关逻辑和合成持久化/报价端口验证:截断交换保持 complete、原 ID 恢复和重复请求不再派发、冲突意图拒绝、新续段单独派发、真实传输未知不自动重试。合成端口不构成数据库事务、真实供应商、客户端持久化或业务工具执行验收。
|
|
53
|
+
|
|
54
|
+
真实客户端还需验证:续段次数边界、无进展退出、取消、崩溃重启、多窗口竞争、上下文摘要、已完成工具复用和不确定写入核对。仅部署中枢不会自动赋予客户端上述任务循环能力。
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Model output-budget contract
|
|
2
|
+
|
|
3
|
+
[简体中文](MODEL_OUTPUT_BUDGET.md)
|
|
4
|
+
|
|
5
|
+
AIaaS model services separate the default budget for a new request from its permitted service ceiling. This applies to `/usage/v1/model/models` and the chat-model gateway. It does not change bundled-chat knowledge assembly, image-model tools, metering or original-request recovery.
|
|
6
|
+
|
|
7
|
+
## Service configuration and discovery
|
|
8
|
+
|
|
9
|
+
| Configuration | Model descriptor | Meaning |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `maxOutputTokens` | `max_output_tokens` | Operator service ceiling, a positive integer currently bounded to 1–131072; not a vendor capability claim |
|
|
12
|
+
| `defaultOutputTokens` | `default_output_tokens` | Default when a new request omits its output parameter; positive and no larger than the ceiling |
|
|
13
|
+
| `outputTokenParameter` | `output_token_parameter` | Actual configured route parameter, `max_tokens` or `max_completion_tokens` |
|
|
14
|
+
| `outputBudgetScope` | `output_budget_scope` | `completion_total` shares the budget between reasoning and answer; `final_answer` limits the final answer only |
|
|
15
|
+
| `modelMaxOutputTokens` | `model_max_output_tokens` | Optional verified vendor maximum for this parameter/scope; omit unknown values, and keep the service ceiling at or below it |
|
|
16
|
+
|
|
17
|
+
Default, parameter and scope form an all-or-none explicit group. This contract permits `max_completion_tokens` only with `completion_total`; `max_tokens` can have either scope depending on the actual provider route. Metadata neither probes nor guarantees vendor support. Do not infer semantics from model names; reverify parameter, scope and vendor maximum after changing models, credentials or routes.
|
|
18
|
+
|
|
19
|
+
`modelMaxOutputTokens` is allowed only with the explicit policy, between 1 and 10000000. A higher vendor capability never removes the platform's bounded `maxOutputTokens` ceiling. Context window, output budget, input-byte limit and timeout are independent. Descriptors do not expose credential aliases, `providerScope`, vendor URLs or request bodies.
|
|
20
|
+
|
|
21
|
+
Example values illustrate the contract, not recommended settings for a real model:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"maxOutputTokens": 65536,
|
|
26
|
+
"defaultOutputTokens": 32768,
|
|
27
|
+
"outputTokenParameter": "max_completion_tokens",
|
|
28
|
+
"outputBudgetScope": "completion_total",
|
|
29
|
+
"modelMaxOutputTokens": 131072
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Discovery returns the corresponding `max_output_tokens`, `default_output_tokens`, `output_token_parameter`, `output_budget_scope` and `model_max_output_tokens`. Its `provider_options` list includes only the configured output key alongside unchanged passthrough options. Gateway capabilities declare support through `output_budget` with schema `bailing.model-output-budget.v1`.
|
|
34
|
+
|
|
35
|
+
## Dispatch and rejection
|
|
36
|
+
|
|
37
|
+
Under an explicit policy, omitting the output parameter selects the independent default and configured wire key. A matching parameter is accepted through the exact service ceiling; ceiling plus one is rejected. Both output keys together remain invalid. A different key returns HTTP 400 `USAGE_OUTPUT_PARAMETER_MISMATCH`, never a silent rename that might change reasoning/answer semantics.
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"error": "USAGE_OUTPUT_PARAMETER_MISMATCH",
|
|
42
|
+
"dispatch": "not_dispatched",
|
|
43
|
+
"feedback": {
|
|
44
|
+
"output_budget": {
|
|
45
|
+
"expected_parameter": "max_completion_tokens",
|
|
46
|
+
"scope": "completion_total"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
An excessive budget returns HTTP 413 `USAGE_OUTPUT_LIMIT`; `feedback.output_limit` contains `actual`, `allowed`, `parameter` and known `scope`. These are safe scalars, excluding messages, full requests, provider configuration and credentials. Both failures precede admission and vendor dispatch; Core does not clamp, retry or charge them.
|
|
53
|
+
|
|
54
|
+
Existing `thinking.budget_tokens`, `reasoning_effort` and similar options pass through. Core does not invent or add separate reasoning budgets. Reported reasoning Tokens are subsets, not another completion debit. A transport-complete exchange does not guarantee an untruncated answer.
|
|
55
|
+
|
|
56
|
+
## Legacy services and original requests
|
|
57
|
+
|
|
58
|
+
When the group is absent, legacy behavior remains: no separate default/scope/vendor maximum is invented; an omitted output key uses the existing ceiling as default `max_tokens`, and either historical output key can still be selected. Editing only a label or unrelated field must not enable the policy silently. A legacy image service's `maxOutputTokens` residue is not interpreted as an image Token limit; new chat policy fields are rejected for image tools.
|
|
59
|
+
|
|
60
|
+
Already admitted operations are resolved by original ID and request hash before consulting current policy. Policy changes never rewrite their service snapshot, intent or metering, and never redispatch them. Keep the original operation/digest and recovery flow.
|
|
61
|
+
|
|
62
|
+
A locally prepared but unadmitted request has no preserved old service snapshot. Enabling a policy may reject its original parameter. Refresh discovery, explain the change and explicitly prepare a new operation. Never rewrite the old intent, submit changed content under its ID or mistake a parameter rejection for a retryable network error.
|
|
63
|
+
|
|
64
|
+
Clients consume default and ceiling separately and construct new requests using the descriptor. Do not hardcode all services back to 8192 or treat a default as the maximum. SDK helpers parse descriptors and construct new options; saved prepared requests do not pass through a rewriting helper. Deploying the contract does not reconfigure old services. Production configuration and real-provider long-output acceptance are separate actions.
|
|
65
|
+
|
|
66
|
+
## Local verification
|
|
67
|
+
|
|
68
|
+
- `node --import tsx --test src/modules/usage/output-budget.test.ts` covers group validation, legacy discovery, bounds, parameter scope, scalar feedback, actual synthetic HTTP bodies and reasoning usage.
|
|
69
|
+
- With the dedicated local synthetic MySQL on `127.0.0.1:16307`, run `BAILING_USAGE_TEST_MYSQL=1 node --import tsx --test src/modules/usage/output-budget.mysql.test.ts`. Each case creates and removes random databases and checks persistence, dispatch, admitted recovery, unadmitted rejection and single billing. It does not read deployment secrets or call real providers.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# 模型输出预算契约
|
|
2
|
+
|
|
3
|
+
[English](MODEL_OUTPUT_BUDGET.en.md)
|
|
4
|
+
|
|
5
|
+
AIaaS 模型服务将“新请求默认使用多少 token”和“服务最多允许请求多少 token”分开配置。适用范围为 `/usage/v1/model/models` 与对话模型网关,不改变嵌入聊天的知识库装配、图片模型工具、计量或请求恢复机制。
|
|
6
|
+
|
|
7
|
+
## 服务配置与目录
|
|
8
|
+
|
|
9
|
+
| 后台配置 | 模型目录 | 含义 |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `maxOutputTokens` | `max_output_tokens` | 运营设置的服务请求上限,正整数,平台当前允许 1–131072;不是供应商模型能力声明 |
|
|
12
|
+
| `defaultOutputTokens` | `default_output_tokens` | 新请求未指定输出预算时使用的默认值,正整数且不超过服务上限 |
|
|
13
|
+
| `outputTokenParameter` | `output_token_parameter` | 当前供应商路由实际采用的参数:`max_tokens` 或 `max_completion_tokens` |
|
|
14
|
+
| `outputBudgetScope` | `output_budget_scope` | `completion_total` 表示思考与答案共享总预算;`final_answer` 表示只限制最终答案 |
|
|
15
|
+
| `modelMaxOutputTokens` | `model_max_output_tokens` | 可选,已核实的供应商对当前参数和 scope 支持的最大值;未知时省略,服务上限不能超过它 |
|
|
16
|
+
|
|
17
|
+
默认值、参数、scope 必须一起显式配置,不能只填一部分。本方契约限定 `max_completion_tokens` 必须使用 `completion_total`;`max_tokens` 可配两种 scope,具体取决于实际供应商路由。元数据不负责探测或保证供应商能力,不能按模型名称猜测。更换模型、供应商凭据或路由后,应重新核对参数、scope 和供应商最大值。
|
|
18
|
+
|
|
19
|
+
`modelMaxOutputTokens` 只允许与显式策略一起提供,平台接受其正整数范围为 1–10000000;即使供应商模型能力更高,也不会放宽 `maxOutputTokens` 的平台有界限制。上下文窗口、输出预算、输入字节限制和超时是不同约束,仍独立生效。目录不会透露凭据别名、providerScope、供应商 URL 或请求内容。
|
|
20
|
+
|
|
21
|
+
显式配置示例(仅展示字段语义,不是任何真实模型的推荐值):
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"maxOutputTokens": 65536,
|
|
26
|
+
"defaultOutputTokens": 32768,
|
|
27
|
+
"outputTokenParameter": "max_completion_tokens",
|
|
28
|
+
"outputBudgetScope": "completion_total",
|
|
29
|
+
"modelMaxOutputTokens": 131072
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
对应目录包含 `max_output_tokens: 65536`、`default_output_tokens: 32768`、`output_token_parameter: "max_completion_tokens"`、`output_budget_scope: "completion_total"`、`model_max_output_tokens: 131072`。`provider_options` 只声明所选输出参数,其他既有可透传选项保持原样。网关 capabilities 通过 `output_budget` 下的 `bailing.model-output-budget.v1` 声明支持该契约。
|
|
34
|
+
|
|
35
|
+
## 请求派发与拒绝
|
|
36
|
+
|
|
37
|
+
显式策略下,省略输出参数会使用独立默认值和已配置参数;使用匹配参数时允许请求到服务上限,精确上限可通过,超过 1 token 仍拒绝。客户端不能同时传两种输出参数。使用另一种参数会得到 HTTP 400 `USAGE_OUTPUT_PARAMETER_MISMATCH`,不会被静默重命名,因为两种字段可能具有不同预算含义。
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"error": "USAGE_OUTPUT_PARAMETER_MISMATCH",
|
|
42
|
+
"dispatch": "not_dispatched",
|
|
43
|
+
"feedback": {
|
|
44
|
+
"output_budget": {
|
|
45
|
+
"expected_parameter": "max_completion_tokens",
|
|
46
|
+
"scope": "completion_total"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
超过服务上限返回 HTTP 413 `USAGE_OUTPUT_LIMIT`,`feedback.output_limit` 包含 `actual`、`allowed`、`parameter` 以及已知时的 `scope`。这些都是非敏感标量,不包含消息、完整请求、供应商配置或凭据。两类拒绝均发生在本次 operation 受理和供应商派发之前;不会自动缩减预算、重试或收费。
|
|
53
|
+
|
|
54
|
+
`thinking.budget_tokens`、`reasoning_effort` 等既有参数继续透传,Core 不擅自分割或叠加思考预算。供应商 usage 中的 reasoning token 子集不重复加到 completion token 上计费;传输完成也不保证答案未被供应商 token 限制截断。
|
|
55
|
+
|
|
56
|
+
## 旧服务与原请求
|
|
57
|
+
|
|
58
|
+
三项策略均未配置的旧服务保持既有行为:目录不产生独立默认、scope 或供应商最大值;未显式传输出参数时继续以服务上限作为默认 `max_tokens`,原来允许的两种输出字段仍可二选一。后台只修改名称或其他字段不应悄悄启用新策略。旧图片工具配置中的 `maxOutputTokens` 残留不会被解释为图片 token 上限,新增对话预算字段不允许写入图片工具。
|
|
59
|
+
|
|
60
|
+
已受理的 operation 通过原 ID 和原请求 hash 核对并恢复,优先于当前模型策略检查;后续策略变化不会改写其 service snapshot、intent、计量或再次派发。客户端保留原 operation、digest 和恢复流程。
|
|
61
|
+
|
|
62
|
+
已经在客户端准备、但尚未被 Core 受理的旧请求不享有旧配置快照。启用新策略后,原参数可能被明确拒绝。此时应刷新目录、说明变化并显式准备新 operation;不能改写原 intent、复用原 operation 内容重试,或将参数错误当作网络错误自动重发。
|
|
63
|
+
|
|
64
|
+
客户端应分别消费默认预算和上限,并按目录字段构造新请求,不能把所有服务重新写死为 8192,也不能把默认预算当作允许的最大值。SDK 提供解析和新请求构造帮助函数;现存 prepared 请求不经过此构造函数重写。部署本契约不自动更改旧服务配置,生产预算调整和真实模型长输出验收需分别完成。
|
|
65
|
+
|
|
66
|
+
## 本地验证
|
|
67
|
+
|
|
68
|
+
- `node --import tsx --test src/modules/usage/output-budget.test.ts`:成组校验、旧目录兼容、默认/上限边界、参数语义、非敏感回执、本地 HTTP provider 实际请求以及 reasoning 计量。
|
|
69
|
+
- 有专用合成本地 MySQL(`127.0.0.1:16307`)时:`BAILING_USAGE_TEST_MYSQL=1 node --import tsx --test src/modules/usage/output-budget.mysql.test.ts`。每个用例只创建并移除随机测试数据库;验证持久化、目录到派发、已受理原请求恢复、未受理旧 intent 拒绝及不重复收费。不读取真实部署配置或调用真实供应商。
|
package/docs/OPERATIONS.en.md
CHANGED
|
@@ -33,6 +33,12 @@ Business systems / channels
|
|
|
33
33
|
| `GET /health` | Liveness: the process responds | Restart the process |
|
|
34
34
|
| `GET /health/ready` | Readiness: MySQL is reachable and migrations are complete | Remove the instance from new traffic |
|
|
35
35
|
|
|
36
|
+
A false readiness result / HTTP 503 signals the Host or load balancer to remove traffic; it does not automatically reject every `/run` request. Deployment admission must honor that signal. The probe compares the artifact inventory with the migration ledger, not every physical table definition: manually dropping a business table while leaving its ledger intact can escape this check.
|
|
37
|
+
|
|
38
|
+
Readiness checks the actual state and configuration pools. Both databases must be complete when separate; one shared pool is checked once. JSONL state does not skip an attached MySQL configuration store. The installed artifact owns the active/retired migration inventory and SHA-256 checksums: missing active rows are pending; unknown rows, conflicting/missing/empty checksums, or an unreadable ledger are not-ready. Retired records are optional history but must match when present, and are never pending SQL. Probes only read: they do not create tables, backfill checksums, or run migrations. Legacy ledgers require the official migrator's validation/backfill in a controlled upgrade step first.
|
|
39
|
+
|
|
40
|
+
Custom MySQL state stores can expose their existing pool/query resource through the optional `RuntimeStateStore.schemaReadinessDb` contract. If absent, readiness fails rather than opening another connection or substituting the configuration database. This tightens the readiness result for older extensions while preserving type compatibility. Pure JSONL instances without SQL configuration still skip SQL checks. Existing status fields are retained; connection details and raw SQL exceptions are not returned. `migrations.pending` counts distinct missing migration filenames across resources, not databases. Distinct pools are checked separately even if they point to one schema; connection settings are never used to guess that resources can be merged.
|
|
41
|
+
|
|
36
42
|
Readiness intentionally does not probe models, tool providers, or channels. A third-party outage must not remove the entire hub from the load balancer. Use system diagnostics and alert rules for those dependencies.
|
|
37
43
|
|
|
38
44
|
`/health` exposes the process-local `observability.audit_write_failures` counter and `last_audit_failure_at`. Any non-zero value should trigger an investigation of structured `audit_write_failed` runtime log events and database health. The counter resets on process restart and does not replace external monitoring. Security-critical audit remains fail-closed; best-effort callers may degrade, but their write failures still pass through this observer first.
|
|
@@ -143,9 +149,9 @@ The new stage-diagnostic event records cache state, index/credential/query-embed
|
|
|
143
149
|
|
|
144
150
|
## 5. Upgrades
|
|
145
151
|
|
|
146
|
-
1.
|
|
147
|
-
2. Run `npm run release:check` outside production.
|
|
148
|
-
3.
|
|
152
|
+
1. Identify source/target artifacts and state/configuration stores using the [compatibility policy](COMPATIBILITY.en.md) and target-version guide. A [read-only upgrade plan](UPGRADE_PLAN.en.md) can help review the supplied evidence.
|
|
153
|
+
2. Run `npm run release:check` outside production and rehearse the upgrade and consistent backup restoration.
|
|
154
|
+
3. Stop admission to every instance and other writer sharing those stores, drain accepted work, and retain a consistent backup. Then run the target migrator once per distinct database. Do not assume online migration or mixed-version operation is safe without separate validation.
|
|
149
155
|
4. Start a new replica and wait for `/health/ready` to return 200.
|
|
150
156
|
5. Replace old replicas gradually while observing queue, errors, and lease recovery.
|
|
151
157
|
|
|
@@ -157,7 +163,7 @@ Back up the complete MySQL database, object-storage media and knowledge-source f
|
|
|
157
163
|
|
|
158
164
|
Recovery order:
|
|
159
165
|
|
|
160
|
-
1. Stop
|
|
166
|
+
1. Stop admission to all hub replicas and other writers sharing the stores, and confirm that background SQL, approvals and notification work have drained. Removing incoming traffic alone does not stop writes.
|
|
161
167
|
2. Restore MySQL and shared object storage.
|
|
162
168
|
3. Start one build compatible with the restored migration level.
|
|
163
169
|
4. Verify readiness, diagnostics, and a representative trace.
|
|
@@ -174,6 +180,12 @@ Recovery order:
|
|
|
174
180
|
- Native delivery DLQs retain channel credentials. Custom `X-notify` DLQs requeue only the original failed notification child; queued acknowledges executor admission, not receipt. A permanent DLQ marker is saved atomically with admission, so repeated calls or lost resolve replies do not admit it again or rerun the business parent. Legacy entries are checked against the original job; binding conflicts return 409 and adapters without replay ports return 503.
|
|
175
181
|
- Historical v0.9.3 drain does not provide a complete SIGKILL-safe notification outbox. Core v0.9.4 adds [durable notifications](NOTIFICATION_DURABILITY.en.md) and migration 068: new terminal transitions and approval creation commit alongside intents, and recovery sends notifications without rerunning business tasks. Ordinary alerts and legacy adapters retain best-effort boundaries. Receivers deduplicate stable event IDs; partial or unknown receipt must not be blindly resent.
|
|
176
182
|
|
|
183
|
+
### Standalone boot-recovery close barrier (unreleased candidate)
|
|
184
|
+
|
|
185
|
+
This candidate adds a close barrier that is not included in the published Core v0.9.4 artifact. An unfired recovery timer is cancelled; once recovery has started, `kernel.close(drainMs)` waits for target refresh, queries, audits and requeue work to settle. On `boot recovery drain timed out`, Kernel preserves resources and stops admitting new work. Investigate blockers such as database lock waits, then retry `close()` on **the same Kernel instance**; do not force-close its connection pool to bypass the barrier.
|
|
186
|
+
|
|
187
|
+
Retry applies to the Kernel API. The default CLI exits with status 1 after a failed signal shutdown and does not retry automatically; another `server.shutdown()` call is not a Kernel close retry. This barrier does not protect against forced process exit or replace durable recovery and business-result reconciliation.
|
|
188
|
+
|
|
177
189
|
## 8. Security Baseline
|
|
178
190
|
|
|
179
191
|
- Expose public traffic only through HTTPS.
|
package/docs/OPERATIONS.md
CHANGED
|
@@ -56,6 +56,12 @@
|
|
|
56
56
|
| `GET /health` | liveness,确认进程仍在响应 | 进程应重启 |
|
|
57
57
|
| `GET /health/ready` | readiness,确认 MySQL 可达且迁移齐全 | 暂时不要把新流量发给该实例 |
|
|
58
58
|
|
|
59
|
+
readiness 的 false / HTTP 503 是供 Host 或负载均衡摘流量的信号,不自动代表所有 `/run` 请求都被拦截;部署方需要据此实施流量准入。它检查制品清单与迁移账本,不逐表比对物理 DDL,无法发现“保留完整账本但手工删除业务表”等漂移。
|
|
60
|
+
|
|
61
|
+
readiness 使用实际 state/configuration 连接池检查各自账本;分库时两个库都必须齐全,共用同一池时只查一次。JSONL state 如果同时接入 MySQL configuration,仍检查后者。检查以安装制品的 active/retired 迁移清单和 SHA-256 为准:缺少 active 记录返回 pending;未知记录、摘要冲突、缺失/空摘要或账本不可读均返回 not-ready。retired 记录可以不存在,存在时必须匹配,永不作为待执行 SQL。探针只读,不建表、不补摘要、不迁移;旧账本必须先在受控升级步骤执行官方 migrator 完成校核/补录。
|
|
62
|
+
|
|
63
|
+
自定义 MySQL state store 的 `RuntimeStateStore.schemaReadinessDb` 是可选类型扩展,应返回正在使用的池/查询资源供固定只读探针使用。未提供时 readiness 明确失败,不会另开连接或误用 configuration 库代验;这收紧了旧扩展的就绪判定。纯 JSONL 且无 SQL configuration 的实例仍跳过数据库检查。接口保留既有状态字段,不返回连接地址或原始 SQL 异常。`migrations.pending` 是各资源缺少的迁移文件名去重计数,不代表数据库数量;不同池即使指向同库也分别检查,不按配置地址猜测合并。
|
|
64
|
+
|
|
59
65
|
readiness 不检查模型、工具源、渠道等外部业务依赖。某个模型服务波动不应导致整个中枢实例被负载均衡摘除;这些依赖由控制台“系统体检”和告警规则持续检查。
|
|
60
66
|
|
|
61
67
|
`/health` 的 `observability.audit_write_failures` 是当前进程累计的审计写入失败数,`last_audit_failure_at` 是最后失败时间。数值大于 0 时应立即检索运行日志中的结构化事件 `audit_write_failed` 并检查数据库;该计数随进程重启归零,不替代外部监控。安全关键审计仍然 fail-closed,允许 best-effort 的运行事件即使被调用方降级,也会先经过该统一观测层。
|
|
@@ -183,9 +189,9 @@ scrape_configs:
|
|
|
183
189
|
|
|
184
190
|
## 5. 发布与升级
|
|
185
191
|
|
|
186
|
-
1.
|
|
187
|
-
2. 在一个非生产环境运行 `npm run release:check
|
|
188
|
-
3.
|
|
192
|
+
1. 按[兼容性与升级](兼容性与升级.md)及目标版本指南核对源/目标制品和 state/configuration 存储;可先生成[只读升级计划](UPGRADE_PLAN.md)。
|
|
193
|
+
2. 在一个非生产环境运行 `npm run release:check`,验证升级及一致性备份恢复。
|
|
194
|
+
3. 停止所有共享存储的实例和其他写入者接收新工作,完成排空并保存一致性备份,再对每个不同的数据库运行一次目标版本迁移;账本位于 `bz_schema_migrations`。未经单独验证,不假定在线迁移或新旧版本混跑安全。
|
|
189
195
|
4. 启动新实例并等待 `/health/ready` 返回 200。
|
|
190
196
|
5. 逐个替换旧实例,观察队列、错误率和租约恢复。
|
|
191
197
|
6. 确认无异常后再清理旧镜像。
|
|
@@ -204,7 +210,7 @@ scrape_configs:
|
|
|
204
210
|
|
|
205
211
|
恢复顺序:
|
|
206
212
|
|
|
207
|
-
1.
|
|
213
|
+
1. 停止所有中枢副本和其他共享存储写入者接收新工作,确认后台 SQL、审批及通知等工作已经排空;仅摘除入口流量不等于停止写入。
|
|
208
214
|
2. 恢复 MySQL 与共享对象存储。
|
|
209
215
|
3. 使用与备份迁移版本兼容的中枢镜像启动一个实例。
|
|
210
216
|
4. 检查 `/health/ready`、系统体检和关键任务 trace。
|
|
@@ -221,6 +227,12 @@ scrape_configs:
|
|
|
221
227
|
- 送达死信重投:内置渠道继续通过渠道凭证发送;自定义 `X-notify` 死信只重排原失败通知子任务,回复 `queued` 表示已进入执行器队列。永久 DLQ 重投标记与原子入队一起保存,重复请求或 resolve 回包丢失不会重复入队,业务父任务不会重跑。旧死信按原 Job 验证承接器,绑定不符返回 409,旧扩展缺少重投端口返回 503;人工可检查原通知子任务。
|
|
222
228
|
- 历史 v0.9.3 的排空不提供 SIGKILL 后的全量通知 outbox。Core v0.9.4 增加[通知持久化](NOTIFICATION_DURABILITY.md)和 068 迁移:新终态/审批创建与意图同事务,重启仅补通知;普通告警及旧扩展保留尽力发送边界。接收方仍需按事件 ID 去重,部分或未知送达不能盲目重发。
|
|
223
229
|
|
|
230
|
+
### Standalone 启动恢复关闭屏障(未发布候选)
|
|
231
|
+
|
|
232
|
+
本候选新增的关闭屏障尚不包含在已发布的 Core v0.9.4 中。启动恢复未触发时取消定时器;已经触发时,`kernel.close(drainMs)` 等待目标刷新、恢复查询、审计及重新排队完成。出现 `boot recovery drain timed out` 时,Kernel 保留资源并停止接收新工作;宿主应排查数据库锁等待等阻塞,随后在**同一个 Kernel 实例**重试 `close()`,不要强关连接池绕过屏障。
|
|
233
|
+
|
|
234
|
+
此重试能力属于 Kernel API。默认 CLI 的信号停机失败会以状态码 1 退出,不提供自动重试;重复调用 `server.shutdown()` 也不等于重试 Kernel 关闭。该屏障不承诺抵抗强制退出,也不替代持久恢复和业务结果核对。
|
|
235
|
+
|
|
224
236
|
## 8. 安全基线
|
|
225
237
|
|
|
226
238
|
- 仅通过 HTTPS 暴露公网入口。
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -99,7 +99,7 @@ node bailing-executor.mjs --hub <中枢地址> --targets <目标名> \
|
|
|
99
99
|
|
|
100
100
|
**第 9 步 · 给 AI 接工具**(要"能查、能办"时,「工具源」+「审批意图」):
|
|
101
101
|
|
|
102
|
-
1. 业务系统声明可调接口 + 实现验签中间件。**PHP 业务直接用 SDK**(`sdk/php/`,零依赖):控制器方法标 `#[AiTool(...)]` 注解(完整字段注册表见 CONTRACT §2.4a,构建期自动体检),`SpecServer` 一行挂出 `/.well-known/bailing/tools.json`,`Verify::toolCall`
|
|
102
|
+
1. 业务系统声明可调接口 + 实现验签中间件。**PHP 业务直接用 SDK**(`sdk/php/`,零依赖):控制器方法标 `#[AiTool(...)]` 注解(完整字段注册表见 CONTRACT §2.4a,构建期自动体检),`SpecServer` 一行挂出 `/.well-known/bailing/tools.json`,`Verify::toolCall` 即验签;PHP 7、Node.js、Python、Java、Go、.NET 也有官方 SDK(见 `sdk/` 各语言 README);按所用语言选择声明构建、验签和授权接缝。不使用 SDK 时按 CONTRACT 实现,并用冻结测试向量验证;
|
|
103
103
|
2. 控制台「工具源」注册:base_url + 签名密钥 + spec(粘贴或 URL 拉取,推荐业务把 spec 发布到 `/.well-known/bailing/tools.json` 并开自动刷新)。URL 来源只有“签名保护”和“允许公开”两项可选,默认前者;只有你明确接受任何 URL 访问者都能看到接口路径、参数和风险声明时,才选后者。签名保护刷新会在正确签名读取后补做未签名/错误签名负向探测,未实测通过就拒绝覆盖、继续用旧缓存;允许公开以未签名请求读取,不会偷偷改用签名。列表把“期望策略”和“实测结果”分开显示;PHP/PHP7 SDK 在受保护响应上自动加 `Cache-Control: private, no-store`。业务侧新标注的接口会自动成为工具,清单增删/风险变化会审计并告警;「工具清单」预览能看到哪些接口进来了、哪些被跳过及原因;「授权探针」另行显示业务侧是否对合成越权主体 fail-closed;页面右上「开发文档」跳转官网对应文档;
|
|
104
104
|
3. 路由挂 `tools`:`{"sources":[{"provider":"你的工具源","allow":["tenant.staff.*"],"subject_field":"operator_uid"}],"max_calls":5}` ——每个来源的 `allow` 是 scope 白名单(双闸:业务标了 ∩ 路由允许才暴露);`subject_field` 指明 metadata 里哪个字段是操作主体,业务后端触发时写入(全程不经 LLM);跨系统场景可在 `sources` 继续添加来源;
|
|
105
105
|
4. 完成。llm 走 function-calling 循环;执行器大脑(自研智能体 / 脚本 / 第三方运行时)认领件里自带工具清单 + `tool_token`,curl 中枢代理即可调用——两条路走**同一套**白名单/风险闸/限流/审计/签名出口。
|
package/docs/README.en.md
CHANGED
|
@@ -6,6 +6,11 @@ This directory contains public documentation for the open-source BailingHub proj
|
|
|
6
6
|
|
|
7
7
|
| Document | Purpose |
|
|
8
8
|
|---|---|
|
|
9
|
+
| [RELEASE_NOTES_v0.10.0.en.md](RELEASE_NOTES_v0.10.0.en.md) · [Chinese](RELEASE_NOTES_v0.10.0.md) | v0.10.0: on-demand knowledge, console consistency, larger arguments and model budgets. |
|
|
10
|
+
| [UPGRADE_v0.10.0.en.md](UPGRADE_v0.10.0.en.md) · [Chinese](UPGRADE_v0.10.0.md) | No new SQL from 0.9.4; readiness, client pairing, explicit policies and rollback. |
|
|
11
|
+
| [AGENT_KNOWLEDGE_API.en.md](AGENT_KNOWLEDGE_API.en.md) · [Chinese](AGENT_KNOWLEDGE_API.md) | Agent-only knowledge hints, search, authorized references and bounded reads. |
|
|
12
|
+
| [MODEL_OUTPUT_BUDGET.en.md](MODEL_OUTPUT_BUDGET.en.md) · [Chinese](MODEL_OUTPUT_BUDGET.md) | Default budgets, service ceilings, provider parameters and reasoning scope. |
|
|
13
|
+
| [MODEL_CONTINUATION.en.md](MODEL_CONTINUATION.en.md) · [Chinese](MODEL_CONTINUATION.md) | Host continuation, original-operation recovery and tool deduplication. |
|
|
9
14
|
| [IMPLEMENTATION_STATUS.en.md](IMPLEMENTATION_STATUS.en.md) · [Chinese](IMPLEMENTATION_STATUS.md) | Core ownership, formal releases versus main, public evidence, and uncovered scope. |
|
|
10
15
|
| [RELEASE_NOTES_v0.9.4.en.md](RELEASE_NOTES_v0.9.4.en.md) · [Chinese](RELEASE_NOTES_v0.9.4.md) | v0.9.4: DOCX dependency remediation, durable notifications and console recovery. |
|
|
11
16
|
| [UPGRADE_v0.9.4.en.md](UPGRADE_v0.9.4.en.md) · [Chinese](UPGRADE_v0.9.4.md) | Explicit migration 068, state/configuration databases, event deduplication and rollback limits. |
|
package/docs/README.md
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
| 文档 | 用途 |
|
|
10
10
|
|---|---|
|
|
11
|
+
| [RELEASE_NOTES_v0.10.0.md](RELEASE_NOTES_v0.10.0.md) · [English](RELEASE_NOTES_v0.10.0.en.md) | v0.10.0:知识按需读取、后台交互、大参数与模型预算。 |
|
|
12
|
+
| [UPGRADE_v0.10.0.md](UPGRADE_v0.10.0.md) · [English](UPGRADE_v0.10.0.en.md) | 相对 0.9.4 无新 SQL;readiness、配套客户端、显式策略与回退边界。 |
|
|
13
|
+
| [AGENT_KNOWLEDGE_API.md](AGENT_KNOWLEDGE_API.md) · [English](AGENT_KNOWLEDGE_API.en.md) | 智能体专用的知识提示、搜索、受授权引用与有界分页读取。 |
|
|
14
|
+
| [MODEL_OUTPUT_BUDGET.md](MODEL_OUTPUT_BUDGET.md) · [English](MODEL_OUTPUT_BUDGET.en.md) | 默认预算、服务上限、供应商参数与思考语义。 |
|
|
15
|
+
| [MODEL_CONTINUATION.md](MODEL_CONTINUATION.md) · [English](MODEL_CONTINUATION.en.md) | 宿主续段、原 operation 恢复和工具防重的责任边界。 |
|
|
11
16
|
| [IMPLEMENTATION_STATUS.md](IMPLEMENTATION_STATUS.md) · [English](IMPLEMENTATION_STATUS.en.md) | Core 能力归属、正式发行与主分支状态、公开证据和未覆盖范围。 |
|
|
12
17
|
| [RELEASE_NOTES_v0.9.4.md](RELEASE_NOTES_v0.9.4.md) · [English](RELEASE_NOTES_v0.9.4.en.md) | v0.9.4:DOCX 依赖处置、通知持久化与控制台补发。 |
|
|
13
18
|
| [UPGRADE_v0.9.4.md](UPGRADE_v0.9.4.md) · [English](UPGRADE_v0.9.4.en.md) | 068 显式迁移、状态/配置库、事件去重和回退限制。 |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Current release: Core 0.
|
|
1
|
+
# Current release: Core 0.10.0
|
|
2
2
|
|
|
3
|
-
Core 0.
|
|
3
|
+
Core 0.10.0 adds Agent-only on-demand knowledge, full tool guidance and explicit model-output policies, with onboarding, draft, approval and diagnostic interaction fixes. No new SQL is added relative to 0.9.4. Existing clients, model configurations and bundled chat retain compatible behavior. MCP / Agent Client SDK 0.8.0 and DSH 0.8.0 upgrade independently; hosts implement their own task continuation.
|
|
4
4
|
|
|
5
|
-
[Core 0.
|
|
5
|
+
[Core 0.10.0 release notes](RELEASE_NOTES_v0.10.0.en.md) · [Upgrade guide](UPGRADE_v0.10.0.en.md) · [简体中文](RELEASE_NOTES_NEXT.md)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# 当前版本:Core 0.
|
|
1
|
+
# 当前版本:Core 0.10.0
|
|
2
2
|
|
|
3
|
-
Core 0.9.4
|
|
3
|
+
Core 0.10.0 增加智能体专用的知识按需搜索与读取、工具完整指导和显式模型预算,并修复首次接入、草稿、审批与排障交互。相对 0.9.4 无新增 SQL;旧客户端、旧模型配置和自带聊天保留兼容行为。MCP / Agent Client SDK 0.8.0、DSH 0.8.0 独立升级,宿主自行实现任务续段。
|
|
4
4
|
|
|
5
|
-
[Core 0.
|
|
5
|
+
[Core 0.10.0 版本说明](RELEASE_NOTES_v0.10.0.md) · [升级指南](UPGRADE_v0.10.0.md) · [English](RELEASE_NOTES_NEXT.en.md)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Core v0.10.0: Discover capabilities, then read the knowledge you need
|
|
2
|
+
|
|
3
|
+
[简体中文](RELEASE_NOTES_v0.10.0.md)
|
|
4
|
+
|
|
5
|
+
A local agent checking inventory should not always receive several unrelated documents. A larger page design should not hit a small argument limit before dispatch. Relative to public 0.9.4, Core 0.10.0 adds on-demand knowledge and tool guidance, aligns bounded argument capacity, and improves model-budget configuration, onboarding and diagnostics.
|
|
6
|
+
|
|
7
|
+
The component set is **Core 0.10.0, MCP / Agent Client SDK 0.8.0 and DSH 0.8.0**. These are independent releases. Existing tool clients and bundled chat remain usable; update the corresponding consumer when adopting new host features or fixing its independent argument limit. No new SQL is added relative to 0.9.4, and this is not a 1.0 stability declaration.
|
|
8
|
+
|
|
9
|
+
## What changes
|
|
10
|
+
|
|
11
|
+
### Agents can read hints before requesting documents
|
|
12
|
+
|
|
13
|
+
New Agent Session knowledge `capabilities / search / read` endpoints support explicit negotiation. A host that selects `knowledge_delivery: "on_demand"` receives bounded hints and reads authorized, revision-bound references only when needed. Search and pagination have byte/count/expiry limits. Expired references or changed authority require rediscovery; knowledge never bypasses subject, route or approval boundaries.
|
|
14
|
+
|
|
15
|
+
Clients that omit the option retain inline knowledge. **Bundled chat, embed and widget retain server-side retrieval and full context assembly.** Knowledge and execution summaries are reference material, not permission grants or a complete user-level long-term memory system.
|
|
16
|
+
|
|
17
|
+
### Short descriptions no longer silently discard longer guidance
|
|
18
|
+
|
|
19
|
+
Discovery keeps short descriptions and identifies available guidance and actual truncation separately. Named guidance reads recheck current authority and capability revision. Standard summary, description, ACC guidance and the first example are retained within bounds. Discovery distinguishes authorized candidates, returned results and an unknown exact match total; a full result list is not proof of exact relevance.
|
|
20
|
+
|
|
21
|
+
Discovery revisions remain separate from frozen execution fingerprints. Guidance-only changes do not require repeating an approved business operation; original invocations retain their identity and arguments.
|
|
22
|
+
|
|
23
|
+
### Larger arguments stay intact and limits identify their boundary
|
|
24
|
+
|
|
25
|
+
Tool arguments are measured as the UTF-8 bytes of actual `JSON.stringify(arguments)`, with a **1 MiB** maximum and **2 MiB** tool-call HTTP envelopes. Core and the independent MCP/SDK limits align. Objects stay objects. Capability schemas, signatures, authority, approvals, idempotency and the business system's own limits remain effective.
|
|
26
|
+
|
|
27
|
+
Oversize replies retain `arguments_too_large`, `not_dispatched` and safe actual/allowed or observed byte counts, never the body. Full approval arguments remain linked to their digest; notifications contain bounded previews and the console cannot approve before loading the complete arguments. Updating Core alone does not change an older client's own smaller limit.
|
|
28
|
+
|
|
29
|
+
### Default output budgets and service ceilings are separate
|
|
30
|
+
|
|
31
|
+
An optional explicit policy declares a default budget, service ceiling, actual output parameter and `completion_total / final_answer` scope. Operators verify the real model route; Core neither guesses from model names nor enlarges every budget. Existing services keep their configuration and behavior. Image tools do not use chat output budgets.
|
|
32
|
+
|
|
33
|
+
The wrong parameter produces a clear pre-dispatch rejection rather than silently renaming `max_tokens` to `max_completion_tokens`. Original operations and digests stay intact. A model-output cutoff is distinct from transport uncertainty; the host decides any next segment within task authority. **Core neither retries the model automatically nor implements a client's long-task continuation loop.**
|
|
34
|
+
|
|
35
|
+
### Setup and troubleshooting retain context
|
|
36
|
+
|
|
37
|
+
Onboarding, invocation examples and permission wording are clearer. Routes, clients and tool sources protect unsaved forms. Approval continuation differs from a new task rerun; diagnostic navigation preserves filters, tabs and return positions. Late responses cannot overwrite the current object. Drawer help is placed behind question marks while risks and errors remain visible, and login-password autofill is blocked in configuration forms.
|
|
38
|
+
|
|
39
|
+
The read-only `doctor --upgrade-plan` compares explicitly supplied artifacts and redacted migration snapshots without connecting to a database or applying migrations. Kernel boot recovery participates in shutdown drain. Readiness checks actual state/configuration resources and full migration digests. Custom MySQL stores must expose `schemaReadinessDb` or fail closed; see the upgrade guide.
|
|
40
|
+
|
|
41
|
+
## Who needs to change
|
|
42
|
+
|
|
43
|
+
| User | Impact |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| Hub operators | Upgrade the complete artifact, back up and drain, and verify actual storage readiness. Explicit model policies are opt-in; existing budgets do not change automatically. |
|
|
46
|
+
| Business backends | Existing HTTP/HMAC/ACC identity and authority remain intact. No endpoint rewrite is required. Keep business field, body and storage limits. |
|
|
47
|
+
| MCP/SDK and DSH host developers | Adopt 0.8.0 for larger arguments, on-demand knowledge, budget helpers and disclosure confirmation. Never rewrite saved requests. Hosts still own final model serialization, executable tool registration and task loops. |
|
|
48
|
+
| Kernel Host developers | Default stores support actual-resource readiness. Custom MySQL stores expose their real read-only resource. Independent Host pins, artifacts and deployments need their own checks. |
|
|
49
|
+
|
|
50
|
+
## Upgrade and verify
|
|
51
|
+
|
|
52
|
+
Follow the [0.10.0 upgrade guide](UPGRADE_v0.10.0.en.md) to preserve configuration, data, original calls and rollback material. There is no new SQL from 0.9.4; earlier versions still need outstanding migrations on their original upgrade path.
|
|
53
|
+
|
|
54
|
+
Verify exact Tag/commit, package identity and migration ledger, then check `/health/ready`, onboarding, save/cancel behavior, original approvals and read-only receipts. Test larger arguments and new knowledge behavior with isolated data. Basic acceptance needs no paid model call or modification of a real business page.
|
|
55
|
+
|
|
56
|
+
Public regressions cover synthetic providers, authority/revision changes, byte bounds, original-operation recovery, persistence and lifecycle. They do not establish acceptance of every provider, desktop product or external business side effect. Knowledge may be paginated or truncated; timeout, context, input-size, vendor hard limits and account allowance remain bounded. Synthetic tests do not replace non-author integration or long-term observation.
|
|
57
|
+
|
|
58
|
+
[Knowledge protocol](AGENT_KNOWLEDGE_API.en.md) · [Runtime API](AGENT_CLIENT_RUNTIME_API.en.md) · [Model budgets](MODEL_OUTPUT_BUDGET.en.md) · [Host continuation and recovery](MODEL_CONTINUATION.en.md) · [Changelog](CHANGELOG.en.md)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Core v0.10.0:先找能力,再按需读取相关知识
|
|
2
|
+
|
|
3
|
+
[English](RELEASE_NOTES_v0.10.0.en.md)
|
|
4
|
+
|
|
5
|
+
一个本地智能体只是查库存,却同时收到多篇业务文档;另一个正在提交较大的页面设计,尚未派发就触及小参数限额。Core 0.10.0 相对公开 0.9.4 增加按需知识与工具指导,统一有界参数容量,并让管理员更清楚地配置模型预算、接入和排障。
|
|
6
|
+
|
|
7
|
+
配套为 **Core 0.10.0、MCP / Agent Client SDK 0.8.0、DSH 0.8.0**。它们分别发行:原有工具调用、旧客户端和自带聊天可继续使用;只有采用新宿主能力或修复客户端独立小上限时才需要对应升级。相对 0.9.4 没有新增 SQL,不宣告 1.0 稳定承诺。
|
|
8
|
+
|
|
9
|
+
## 更新了什么
|
|
10
|
+
|
|
11
|
+
### 智能体可以先看提示,再读需要的知识
|
|
12
|
+
|
|
13
|
+
新增 Agent Session 专用知识 `capabilities / search / read`。宿主先确认协议,显式使用 `knowledge_delivery: "on_demand"` 后,准备结果提供有界提示,正文由受授权、带修订的引用按需读取。搜索与分页都有大小、数量和有效期限制;引用过期或授权变化需重新发现,不能绕过主体、路由或审批边界。
|
|
14
|
+
|
|
15
|
+
旧客户端不传该选项时仍收到 inline 知识。**自带聊天、embed 和 widget 继续原有服务端检索与正文装配**。知识和执行摘要始终是参考材料,不授予权限,也不是完整用户长期记忆。
|
|
16
|
+
|
|
17
|
+
### 工具说明不再被短摘要截断后悄悄丢失
|
|
18
|
+
|
|
19
|
+
工具目录继续使用简短说明,并明确详细指导是否可读、短说明是否被截断。按名读取指导会重新检查当前授权和能力修订;标准 summary、description、ACC 指导及首个示例有界保留。发现回执区分授权候选数、实际返回数与未知匹配总数;不把凑满结果解释为精确匹配。
|
|
20
|
+
|
|
21
|
+
发现修订与冻结执行指纹分开。仅指导文字变化不会要求重做已经批准的业务调用,旧 invocation 仍按原身份与参数核对。
|
|
22
|
+
|
|
23
|
+
### 大参数保持完整,超限说明发生在哪里
|
|
24
|
+
|
|
25
|
+
工具 arguments 统一按实际 `JSON.stringify(arguments)` 的 UTF-8 字节数检查,允许最多 **1 MiB**;工具调用 HTTP 信封最多 **2 MiB**。Core 与 MCP/SDK 的独立限额配套更新。对象继续是对象,原能力字段、签名、授权、审批、幂等和业务系统自己的限额仍独立生效。
|
|
26
|
+
|
|
27
|
+
超限保留 `arguments_too_large`、`not_dispatched` 与允许/实际或已观察字节数,不回显正文。完整审批参数与摘要保持对应;通知只携带有界预览,控制台在完整参数读取完成前不能批准。升级 Core 不会自动修复旧客户端自己较小的限额。
|
|
28
|
+
|
|
29
|
+
### 默认输出预算与服务上限分开
|
|
30
|
+
|
|
31
|
+
可选显式模型策略分别描述默认预算、服务上限、实际输出参数及 `completion_total / final_answer` 范围。管理员按实际模型路由核实语义;Core 不按模型名猜测,也不统一放大预算。旧服务保持原配置和行为,图片工具不使用对话输出预算。
|
|
32
|
+
|
|
33
|
+
错误参数得到明确的派发前拒绝,不静默把 `max_tokens` 改成 `max_completion_tokens`。原 operation 和摘要保持不变;单次生成被截断不等于网络执行未知,下一段由宿主在任务授权内决定。**本版不在中枢自动重试模型,也不替客户端实现长任务续跑循环。**
|
|
34
|
+
|
|
35
|
+
### 后台与升级排障更连贯
|
|
36
|
+
|
|
37
|
+
首次接入引导、调用示例和权限文案更加一致;路由、接入方和工具源支持未保存保护。审批续办与新任务重跑区分,诊断跳转保留筛选、页签和返回位置;迟到响应不能覆盖当前对象。编辑抽屉的常规说明收敛到问号,风险和错误保持可见,并防止登录密码自动填入配置表单。
|
|
38
|
+
|
|
39
|
+
新增只读 `doctor --upgrade-plan`,比较明确提供的制品与脱敏迁移快照,不连接数据库或执行迁移。Kernel 启动恢复参与关闭排空;readiness 核对实际 state/configuration 资源及完整迁移摘要。自定义 MySQL store 须提供 `schemaReadinessDb`,否则失败关闭,详见升级指南。
|
|
40
|
+
|
|
41
|
+
## 谁需要调整
|
|
42
|
+
|
|
43
|
+
| 使用者 | 升级影响 |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| 中枢管理员 | 更新完整制品,备份并排空;核对真实存储 readiness。模型显式策略按需启用,不自动修改现有预算。 |
|
|
46
|
+
| 业务后端 | 原 HTTP/HMAC/ACC 身份和权限契约保持;本版不要求重写接口。继续执行业务字段、正文和存储上限。 |
|
|
47
|
+
| MCP/SDK 或 DSH 宿主开发者 | 采用 0.8.0 获取大参数修复、知识按需入口、预算帮助函数及披露确认。旧请求不可改写,客户端仍负责最终模型请求、工具注册与任务循环。 |
|
|
48
|
+
| Kernel Host 开发者 | 默认 store 已支持真实资源 readiness;自定义 MySQL store 应暴露实际只读资源。独立 Host 的 pin、制品和部署另行核对。 |
|
|
49
|
+
|
|
50
|
+
## 如何升级与确认
|
|
51
|
+
|
|
52
|
+
按 [0.10.0 升级指南](UPGRADE_v0.10.0.md)保留配置、数据、原调用和回滚材料。0.9.4 到本版没有新 SQL;更早版本仍需原升级链中的迁移。
|
|
53
|
+
|
|
54
|
+
核对精确 Tag/提交、包版本与迁移账本;检查 `/health/ready`、首次接入、保存/取消、原审批及只读回执。仅在独立测试数据中验证大参数和新知识协议;无需为基础验收调用付费模型或修改真实业务页面。
|
|
55
|
+
|
|
56
|
+
公开回归覆盖合成供应商、权限/修订变化、大小边界、原 operation 恢复、持久化与生命周期;不代表所有供应商、客户端产品或外部业务副作用已验收。知识正文可能分页或截断;超时、上下文、输入大小、模型供应商硬限制与账户额度仍有界。非作者接入和长期稳定性不能由这些合成测试替代。
|
|
57
|
+
|
|
58
|
+
[知识协议](AGENT_KNOWLEDGE_API.md) · [Runtime API](AGENT_CLIENT_RUNTIME_API.md) · [模型预算](MODEL_OUTPUT_BUDGET.md) · [宿主续段与恢复](MODEL_CONTINUATION.md) · [CHANGELOG](CHANGELOG.md)
|