From 7613499dfbaca48cd273934a6e1f3c3d1c206b85 Mon Sep 17 00:00:00 2001 From: my_local_kimi_dev2 Date: Tue, 22 Sep 2026 11:24:22 +0800 Subject: [PATCH] =?UTF-8?q?docs(agent-service):=20AGENTS.md=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E7=94=9F=E4=BA=A7=20ES=207.7.1=20=E4=B8=8E=E9=AB=98?= =?UTF-8?q?=E9=98=B6=E5=AE=A2=E6=88=B7=E7=AB=AF=E4=B8=8D=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E7=9A=84=E5=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaoqu-agent-service/AGENTS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xiaoqu-agent-service/AGENTS.md b/xiaoqu-agent-service/AGENTS.md index 2474a8a..b2898e8 100644 --- a/xiaoqu-agent-service/AGENTS.md +++ b/xiaoqu-agent-service/AGENTS.md @@ -15,6 +15,11 @@ - 任务跨项目用 `move_task`,再 `link_tasks_to_requirement`(role=implementation)。 - 本机无 ai-proj CLI,远程同步需在有 CLI 的机器执行 `ai-proj sync requirement --id --direction to_remote`。 +## 生产 ES 集群关键坑 + +- 生产两个 ES 集群(cloud/local,app.es.cloud/local.*)均为 **ES 7.7.1**:elasticsearch-java 7.17 高阶客户端(ElasticsearchClient)的 vendor Content-Type(`application/vnd.elasticsearch+json; compatible-with=7`)被 406 拒绝,且其 X-Elastic-Product 响应头校验(7.14 才引入)过不了——**业务 ES 查询一律注入低阶 `esCloudRestClient`/`esLocalRestClient`(RestClient)bean**,不要注入 esCloudClient/esLocalClient(EsClientConfig 里仅为兼容保留)。 +- 低阶 `org.elasticsearch.client.Response` 构造器包私有且参数是 HttpResponse,测试里用 `mock(Response.class)` + stub `getEntity()` 构造;注意 `thenReturn(esResponse(...))` 里嵌套 when() 会触发 UnfinishedStubbingException,必须先创建好 Response 再 stub。 + ## 生产部署要点 - `./deploy/deploy.sh remote-deploy`(SSH 别名 xiaoqu-prd,目录 /data/xiaoqu-agent-service)。