merge 源码#2341
Conversation
|
Thank you for your contribution! Before we can merge this PR, we need you all to sign our Contributor License Agreement (CLA). To sign, please reply with the following comment:
You only need to sign once — it will be valid for all your future contributions to this project. I have read the CLA Document and I hereby sign the CLA 9 out of 10 committers have signed the CLA. |
…l_output When a preflight ping fails or previous_response_not_found is returned, sub2api drops previous_response_id and retries. But if the payload contains function_call_output (tool results), the upstream API loses the response chain context needed to match tool_result to tool_use, causing 400: "No tool call found for function call output". Add hasFunctionCallOutput checks to both recovery paths: - Preflight ping failure recovery (forcePreferredConn path) - recoverIngressPrevResponseNotFound function
UI 上 admin 改的数据保留策略(cron + retention 天数)此前只写入 settings 表的 ops_advanced_settings.data_retention,但 OpsCleanupService 启动时只读 cfg.Ops.Cleanup(config.yaml / 环境变量),从未读取 settings 表,导致 UI 配置 完全不生效——cron 实际仍按默认 0 2 * * * 每日跑、retention 30 天。 改动: - OpsCleanupService 增加 settingRepo 依赖,新增 effective 配置 + Reload 方法。 Start/Reload 时从 settings.ops_advanced_settings.data_retention 覆盖 cfg.Ops.Cleanup(Enabled、Schedule、*RetentionDays),无 settings 时整体 fallback 到 cfg。runScheduled 顶部刷新一次 effective,让 retention 改动当次 即生效(schedule/enabled 改动需要 Reload 才换 cron)。 - 用 mu + started/stopped 替换 startOnce/stopOnce 以支持 Reload 重建 cron。 - OpsService 增加 CleanupReloader 接口与 SetCleanupReloader setter; UpdateOpsAdvancedSettings 写入后调用 Reload。 - wire 通过 setter 注入 cleanup hook,避免构造期循环依赖。 - 新增单测覆盖 overlay 五种情形 + Update 触发 Reload。
代码审查反馈: 1. 文件行数超标:ops_cleanup_service.go 594→413 行。 拆 opsCleanupPlan / deleteOldRowsByID / truncateOpsTable / isMissingRelationError + counts struct 到 ops_cleanup_executor.go (164 行)。 2. runCleanupOnce 89 行→30 行(table-driven): 用 []opsCleanupTarget 循环替代三组重复的 opsCleanupPlan → runOne → assign。 3. 魔法值提取常量: opsCleanupDefaultSchedule / opsCleanupBatchSize / opsCleanupCronStopTimeout / opsCleanupRunTimeout / opsCleanupHeartbeatTimeout。 ops_settings.go 中 "0 2 * * *" 也统一引用 opsCleanupDefaultSchedule。 4. 补 5 个缺失测试: - Reload 未 Start 时 no-op - Reload 已 Stop 后 no-op - cleanupReloader==nil 时 Update 不 panic - Start 重复调用幂等 - refreshEffectiveBeforeRun 正确更新 snapshot
当选项数量 > 5 时自动启用搜索过滤,无需修改任何使用处代码。 - Select.vue: searchable 默认值改为 'auto',内部自动判断 - GroupSelector.vue: 新增 searchable prop 和搜索输入框
…rkdown page rendering 1. Redeem code affiliate rebate: balance-type redeem codes now trigger invite rebate for the inviter. Payment fulfillment uses context key to prevent double-rebate. 2. Batch concurrency update: new POST /admin/users/batch-concurrency endpoint supporting mode=set/add with all=true for all users. 3. Markdown page rendering: new GET /api/v1/pages/:slug API serves local .md files. Custom menu items with url="md:slug" render markdown with collapsible TOC sidebar, scroll spy, and copy buttons on code blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- GET /pages/:slug now requires JWT + checks custom_menu_items visibility - GET /pages (list) is admin-only - GET /pages/:slug/images/* uses visibility check without JWT (browser img tags cannot carry auth headers), blocks admin-only page images - Frontend fetch adds Authorization header from authStore.token - settingService nil guard changed to fail-closed (deny access) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
No description provided.