Conversation
…meter Sidebar usage attribution compared msg.vendor (svc.Resolve's URL-id: 'openrouter', 'zai'...) against the CONFIG vendor NAME (users name vendors freely, e.g. 'ai-gateway' for an openrouter base) - mismatched names never compared equal and the sidebar silently never updated. Both sides now compare in the Resolve domain, falling back to the old name comparison only when the endpoint cannot be resolved. Also extends the View() meter (#2540) with per-section timers: the 22:00:29 reproduction logged 'slow view render: 10.008s' as a single blob; the next reproduction names the offending section directly (header/statusBar/composer/contextPanel/conversation). chat.List bench (1946 items + 1.4MB checkpoint summary, follow mode) pins the virtual scroll itself at ~0ms, ruling the chat viewport out. Co-Authored-By: ggcode <noreply@ggcode.dev>
Owner
Author
|
Superseded by #2542: the attribution approach here (RESOLVED probe-id domain matching) was rejected in review in favor of #2542's final design - full-URL probe matching with no attribution layer at all (probes fire only for the session's current endpoint, results render directly). The View segment meter portion (segmentTimers in view.go) is valuable but orthogonal - please rebase it onto main as its own PR without the update_usage.go attribution hunk. |
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.
用户报告
侧栏 llm 套餐 usage 显示不正确;启动 freeze 依旧(ring buffer 已抓到
slow view render: 10.008s)。根因(ring buffer+代码链路)
usage 侧栏永不更新:
handleUsageInfoUpdated把探针返回的 vendor(svc.Resolve(baseURL)的 URL 域 id,如openrouter/zai)与配置里的 vendor 名(用户可自由命名,如ai-gateway)比较——名字不同的配置永不相等,侧栏静默空白。现统一在 Resolve 域比较,端点不可解析时才回退名字比较。freeze 追踪(延续 #2538/#2540 的仪表策略)
slow view render: 10.008s(首帧)+ mcpServersMsg handler 1.463s → drain 迟到 11.5s验证:
go test ./internal/tui/ ./internal/chat/全绿。Co-Authored-By: ggcode noreply@ggcode.dev