Skip to content

fix: preserve usage account attribution across retries - #2379

Merged
jlcodes99 merged 1 commit into
jlcodes99:mainfrom
yangeni:fix/usage-account-attribution-v1.3.47
Sep 27, 2026
Merged

jlcodes99 merged 1 commit into
jlcodes99:mainfrom
yangeni:fix/usage-account-attribution-v1.3.47

Conversation

@yangeni

@yangeni yangeni commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep request token usage attached to the account that produced the usage callback.
  • Do not let a later retry or selector snapshot overwrite that account with another account.
  • Preserve selector fallback only when no usage callback exists or the callback AuthID matches.
  • Keep mismatched or unmapped usage unattributed rather than charging a different account.

Scope

  • Does not change routing, retries, model pricing, quota querying, WebSocket execution IDs, or existing request logs.
  • Does not rewrite historical billing records; historical reassignment requires original request-level evidence.
  • No credentials or private account data are included.

Verification

  • go test ./...
  • go test -race ./... for the affected package
  • Windows amd64 cross-compile test completed locally; CI remains the runtime verification surface.

The regression tests cover selector changes after usage, missing selector state, matching AuthID fallback, multiple successful usage records, and API-key attribution.

@jlcodes99
jlcodes99 merged commit 1cd288a into jlcodes99:main Sep 27, 2026
11 checks passed
@jlcodes99

Copy link
Copy Markdown
Owner

已合入 main,感谢 @yangeni 提供请求用量账号归属修复!

已在当前主线完成必要的冲突适配,并通过前端测试、类型检查、翻译检查和相关 Go 回归/sidecar 构建。本地中英文 Unreleased 更新日志已补充本 PR 及你的贡献署名,后续随宿主版本发布;本次尚未发版。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants