mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-26 23:56:02 +08:00
feat: replace Codex estimated usage with precise JSONL session log parsing
Replace the 70/30 input/output token estimation from state_5.sqlite with precise parsing of Codex CLI JSONL session logs (~/.codex/sessions/). - Parse event_msg (token_count), turn_context, and session_meta events - Compute exact input/output/cached token deltas from cumulative totals - Reuse session_log_sync table for incremental file scanning - Pre-filter lines with string contains() before JSON deserialization - Add codex_session data source to DataSourceBar with i18n (zh/en/ja)
This commit is contained in:
@@ -15,6 +15,7 @@ const DATA_SOURCE_ICONS: Record<string, React.ReactNode> = {
|
||||
proxy: <Database className="h-3.5 w-3.5" />,
|
||||
session_log: <FileText className="h-3.5 w-3.5" />,
|
||||
codex_db: <Database className="h-3.5 w-3.5" />,
|
||||
codex_session: <FileText className="h-3.5 w-3.5" />,
|
||||
};
|
||||
|
||||
export function DataSourceBar({ refreshIntervalMs }: DataSourceBarProps) {
|
||||
|
||||
Reference in New Issue
Block a user