Repository navigation
feat(requestlog): page payload details and cap field previews - #542
Merged
Merged
Conversation
xcosmosbox
force-pushed
the
feat/requestlog-detail-pagination
branch
from
November 27, 2026 06:18
c4b9f33 to
0941a17
Compare
The request detail modal fetched the entire captured body in a single response. Real turns routinely store 700 KB to 12 MB payloads (conversation items plus base64 images inside top-level fields), so the browser's default 10 second RPC deadline expired mid-transfer and the modal fell back to "no payload record found" even though the record existed. - requestlog/detail accepts itemOffset, itemLimit and fieldLimit. Items are returned as a window with itemTotal/hasMore, and oversized first-level fields are truncated with bytes/truncated flags instead of shipping megabytes on every open. Zero limits keep the previous behaviour. - The detail RPC gets its own 120 second transfer budget instead of the shared 10 second default. - The modal loads the first 200 items, offers "load more", and can expand truncated fields on demand.
xcosmosbox
force-pushed
the
feat/requestlog-detail-pagination
branch
from
November 27, 2026 06:20
0941a17 to
de44e8e
Compare
Owner
|
感谢贡献!日志详情分页和大字段预览已合入 合并前补了两处修复:
已通过桌面 IPC 和 SQLite 实测:一条含 3 个条目的日志,请求第 2 条时只返回该条;旧客户端不传分页参数时仍返回全部 3 条。4 项 CI 全部通过。 |
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.
问题
请求日志详情弹窗一次性拉取整份存储的请求体。真实会话的 payload 常态在 700KB–12MB(对话条目 + 顶层字段里的 base64 图片),前端 RPC 默认 10 秒传输预算会在下载途中超时,
detail变成空,弹窗就落到兜底文案「未找到该请求的内容记录;日志可能产生于旧版本,或已被清理」——但记录其实一直在。实测(自托管 SQLite 存储):
requestlog/detail耗时也就是说:单纯按条目分页解决不了"单个字段 12MB"的情况,必须同时限制字段预览体积。
改动
服务端
RequestLogDetailParams新增itemOffset/itemLimit/fieldLimit(0保持原有"全量返回"行为,完全向后兼容)RequestLogDetailResult新增itemTotal/itemOffset/itemLimit/hasMoreRequestLogDetailField新增bytes/truncated,超过fieldLimit的值按 UTF-8 边界截断并标记full_detail改为按窗口切 items、按上限截断字段;preview 模式不变前端
requestlog/detail单独给 120s 传输预算(rpcRequestOptions按方法覆盖超时),不再共用 10s 默认值service-client/ 类型定义同步新参数;中/英/韩/俄四份文案兼容性
itemLimit=0、fieldLimit=0)item_window_and_field_limit_are_applied覆盖窗口切片与字段截断备注
本地未做编译验证(环境不具备 Rust 构建能力),以 CI 为准。