Repository navigation
修复长时间运行的内存与数据库开销问题 - #496
Merged
Merged
Conversation
- 调试报文限量保留、正文合计与单条体积设上限,超限淘汰最旧记录 - 大请求及时释放原始字节,避免解析与转发期间长期保留多份正文 - 请求终态与限额事件在同一事务内提交,在途状态最多每秒写入一次 - 日志每 64 条、请求统计每 128 次记账或每 60 秒批量维护 - 日志查询与统计加缓存,请求总数用内存缓存,无筛选不再全表计数 - SQLite 检查点阈值提高到 10000 页,新库启用增量回收 - 图片逐张压缩,避免一次性复制全部图片地址 - 调试关闭时清理历史快照并停止详细日志,同类余额查询失败 15 分钟内去重 - 更新检查复用成功结果,减少重复网络请求
wocaoniubi123
added a commit
to wocaoniubi123/Agent2API
that referenced
this pull request
Nov 7, 2026
上游三个提交: - b042ddf 修复长时间运行的内存与数据库开销(request_stats writer / record_persist / task_state storage) - 196bd64 插件页操作入口整合(检查更新/刷新/设置/从文件安装/从 npm-GitHub 安装/诊断)+ 更新页 Git 源管理 - b1dbef8 选择性合并 PR aimod-cc#496 冲突处理(6 个文件): - 5 个前端产物(ui.css/ui.js/mobile.css/mobile.js/sw.js):取上游,随后云端重建 - checkin-center-tab.tsx:上游把签到中心整体重构(AccountTable→AccountList/AccountLine、 新增 filterOptions/byStatus 筛选器、卡片改 CardTitle+CardAction+CardFooter), 本分支的卡片级批量按钮因此重做:以「全部查询」+「一键领取(N)」/「一键完成(N)」形式 挂到新的 CardAction 里,目标集合复用上游新写的 onboardingDone / growthDone 谓词, 旧的 pendingFirst / onboardingRank / growthRank 随上游筛选器一并删除。 兼容性: - 插件协议仍 pin v3.4.0,本分支自建的 3.4.3 插件包继续可用 - 数据库 schema v26 → v27(新增 schema_coding.sql),首次启动自动迁移 - 本分支改动(凭证每日全量强刷、账号级刷新互斥、余额查询并发上限、维护设置 UI)全部保留
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.
背景
网关长期运行时,调试报文、请求记账与日志维护会在内存和 SQLite 上持续累积开销,跑久了会变慢、占用变高。本 PR 是这一组修复的合集。
改动
内存
数据库与日志
验证
cargo check -p agent2api-server --lib:通过,警告 6 条降到 3 条cargo test -p agent2api-server --lib:283 passed; 1 failed,唯一失败项是 CodeArts 会话式错误分类(provider_loop/tests.rs:200),属上游 3.4.2 已有的提供商适配问题,与本 PR 无关e8bed73里 4 处cargo test编译不过的位置(api/pipeline.rs的RequestQuery初始化、core/cloud_sync/settings.rs的两处WebDavConfig、core/upstream/provider_loop/tests.rs的调用参数),现在测试目标可以正常编译与其它 PR 的关系
与 #495 在
api/mod.rs、api/protocol.rs、config/mod.rs三个文件有重叠,但改动落在不同位置(各自新增不同的模块声明、判据与函数)。后合入的一方 rebase 一下即可。🤖 本条回复由 AI Agent 生成
Generated by an AI agent.