Skip to content

fix(agent): page pricing events during database organization - #1643

Merged
tallcode merged 1 commit into
mainfrom
codex/agent-pricing-page-budget
Nov 18, 2026
Merged

tallcode merged 1 commit into
mainfrom
codex/agent-pricing-page-budget

Conversation

@tallcode

Copy link
Copy Markdown
Collaborator

数据库整理在保留已结束运行的用量和模型切换记录时,会一次读取全部记录;超过底层 257 条的读取上限后,整个会话因 change selection exceeds page budget 被跳过。

改为按记录 ID 分页读取,每批最多 256 条,同时按元数据、上下文和符号的字节大小限制页面。全部分页仍在原有回收事务内完成,保留失败时回滚,成功后才回收源过程记录。

补充 257、258、512、513 条记录及较大元数据的回归用例,检查保留内容一致、源过程记录回收和重复整理;更新查询计划用例,确认分页继续使用定价记录索引。

验证:

  • rustup run 1.99.1 cargo fmt -p future-agent --check 通过。
  • rustup run 1.99.1 cargo clippy -p future-agent --all-targets -- -D warnings 通过。
  • git diff --check 通过。
  • 未在本地运行单元测试,交由 PR CI 执行。

本 PR 仅包含 Agent 数据库整理的分页修复及相关回归用例。

@tallcode
tallcode enabled auto-merge (squash) November 18, 2026 09:24
@tallcode
tallcode merged commit 43119a6 into main Nov 18, 2026
25 checks passed
@huichen
huichen deleted the codex/agent-pricing-page-budget branch November 20, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant