feat(open-3qfx): 开放接口按 taskId 直接发起 3qfx 第一次问答
新增 POST /api/open/3qfx/ask(无需登录,/api/open/ 白名单 + CSRF 豁免):
只传一个 taskId,后端解析 3Q 业务配置的智能体 + 按 id 拉取 cop-task-detail
拼出与前端一致的开场白,新建带 metadata.{taskId,agent_id} 的真实会话并后台
启动持久化运行,立即返回 thread_id(随后在 3qfx 任务工作区对话列表观看)。
- start_run() 增加 keyword-only enforce_access(默认 True);开放接口传 False
绕过按当前(无)登录用户的智能体可见性校验
- task_deeplink 配置新增 cop_task_detail_url / _authorization / _test + mock
- tests/test_open_3qfx.py(10 项,tests/ 被 .gitignore 故未入库)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d35d121261
commit
fe7c6cb8f7
6 files changed
+223
-1
No files matched your search
+12
@@ -41,6 +41,18 @@ class TaskDeeplinkConfig(BaseModel):
|
||||
default=False,
|
||||
description="为真时前端「行动→任务」解析走 mock.action_detail 假数据(不打真实接口)",
|
||||
)
|
||||
cop_task_detail_test: bool = Field(
|
||||
default=False,
|
||||
description="为真时开放接口 POST /api/open/3qfx/ask 按 taskId 取任务详情走 mock.cop_task_detail 假数据(上游 consumer 不可达时用)",
|
||||
)
|
||||
cop_task_detail_url: str = Field(
|
||||
default="",
|
||||
description="任务详情接口完整 URL(开放接口 /api/open/3qfx/ask 后端按 taskId 拉取,追加 ?taskId=);与前端 cop-task-detail 同一上游。留空则该开放接口报 503。",
|
||||
)
|
||||
cop_task_detail_authorization: str = Field(
|
||||
default="Bearer admin",
|
||||
description="拉取任务详情时下发的 Authorization 头(与前端 axios 拦截器一致,默认 Bearer admin)",
|
||||
)
|
||||
purpose_detail_url: str = Field(
|
||||
default="",
|
||||
description="目的树查询完整 URL,调用时追加 ?taskId=",
|
||||
|
||||
Reference in new issue
Block a user