Add Codex Desktop app monitoring support#116
Open
crosswyb wants to merge 2 commits into
Open
Conversation
Add a new collector (codex_desktop.rs) that monitors Codex Desktop app sessions by reading token usage data from ~/.codex/logs_2.sqlite, in addition to the existing Codex CLI JSONL-based collector. - Reads per-conversation input/output/cached token counts from SQLite - Detects Codex Desktop process via ps (Codex.app) - Registers as 'codex-desktop' agent in MultiCollector - Supports hide/show via hidden_agents config - All 139 existing tests pass Constraint: sqlite3 CLI must be available at runtime Scope-risk: narrow - new file, no changes to existing collectors
- Now tracks event lifecycle (response.created → response.in_progress → response.completed) to show Thinking/Executing/Waiting status - Replaced historical-only SQLite polling with recent-events query - Shows placeholder session when desktop app is running but idle - 141 tests pass (was 139, added 2 new event kind tests)
Owner
|
Thanks for adding Codex Desktop support. The feature direction makes sense for abtop, but I don't think this implementation is safe to merge yet. Main blockers:
Verification:
Suggested direction: use a stable processed-row cursor such as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
CodexDesktopCollectorthat monitors Codex Desktop app sessions by reading token usage data from~/.codex/logs_2.sqlite. This is complementary to the existingCodexCollectorwhich only covers Codex CLI.How it works
Codex.app/Contents/MacOS/Codex) viaps~/.codex/logs_2.sqliteusing thesqlite3CLI (no new Rust dependencies)input_token_count,output_token_count,cached_token_countper conversationconversation.idto form per-session views"codex-desktop"agent inMultiCollector, respectshidden_agentsconfigDesign decisions
std::process::Commandto callsqlite3CLI with-jsonoutput, consistent with existing patterns (lsof,ps,git)codexbinary) are fundamentally differentlast_tsto only re-read new log entries each tickLimitations
sqlite3CLI to be installed (pre-installed on macOS, available everywhere)Testing
with_hiddentest assertions for the new 4th collector)Closes: N/A — feature request from user who needed desktop app monitoring alongside CLI support