Repository navigation
Commit 7d75be6
fix(opencode): load Claude session days without pricing or swallowing errors
`ccusage opencode` loads the Claude source only to learn which session days
it counts, so it can skip the `claude-agent` turns Claude already reports.
That load inherited the caller's cost mode, so in auto or calculate mode it
fetched LiteLLM pricing and priced all Claude history just to read session
IDs and dates. Force `CostMode::Display` for this load.
It also mapped every Claude load error to an empty session set, so a real
I/O or parse failure, or an invalid CLAUDE_CONFIG_DIR, silently kept every
`claude-agent` row and double-counted them against `ccusage claude`. Missing
Claude directories already load as no usage, so the only errors left are
real ones; propagate them, matching the unified report.
Co-authored-by: igorovh <[email protected]>1 parent 120267d commit 7d75be6
3 files changed
Lines changed: 34 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
| 870 | + | |
870 | 871 | | |
871 | 872 | | |
872 | 873 | | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
| 874 | + | |
| 875 | + | |
878 | 876 | | |
879 | 877 | | |
880 | 878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | | - | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1008 | 1014 | | |
1009 | 1015 | | |
1010 | 1016 | | |
| |||
1016 | 1022 | | |
1017 | 1023 | | |
1018 | 1024 | | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1019 | 1048 | | |
1020 | 1049 | | |
1021 | 1050 | | |
| |||
0 commit comments