Repository navigation
chore: sync flocksdev/dev into dev (2026.11.18) - #813
Merged
Merged
Conversation
模型服务的流式响应没有可识别的 delta 时,非流式兜底只取 content:模型只返回工具调用 (content 为 null)就被当成空回答,随后把工具声明去掉再问一次,模型只能把调用写成 DSML 文本,或回答“本轮没有可用工具”。 - openai_compatible / openai_base 的 chat() 带回 tool_calls、reasoning、reasoning_source、 reasoning_details(ChatResponse 增加后两个可选字段) - 空流兜底拿到工具调用时按 reasoning → 文本 → 带 tool_calls 的终止块回放;空参数只在 正常结束时当成无参调用,finish_reason 为 length / max_tokens 时保持为空,由累加器按截断拒绝 - 去掉工具重问只留给 MiniMax(原有兜底);其他模型抛可重试的 empty streaming response, 会话带着工具重试;openai_compatible.chat() 遇到空 choices 抛 empty choices(原为 IndexError)
…ion-order fix(session): 修复新会话在侧栏刷新前后排序跳动
fix(provider): 流式响应为空时不再扔掉工具调用,也不再去掉工具重问
When the server refuses the bot's credentials, the WeCom SDK only emits an error event and closes the socket itself; with websockets >= 14 that clean close ends its receive loop, so it neither reconnects nor reports a disconnect. The gateway had already marked the channel connected 0.5s after start(), so a wrong secret showed the channel as running with no error. A connection replaced by the same bot elsewhere (disconnected_event) stopped the SDK the same way, and network failures only surfaced as "reconnect timed out" after 60s. - Declare self_managed_connection: connected only once authenticated. - Record each SDK error in the channel status. Refused credentials and a replaced connection end start(), so the gateway shows the reason and retries with backoff. - The reconnect watchdog message names the last error. - Events from a client that has since been replaced are ignored. - The status only gives the cause, scheme://host:port, the error type and numeric codes (WeCom errcode, errno, HTTP status). The raw error can quote a credential-bearing address and the status is readable by every signed-in user, so it is written to the server log (wecom.ws.error) only.
Admins read channel credentials as their {secret:...}, {env:...} or
{file:...} reference, and the channel page put that text into the secret
field as its value. Users took the secret for lost, and typing a new one
after the reference saved "{secret:...}new": the stored value plus the new
one, which then fails authentication.
- A whole-value reference renders as an empty field marked as saved; typing
replaces it.
- An emptied field reports undefined for every caller, so the save leaves
the stored credential alone. Nested Feishu accounts used to send an empty
string here, which overwrote the stored reference.
- The email password and access token fields no longer share one input
instance across auth modes.
- The header badge says "connection error" while the gateway waits to
retry, matching the status panel and the channel list.
升级单元说这次失败可以重试(retryable)时,弹窗出现「重试这个版本」,二次确认后带上 那次失败的 id 调 releaseUpdate.start;服务端核对在 flockspro 的配套改动里。
…lesce plugin reloads (INC-5959A657)
…ed-secret
fix(wecom): 连不上时页面写明原因,已保存的 Secret 不再显示成 {secret:…} 引用
…ease fix(update): 企业版更新弹窗在新版本没起来时可确认重试同一版本
fix(device): 设备接入页切走后不再在后台反复全量同步,并合并并发的插件重载 (INC-5959A657)
父会话 memory_enabled=False 时,Session.create 建出的子会话(delegate_task 派的子 Agent、fork)也关记忆,调用方显式传 True 或子 Agent 默认开记忆都不改变;prepare_session_for_agent 按专用 Agent 的策略写记忆开关时,不再把这类子会话重新打开,读不到父会话时只保持子会话原状。HTTP、CLI 和会话循环运行前都走这一处。 此前关了记忆的会话(会话设置里关掉,或企业版代码审计问答这类隔离 Agent)派出去的子 Agent 仍按自己的默认开记忆,上下文压缩时会把对话内容写进每日记忆。
扩展用 Agent.register 注册的子 Agent 是在生成 Rex 提示词之后才合并进注册表的:/agents 命令里有它、delegate_task 按名字也能派,但 Rex 的 Available Agents 表和 Security Routing 表里没有,Rex 不知道可以派给它。 新增 _delegation_candidates,生成提示词时把注册的 Agent 一起算进委派候选,规则和后面的合并一致:不盖受管名字,过 enabled_agents 白名单,hidden、primary、不可委派的照旧排除;不修改已加载的字典和注册的定义。
… backend The suite's five database clients (triage workflow, query tool, dashboard and overview handlers, alert contract) opened SQLite themselves, so a database backend other than SQLite had to swap those files. They now read and write through flocks.workflow.soc_store, a module a database backend replaces (db_backend.REPLACEABLE_MODULES): the open product implements it on SQLite, and the same files run unchanged on another backend's implementation. - flocks/workflow/soc_store: triage persistence, alert search, dashboard and overview queries, moved out of the plugin files as they were - pages reach the store as ctx.services.soc (coordination.page_api_services); the triage workflow writes through the soc workflow service - access contract: the backend neutral adapter kind builtin-soc-alerts, resolved by the backend's driver - the five files carry the marker flocks-soc-store-client and hold no SQL, table name or database driver import (tests/hub/test_soc_suite_store_clients.py) - soc_workspace_query reads its source information off the event loop: a backend whose queries are synchronous refuses them on the loop Behaviour: the triage workflow's soc_db_path setting is no longer read, and the dashboard reads the workflow, task and usage databases from the platform data directory, so a custom FLOCKS_ROOT is honoured.
…then the release The dashboard queries moved from the page's own directory into flocks.workflow.soc_store, but still looked for bundled workflow packages four directories above their file, which is no longer the plugins directory, and for installed ones under ~/.flocks whatever FLOCKS_ROOT says. They now ask _paths.workflow_roots(): the installation's plugins and workspace, then the workflows the release bundles, so a workflow that ran here but is not installed is still named by the release's manifest.
feat(soc): one set of alert operations suite files for every database backend
Linux 离线包和企业版包自带的 python-build-standalone 3.12.12+20251202 只在 /etc/ssl/cert.pem 和带哈希名的 /etc/ssl/certs 里找根证书。RHEL 8 这一代 (CentOS/Rocky/Alma 8、Anolis 8、Alibaba Cloud Linux 3)都没有,证书在 /etc/pki 下, 走默认 SSL 上下文的连接(企业微信长连接、aiohttp、urllib)一律 CERTIFICATE_VERIFY_FAILED。 - packaging/linux/versions.manifest.json:Python 升到 3.12.16+20261026。上游从 20260320 起 在 load_default_certs 里退到 /etc/pki/tls/cert.pem。 - flocks/ca_certs.py:导入 flocks 时,环境没指定证书、OpenSSL 默认位置又一张都没有,就把 SSL_CERT_FILE 指到系统证书包,系统没有就用 certifi 的。新 Python 只补了 load_default_certs 这一条路,只调 set_default_verify_paths 的客户端照样失败;开源版用户自己的 uv Python 也可能是旧版本。 - 企业微信:证书校验失败时提示查根证书和会替换证书的代理,不再让人去查网络和代理设置。
默认证书文件存在但是空的、服务账号读不了,或者 /etc/ssl/certs 里的哈希名只是坏软链、 空文件、目录时,OpenSSL 一张也加载不到,兜底却当成有证书而不动作。改成和候选证书包 同样的判断:非空、可读的普通文件(软链按指向算)。
fix(tls): 自带 Python 在 RHEL 8 系找不到根证书(企业微信连不上)
…de when its exit status never came back (INC-E6D264C2)
fix(enterprise): 安装器的退出码没写回来时,按它自己的回执判定升级已完成 (INC-E6D264C2)
10-13 换 logo(70add6bf)时定的规则是设置了工作台名称就不显示 logo、退回名称首字母方块。flocks-dev 的工作台名称是 FlocksPro,顶栏左上角于是显示红底白字的「F」,和换 logo 之前一样,看起来像新图标被改回去了。 - 顶栏图标跟着标签页图标走:上传了自定义 favicon 就用它,否则用 Flocks logo,只改名称不再去掉 logo - 顶栏 <img> 加 object-contain,上传的非正方形图标不被拉伸;logoUrl 为空时的首字母分支保留 - 设置页 Favicon 说明(中英文)补一句顶栏图标也跟着换 - 单测:改名称后仍是 /favicon.svg、上传 favicon 后用上传地址;Layout 改名称后仍显示 logo、logoUrl 为空时退回首字母
…t created yet (INC-14B4A77C)
fix(webui): 改了工作台名称也显示新版 Flocks logo
fix(project): 新建文件夹对话框里目录还没创建时也能点「浏览」,不再报 400 (INC-14B4A77C)
服务重启的那段时间,有的反向代理对所有接口回自己的 404 页(不是 502)。
页面把任何 4xx 都当成服务自己的拒绝:更新弹窗立刻报
「Request failed with status code 404」并停止等待,布局层把机器标成旧后端,
升级页显示「已退回升级前的版本」。
- 新增 isServiceRefusal:4xx 且响应体是这个服务的 JSON 报错
({error, message} 或 {detail})才算服务自己的拒绝,代理的 HTML 页不算
- UpdateModal 的 pollReleaseUntilEnded:代理的 4xx 继续等,上限仍是 HANDOFF_MAX_WAIT
- Layout:只有服务自己的 404 才 noteOlderBackend
- 开源版 Flocks Pro 页:只有服务自己的 404 才说机器已退回
fix(update): 升级等待期间代理回 404 时不再当成服务拒绝
后端的 http_exception_handler 把 HTTPException 包成
{"error": "HTTPException", "message": <detail>},响应体里没有 detail。
很多页面读的是 err.response.data.detail,读不到就退回 axios 的
"Request failed with status code 4xx",用户看不到后端给的原因。
这一提交先把取原因的逻辑收到 utils/error.ts,调用点在后面几个提交里改。
- 拆出 extractServerMessage:只读响应体里的原因,不退回 err.message,
给"后端没给原因就显示页面自己的文案"的调用点用;兜底 500 的
"Internal server error" 不算原因
- extractErrorMessage 改成基于它,原有的取值顺序不变
- 两个函数都认 {code, message} 这种结构化的原因,比如授权过期时
POST /api/session 回的 license_inactive
- test/helpers.tsx 加 backendError,造后端真实形状的 axios 错误
这几处读的是 err.response.data.detail,后端的原因其实在 message 里, 于是提示里只有 "Request failed with status code 4xx"。改用 extractErrorMessage / extractServerMessage,标题和兜底文案不变。 - SessionHistoryPanel:新建会话、移动会话、移除文件夹、删除文件夹 - SessionChat:附件上传、排队、队列的编辑 / 删除 / 立即运行 - OnboardingModal:保存草稿的两处在后端没给原因时仍显示自己的文案, 读取已保存密钥的两处照旧退回 err.message
工作台名称、Favicon、工具失败开关、数据过期策略、已归档会话、 系统日志(含日志弹窗)和重置密码的失败提示,原来读不到后端放在 message 里的原因,只显示 axios 的状态码那句话。改用 extractErrorMessage,标题和兜底文案不变;校验错误现在显示字段级原因。
冲突的解法: - AgentSheet、ProviderKeyCheck:只有 import 冲突,两边的 import 都留。 - ToolSheets、ServiceDetailPanel、Tool/index 的 MCP 测试连接:保留本分支的 mcpTestOutcome / mcpTestFailure。它们内部用 extractErrorMessage,合并后会读到 dev 改过的后端原因;4xx 照原话显示,其余情况显示中文提示,后端原文放在下方。 - ServiceDetailPanel.test.tsx 的 ToolSheets mock 改为用真实的两个 helper, dev 新增的「400 显示后端原因」用例因此能通过。 合并后对齐 dev「失败提示显示后端原因」:模型检查和获取模型列表改用 extractServerMessage。5xx 带了具体原因时显示该原因;兜底 500、代理页面和断网 仍显示中文提示。补了两条 503 带原因的用例。
fix(copy): 按提示文案检查表 v0.21 调整界面提示,修复卸载误判和模型地址 500
feat(licence): 在线申请带的机器指纹改用通用设备号(devid)
企业版核心的工作目录是服务账号家目录,project 作用域和用户插件目录是同一个 ~/.flocks/plugins。客户手放的 agent.yaml 只要写了 `tools:` 不带值, _agent_manifest 迭代 None 抛 TypeError,_discover_system_plugin_roots 不接异常, scene-suites、catalog、categories、contracts/webui/pages 四个接口全 500。 - tools、tags 读 null、单个字符串、列表都认(_string_items)。 - 插件自己的 JSON 读不了按空处理并记日志(_read_plugin_json)。 - 扫描插件目录时单个插件出错只丢它自己(_read_local_plugin),Superseded 照旧上抛。 - installed.json 不是对象时按没有安装记录处理。 新增 tests/hub/test_catalog_bad_local_plugins.py 14 条,换回 dev 代码 12 条变红; tests/hub 485 passed、1 skipped。
…ugin fix(hub): 插件目录里一个坏文件不再拖垮整个 Hub 目录(场景管理、插件广场、SOC 导航 500)
Windows 没有自带的 IANA 时区库,zoneinfo 只能从 tzdata 包里读。开源版的依赖里没有它,ZoneInfo("Asia/Shanghai") 直接报错:告警运营套件的查询工具导入时就设时区,Hub 装套件时导入失败、整套回滚;定时任务的时区校验也把合法时区判成无效。
只在 win32 上加 tzdata>=2025.2,uv.lock 只多出 tzdata。企业版的 uv.lock 记着开源版的依赖,要和 flockspro 的 fix/flocks-windows-tzdata 一起合。
fix(deps): Windows 上补 tzdata,告警运营套件能装、定时任务时区不再判无效
插件重载全程持有 ToolRegistry._refresh_lock。GET /api/tools、工具执行等 在事件循环上读注册表时阻塞等这把锁,单进程后端整个停住;设备接入页每次 回到窗口都强制重载(2026.11.09.1 还连着两次),用户看到所有页面接口一起 十几秒、同步 30 秒超时。 - 重载期间别的线程读重载前的浅拷贝,不再等锁;重载线程自己读活的注册表 - ToolRegistry.write_lock():事件循环上的短写操作、工具执行取工具和失败 记账都异步等锁(先确保注册表已初始化),执行时的启停判断与改前一致 - 工具刷新、删除工具、自定义设备模板、/tools refresh、插件文件监视器的 重载移出事件循环;自定义模板的检查和写入加锁 - 设备页的强制同步在插件文件和 site-packages 都没变时跳过注册表重载 - 插件 YAML 和 _provider.yaml 用 libyaml 解析
fix(tool): 插件重载不再卡住整个后端,设备页回到窗口时其他页面不再一起变慢
….0.1 - webfetch 的 SSRF 防护对回环地址(localhost、*.localhost、127.0.0.0/8、::1,含 IPv4 映射写法)放行,内网、链路本地、元数据、0.0.0.0 照旧拦;新增 is_loopback_host,% 后面跟名字的不算回环 - 技能网址安装:本机回环可以用 http;回环直连,不走环境代理,仍读 SSL_CERT_FILE / SSL_CERT_DIR - 微信扫码登录的 iLink 地址:本机回环 http/https 都收,并直连不走环境代理
- 管理员菜单的 Flocks Pro 改成弹窗:快速申请(联网/离线两种,表单提示文案区分)和导入授权文件;注册表新增 dialog、badgeTone、editionBadge,企业版用红色 Pro 标签区分版本,开源版入口改成灰色 PRO - 新接口 GET /api/auth/console-login/connectivity:探测 Console /health(4 秒超时、缓存 30 秒),弹窗和 Flocks Pro 页默认按结果给授权方式,可手动切换 - 离线申请 POST /api/enterprise-upgrade/applications/offline:生成带本机指纹的申请文件,不发 Console、不落库 - 导入授权 POST /api/enterprise-upgrade/licence/import:收 Console 下载的 license.json 或裸令牌,检查格式、ES256 头、编号、payload、失效和机器绑定后写入本机 license.json;签名仍由企业版核心升级时验 - license.json 的读改写(心跳、导入、启用授权)共用一把锁;同一令牌再导入先合并本机补丁再判断,机器绑定检查在写文件之前 - Flocks Pro 页加联网状态行和授权文件卡片;弹窗里提交申请或导入授权后,开着的页面不刷新也能看到 - 深色模式下主按钮改用 zinc 反色填充,不再被兼容表刷成卡片底色
- 管理员菜单:企业版的 Flocks Pro 入口画原型的金色 PRO 徽章(宝石 + PRO),开源版入口不带标签;去掉头像和版本旁的红色标签与注册表的 editionBadge - 版本号统一写成 v<年>.<月>.<日>.<构建号>(utils/productVersion,没有构建号补 .0):侧栏和菜单的版本、更新弹窗、新版本通知标题、授权页 - Flocks Pro 授权页按原型分「授权申请 / 授权信息 / 产品版本」三块:联网显示云账号、可联网、已登录/未登录和在线申请;离线只显示「离线」和离线申请,没有任何云账号内容;授权信息是授权表格(平台授权一行)、同步、导入授权、申请记录;产品版本写「Flocks 开源版 v…」 - 申请表单、离线申请文件、导入授权都改成对话框;离线申请直接下载申请文件;导入只取最后选的文件或粘贴内容 - 菜单弹窗按原型流程:有授权直接进 Flocks Pro 页;联网未登录先登录;已有申请显示状态;离线是离线申请表单 - 两边共用的授权页组件放在 components/licence/LicenceUi.tsx(企业版覆盖层也用);设置页名字改成「Flocks Pro 授权」 - 云账号状态读不到时按未登录处理,仍给登录入口
设置页内容区最宽 1100px,带操作列的授权表格最小 1120px,企业版在任何窗口宽度下都要横向滚动、操作列被截掉一截;开源版在 1280 窗口(内容区 988px)也要滚动。列间距 12→10px,几列最小宽度调小,表格最小宽度 1120→980、1040→904。
feat(enterprise): Flocks Pro 授权弹窗、按联网状态给授权方式、导入授权文件
fix(network): webfetch、技能网址安装、微信 iLink 不再拦 localhost / 127.0.0.1
- 授权申请、授权信息、产品版本合进一个面板;刷新改成无边框图标,离线、开源版未登录又没授权时置灰并说明原因 - 授权表去掉操作列,768 以下每行变卡片;申请记录一行一条(手机上换行) - 联网、已登录、本机缺授权时进页面自动启用已批准的申请一次,要等联网探测结束 - 申请弹窗加申请范围(开源版只有升级 Pro),去掉销售字段,字段错误只说一行 - 离线申请填同一张表,直接下载后端生成的申请文件;导入只收文件,结果走右上角提示 - 退出云账号先确认;剩 30 天内显示即将到期,本机授权还有效时只提示导入新文件 - 测试:QD6 路由断言改成等待,FP13 数据补上后端会带的 lapsed
feat(webui): 授权页按原型 v0.69 调整:一个面板、申请范围、离线直接下载申请文件、自动启用和到期提醒
- flocks start 默认听 0.0.0.0:5173(DEFAULT_SERVICE_HOST),别的电脑用 http://<本机 IP>:5173 打开; --host 127.0.0.1 / FLOCKS_HOST=127.0.0.1 只听本机。restart 仍沿用在跑的地址。 - 默认对外以后,还没有账号时谁先打开页面谁就能建管理员:/api/auth/bootstrap-admin 只认本机 (回环对端,且不带 X-Forwarded-For / Forwarded / X-Real-IP,堵住本机反向代理替远端转发), 别的电脑 403。bootstrap-status 多返回 setup_allowed 和 local_url(按 serve 的实际监听地址生成, 只听某个网卡时为空)。 - 初始化页在别的电脑上不显示表单,改为说明:在本机浏览器打开 local_url,或在本机执行 flocks admin generate-one-time-password;这条命令在一个账号都没有时直接建出 admin(一次性密码, 首次登录必须改)。管理员登录时补接账号出现前的旧会话(有完成标记,幂等,出错不挡登录)。 - 监听 0.0.0.0 / :: 时 CORS 照旧放行本机回环源,不放行任意主机。README 中英文同步。
…rfaces feat(service): 默认监听 0.0.0.0,第一个管理员只许在本机创建
…n moves to the top of the list (INC-CB90DF32)
fix(session): 继续对话的历史会话在左侧列表里排到最前 (INC-CB90DF32)
Fix/workflow maxparallel
11-14 起(ff7e03c3)读得到设备号就把它当 machine 报给 Console,按它签出的授权 在 11-14 以前的企业版核心和 Linux 普通账号装的企业版上认不出这台机器(machine_mismatch)。 - machine_fingerprint.machine_names():有机器 ID 就报摘要(kind=machine-id),设备号读得到时另放 devid;没有机器 ID 才报设备号;machine_identity() 保留 - 在线申请 form_data 和离线申请文件都带 devid,供 Console 另记 - /etc/machine-id 内容不是文本时报 MachineIdUnreadable,不再 500 - webui OfflineApplication 类型加 devid
…cy-machine fix(updater): 授权申请的机器指纹改回先报机器 ID 摘要,设备号另放 devid
chore(release): bump version to v2026.11.18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
将
AgentFlocks/flocksdev的dev分支同步到本仓库dev,包含v2026.11.18版本更新及上次同步后的开发变更。源提交为
adb6248e0bfa020a7752b1ddd2db2d903c606f14,版本 PR 为 https://github.com/AgentFlocks/flocksdev/pull/145。请使用 merge commit 合并,以保留源分支历史。在本地执行仓库现有
.github/scripts/sync-dev-to-flocks.sh完成此次手动同步。源仓库 Actions 因账户账单或额度限制无法启动。验证情况
uv lock --check --offline和git diff --check通过。Model/index.test.tsx的 Vitest 固定模拟密钥,1 个来自DeviceIntegration/index.test.tsx的模板存储标识。git merge-tree --write-tree合并预检通过,合并结果与上述源提交的文件树一致。