fix(cfg): 路A PATCH /session→/sessions 复数(AgentScope 2.0.2 router prefix=/sessions,单数对真 Service 必 404;D 波对账读发现、fable 复核框架源码+bootstrap.py 双证后修;含测试断言与 javadoc 三处;受影响 43 测复跑绿)
Some checks failed
contract-gates / contract-gates (push) Has been cancelled
docs-gate / docs-gate (push) Has been cancelled

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
lili 2026-07-04 11:27:24 -07:00
parent a8dd5e500e
commit 22444fd5e8
3 changed files with 7 additions and 5 deletions

View File

@ -16,7 +16,7 @@ import java.util.Map;
* <p> A = 两次 PATCHAgentScope create_app REST
* <ul>
* <li>{@code PATCH {service}/agent/{agentId}} system_prompt / context_config / react_configpartial update</li>
* <li>{@code PATCH {service}/session/{sessionId}?agent_id={agentId}} <b>完整</b> chat_model_config整替语义</li>
* <li>{@code PATCH {service}/sessions/{sessionId}?agent_id={agentId}} <b>完整</b> chat_model_config整替语义</li>
* </ul>
* 写进 Service Redis 下一个 POST /chat 现装配即生效设计 §3.3<b>两次 PATCH 都成功才算路 A 成功</b>
* 任一失败即路 A 失败由编排层补偿重推路 A 回上一激活版含把两次 PATCH 都重推回旧内容覆盖 intra-路A 半应用
@ -74,8 +74,10 @@ public class AgentServicePatchClient {
if (!a.ok()) {
return a;
}
// PATCH /session/{sessionId}?agent_id={agentId}完整 chat_model_config 整替
String sessionUrl = root + "/session/" + enc(pathA.sessionId()) + "?agent_id=" + enc(pathA.agentId());
// PATCH /sessions/{sessionId}?agent_id={agentId}完整 chat_model_config 整替
// 注意是复数 /sessionsAgentScope 2.0.2 session router prefix="/sessions"app/_router/_session.py:87
// 我方 bootstrap.py 同用复数;单数 /session 对真 Service 404(D 波对账读发现,fable 复核框架源码修正)
String sessionUrl = root + "/sessions/" + enc(pathA.sessionId()) + "?agent_id=" + enc(pathA.agentId());
return doPatch("路A/session", sessionUrl, headers, pathA.sessionBodyJson());
}

View File

@ -23,7 +23,7 @@ public record GenConfigActivationPayload(PathA pathA, String pathBJson) {
* A 下发目标与请求体Service-shaped字段名已是 AgentScope /agent+/session 认的 snake_case透传不再转名
*
* @param agentId PATCH 目标 agent id决定 /agent/{agentId} /session?agent_id=
* @param sessionId PATCH 目标 session id决定 /session/{sessionId}
* @param sessionId PATCH 目标 session id决定 /sessions/{sessionId}
* @param agentBodyJson PATCH /agent 的请求体 JSON system_prompt + 可选 context_config/react_config
* @param sessionBodyJson PATCH /session 的请求体 JSON<b>完整</b> chat_model_configtype/credential_id/model/parameters
*/

View File

@ -75,7 +75,7 @@ class AgentServicePatchClientTest {
// /session agent_id query
Call s = stub.calls.get(1);
assertEquals("PATCH", s.method());
assertEquals("http://lab:18300/session/s1?agent_id=a1", s.url());
assertEquals("http://lab:18300/sessions/s1?agent_id=a1", s.url());
assertTrue(s.body().contains("chat_model_config"));
}