Repository navigation
fix(records): count overlapping calls once in session model time - #107
Merged
Calcium-Ion merged 3 commits intoOct 26, 2026
Merged
Conversation
Session model time summed every call's latency, so parallel calls were counted once each and the live value advanced once per running call. Compute the union of call intervals instead. Calls still running share one merged block whose start is exposed as running_since, so clients add the elapsed time once whatever the number of running calls.
Cover identical, partially overlapping and nested call intervals once each, instead of naming a partial overlap as full and testing nesting twice.
Subagent fixtures added on main predate running_since, which this branch makes a required session field. Set it to null for idle sessions and to the running call's start for the working subagent.
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.
English template:
.github/PULL_REQUEST_TEMPLATE/en.mdImportant
🔗 关联任务 / Related Issue
新功能请填写下方 Issue 编号;若还没有对应 Issue,请先自行创建。功能讨论请放在 Issue 中进行。
改动较大或方向性变更,请先在关联 Issue 中与维护者达成一致,再提交 PR。
Bug 修复请关联对应 Issue。设计取舍、理解偏差或预期不一致,更适合作为讨论或功能请求。
Closes [Bug] Session model time adds up parallel calls and exceeds the session's wall-clock time #106
🚀 变更类型 / Type of change
📝 变更描述 / Description
Session Model time summed every call's latency, so parallel calls (for example Claude Code subagents) were counted once each, and the live value advanced once per running call.
loadSessionRuntimesnow merges the call intervals (root calls and retry children) and returns the length of their union. Gaps between calls and the unknown runtime of interrupted calls stay excluded, as before.running_sincefield is that block's start, andduration_mscovers only the finished intervals before it. The desktop app showsduration_ms + (now - running_since), so the value grows by one second per second however many calls run. A finished call that overlaps the running block is absorbed into it instead of being counted twice.active_request_startsstays for running-call counts. The Go contract, OpenAPI, desktop parser and the Model time hint (en, ja, zh-CN) are updated. Output TPS, TTFT and tool time are unchanged.📸 运行证明 / Proof of Work
(请写明如何验证:实际命令或步骤,以及观察结果。仅声明
go build通过或测试通过,不视为有效证明。UI 变更请附截图或录屏;Bug 修复请说明复现过程与修复后结果。)✅ 提交前检查项 / Checklist
New feature,我已关联对应 Issue;若尚无 Issue,我已先自行创建。go build通过或测试通过,不视为有效证明。