magpie
magpie copied to clipboard
[Feature] RTK 统计把 WSL 发行版里的节省一并算进来(现在只看 Windows 本机的 rtk gain)
环境
- Windows 11 家庭版,Magpie 0.1.2072
- WSL2:Ubuntu(运行中;空闲一会儿会自己变成 Stopped)
- Windows RTK:1.1.0(winget 安装)
- WSL 内 RTK:1.0.1(
/home/linuxbrew/.linuxbrew/bin/rtk)
现状
RTK 页 / magpie library rtk 的 “tokens saved over N commands” 只读 Windows 本机的 rtk gain(%LOCALAPPDATA%\rtk\history.db)。WSL 里的 agent 走的是 WSL 自己的 RTK,历史在 /home/<user>/.local/share/rtk/history.db,两者完全独立。
实测对比:
- Windows 本机
rtk gain:339 commands / 8,570 tokens saved - WSL Ubuntu 内
rtk gain:778 commands / 80.1K tokens saved(24.5%) - Magpie 的 RTK 页只显示前者;
magpie library rtk只会多一行WSL Ubuntu 1.0.1 · /home/linuxbrew/.linuxbrew/bin/rtk,但没有 WSL 的节省数字,并提示 WSL 是 “its own count”。
而且 WSL 空闲变成 Stopped 后,magpie library rtk 会直接显示:
WSL Ubuntu isn't running: its agents are left as they are, and magpie doesn't start it
? Claude Code · WSL Ubuntu — WSL Ubuntu isn't running
连那一行都不显示了。
期望
希望 RTK 页能把 WSL 发行版里的 RTK 节省也纳入统计,例如:
- RTK 卡片按来源分列:Windows 本机 / 每个 WSL distro 各自
rtk gain的命令数和节省 tokens;或 - 每个 running distro 一行/一张小卡显示数字;distro 停止时保留最后一次读到的数字并标注“未运行”,而不是直接消失。
既然 magpie library rtk 已经能定位到 WSL 里的 rtk 路径,应该只需要在 distro 运行时多跑一次 rtk gain 并缓存结果。
相关
- stopped WSL distro 在 Library 其他页面也会被漏掉(如 #4182)