Workspace removal deletes a sub-agent's spend when the usage roll-up fails
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend
调研方向
Start in the workspace removal path of src/node/services/workspaceService.ts, where rollUpUsageIntoParent and rollUpTimingIntoParent are called before the child's session folder under ~/.xum/sessions is deleted. Trace how getSessionUsage errors are caught and logged, then make a roll-up throw in a test to reproduce the lost session-usage.json. Done when a failed roll-up no longer deletes the only copy of the child's spend, either by retrying once or by keeping the usage file, and a test covers that path. Pick an option with a maintainer first, since the issue lists two.
由索引模型根据 Issue 内容生成。
描述
When workspace removal cannot roll a sub-agent's usage into its parent, Xum still deletes the sub-agent's session folder. The parent then loses that sub-agent's spend for good.
Where
WorkspaceService removal path (src/node/services/workspaceService.ts, the rollUpUsageIntoParent call). A failure in getSessionUsage or rollUpUsageIntoParent (for example a one-time EIO) is caught and logged with log.error("Failed to roll up child session usage into parent"). Removal then continues and deletes ~/.xum/sessions/<child>/, which holds the only copy of session-usage.json.
The timing roll-up just above it (rollUpTimingIntoParent) has the same shape.
Expected
A failed roll-up does not destroy the only copy of the child's spend. Options:
- Retry the roll-up once before deleting the folder.
- Keep the child's usage file (or move it under the parent) when the roll-up fails, so a later read can fold it in.
Context
Found during #7862 follow-up work (a prep owner on #7868 reported it). It does not fail a user action, so it was out of scope there. The behavior exists on main today (96a0916ecc).
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- 主要语言
- TypeScript
- 星标
- 2.1k
- 派生
- 139
- 平均合并
- 4 小时 38 分钟
- 30 天内合并 PR
- 926
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/xum 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
🤖 fix: xum api exits 0 when a procedure returns success: false可能已有人在做 @twotnguyen 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 82/100
ClickHouse/clickhouse-js#1130 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug claude Minor static-analysis
难度 2/5 1-3 小时 新手友好度 66/100
linagora/cozy-flagship-app#1359 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复