fix(cfg): 路A PATCH /session→/sessions 复数(AgentScope 2.0.2 router prefix=/sessions,单数对真 Service 必 404;D 波对账读发现、fable 复核框架源码+bootstrap.py 双证后修;含测试断言与 javadoc 三处;受影响 43 测复跑绿)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
a8dd5e500e
commit
22444fd5e8
@ -16,7 +16,7 @@ import java.util.Map;
|
||||
* <p>路 A = 两次 PATCH(AgentScope create_app REST):
|
||||
* <ul>
|
||||
* <li>{@code PATCH {service}/agent/{agentId}} —— system_prompt / context_config / react_config(partial 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 整替)
|
||||
// 注意是复数 /sessions:AgentScope 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());
|
||||
}
|
||||
|
||||
|
||||
@ -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_config:type/credential_id/model/parameters)
|
||||
*/
|
||||
|
||||
@ -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"));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user