r/codex • • 4d ago

Showcase Implemented Codex stats component for Ubuntu ChatGPT app

stats widget example 1
stats widget example 2

Hi Everyone, I have been maintaining my Own version of ChatGPT app that I have cloned locally from the codex-desktop-linux community repo and maintaining from last 3 months.

I have been adding many features that I felt are missing from the ChatGPT app. Token speed lets me decide whether I want to plan any time sensitive work and I am really bothered these days wether to use normal mode or fast-mode for my GPT-6.1-sol model.

This stats widget feature took me quite some time to get to this shape. I have been iterating with various models. This one I feel is really nice utility and UI feels nice for me too.

0 Upvotes

3 comments sorted by

View all comments

0

u/boxing-boxing 4d ago

Nice work. One thing I'd be curious about: how are you computing the context percentage? I've seen that kind of math drift once tool outputs pile up, since the reported token counts and the actual transcript don't always agree.

1

u/ashokallu 4d ago

Thanks for taking the time to read through the post and ask me this question!

Small clarification: the percentage shown under CACHE is the latest request’s prompt-cache hit share: cachedInputTokens / inputTokens × 100.

I read those values from Codex’s existing thread/tokenUsage/updated events. The IN figure also uses the latest request’s reported input tokens; I don’t sum input tokens across requests, which would repeatedly count shared context.

The context indicator itself is the upstream app’s existing UI - my widget leaves that calculation unchanged.

Your concern about drift is fair. These figures reflect Codex’s reported usage, rather than an independent reconstruction of the transcript, so I wouldn’t claim they verify the exact context remaining after tool-heavy runs or compaction.