-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[codex] Add project-level Codex cost rollups #1820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,13 +166,24 @@ extension StatusItemController { | |
| ].joined(separator: ",") | ||
| } | ||
| .joined(separator: ";") | ||
| let projects = snapshot.projects | ||
| .map { project in | ||
| [ | ||
| project.name, | ||
| project.path ?? "", | ||
| "\(project.totalTokens ?? -1)", | ||
| Self.formatOptionalDoubleForSignature(project.totalCostUSD), | ||
| ].joined(separator: ",") | ||
|
Comment on lines
+171
to
+176
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an open menu already has a Codex project row and only its source breakdown changes while the project total stays the same, this signature remains unchanged because it records only the parent project fields. In that case Useful? React with 👍 / 👎. |
||
| } | ||
| .joined(separator: ";") | ||
| return [ | ||
| "sessionTokens=\(snapshot.sessionTokens ?? -1)", | ||
| "sessionCost=\(Self.formatOptionalDoubleForSignature(snapshot.sessionCostUSD))", | ||
| "lastTokens=\(snapshot.last30DaysTokens ?? -1)", | ||
| "lastCost=\(Self.formatOptionalDoubleForSignature(snapshot.last30DaysCostUSD))", | ||
| "updated=\(Int(snapshot.updatedAt.timeIntervalSince1970 * 1000))", | ||
| "daily=\(daily)", | ||
| "projects=\(projects)", | ||
| ].joined(separator: ",") | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a project has exactly one source whose path differs from the canonical project path, such as usage that came only from a
.codex/worktrees/...checkout, this condition hides the only source row. The submenu then shows the rolled-up main worktree path but drops the source CWD detail that the project rollup is supposed to preserve; consider showing sources when the sole source path differs fromproject.path, not only when there are multiple sources.Useful? React with 👍 / 👎.