现象
群聊消息超过 10000 条时,vchat history --asc -n 5000 只返回最旧的 5000 条,最新消息被截断。
$ vchat history "某群" -n 5000 --asc
# 返回最旧 5000 条,最新数据在 offset 5000+ 之外
根因
--asc(oldest first)+ SQL LIMIT N = 取最旧 N 条。这在逻辑上没问题,但用户拉 --asc 通常是想看「某天的对话按时间顺序排列」
- CLI 的
cmd_history 没有暴露 start_time / end_time 参数,而底层 get_chat_history() 已经支持:
# messages.py L127-L130
def get_chat_history(chat_name, limit=50, offset=0,
start_time="", end_time="",
oldest_first=False):
建议修复
给 vchat history 子命令加 --start-time 和 --end-time 参数(格式 YYYY-MM-DD 或 YYYY-MM-DD HH:MM),透传给 get_chat_history()。
vchat history "某群" -n 5000 --asc --start-time "2026-05-18"
临时 workaround
不加 --asc,取最新 N 条后 grep:
vchat history "某群" -n 3000 | grep "^\[2026-05-18" | tail -r
现象
群聊消息超过 10000 条时,
vchat history --asc -n 5000只返回最旧的 5000 条,最新消息被截断。根因
--asc(oldest first)+ SQLLIMIT N= 取最旧 N 条。这在逻辑上没问题,但用户拉--asc通常是想看「某天的对话按时间顺序排列」cmd_history没有暴露start_time/end_time参数,而底层get_chat_history()已经支持:建议修复
给
vchat history子命令加--start-time和--end-time参数(格式YYYY-MM-DD或YYYY-MM-DD HH:MM),透传给get_chat_history()。临时 workaround
不加
--asc,取最新 N 条后 grep: