Skip to content

问题标题:聊天历史记录管理缺陷 - 所有对话混入同一文件导致文件过大无法使用Issue Title: Chat History Management Defect - All Conversations Merged into Single File Causing Unusable File Size #526

@xiaoduanRobot

Description

@xiaoduanRobot

问题描述:
Amazon Q 的聊天历史记录存在严重的管理问题:

所有聊天窗口共用一个 JSON 文件:无论打开多少个聊天窗口,所有对话都写入同一个 chat-history-xxx.json 文件,而不是为每个窗口创建独立文件

历史记录无限累积:每次发送消息时,插件会读取现有 JSON(包含所有历史记录),追加新消息后写回,导致文件不断膨胀,几次对话后就达到 10MB+

删除无效:即使手动删除 JSON 文件,只要不重启 IDE 继续对话,插件会从内存缓存中恢复所有历史记录并重新写入,文件瞬间又变回 10MB+

重启后仍恢复旧记录:即使重启 IDE,插件仍会从某处(可能是其他缓存文件)恢复之前的所有历史记录

我的尝试:

✗ 删除 JSON 文件 → 继续对话后立即恢复

✗ 设置文件为只读 → 可能创建新文件但问题依旧

✗ 重启 IDE → 历史记录仍被恢复

✓ 删除 JSON + 重启 IDE + 中途不发消息 → 唯一有效但极不方便

期待改善:

按聊天窗口分离文件:每个聊天窗口对应独立的 JSON 文件

文件大小限制:单个历史文件设置大小上限(如 1MB),超过后自动清理旧记录

提供历史管理选项:在设置中添加:

禁用历史记录保存

设置保留天数/条数

手动清除历史记录按钮

优化存储结构:不要每次都读取并写回完整历史,使用增量追加方式

影响:

文件过大导致读取失败

无法查看不同对话的独立历史

必须频繁手动清理才能正常使用

Description:
Amazon Q's chat history management has critical issues:

All chat windows share one JSON file: Regardless of how many chat windows are opened, all conversations are written to the same chat-history-xxx.json file instead of creating separate files per window

Unlimited history accumulation: When sending messages, the plugin reads the existing JSON (containing all history), appends new messages, and writes back, causing the file to bloat to 10MB+ after just a few conversations

Deletion ineffective: Even after manually deleting the JSON file, if you continue chatting without restarting the IDE, the plugin restores all history from memory cache and rewrites it, instantly returning to 10MB+

History restored after restart: Even after restarting the IDE, the plugin still restores all previous history from somewhere (possibly other cache files)

My Attempts:

✗ Delete JSON file → Immediately restored when continuing conversation

✗ Set file as read-only → May create new file but issue persists

✗ Restart IDE → History still restored

✓ Delete JSON + Restart IDE + Don't send messages during process → Only effective method but extremely inconvenient

Expected Improvements:

Separate files per chat window: Each chat window should have its own independent JSON file

File size limit: Set maximum size for history files (e.g., 1MB), automatically clean old records when exceeded

Provide history management options: Add settings for:

Disable history saving

Set retention days/message count

Manual clear history button

Optimize storage structure: Don't read and rewrite complete history every time, use incremental append approach

Impact:

Oversized files cause read failures

Cannot view independent history for different conversations

Must frequently manually clean to use normally

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions