Repository navigation
Keep monitoring and session controls compatible with Codex 0.164 - #88
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Coverage gaps can bypass estimator invalidation, and rewritten history restoration can discard previously observed session accounting.
4 open issues
What changed in this PR
Updates Codexometer’s monitoring and session controls for Codex 0.164, covering compressed histories, incomplete usage telemetry and authoritative settings confirmation.
Changes:
- Adds compressed-history baselines and negotiated zstd WebSocket transport.
- Detects background usage gaps and pauses API-EQ capacity learning, with terminal/browser diagnostics.
- Verifies settings changes, expands compatibility tests and raises the required Go patch to 1.27.3.
| File | Description |
|---|---|
| README.md | Documents compatibility behavior, limits and toolchain requirement. |
| internal/web/usage_diagnostics_test.go | Tests coverage diagnostic precedence and clearing. |
| internal/web/state.go | Projects coverage warnings into browser state. |
| internal/ui/quota_api_eq.go | Suspends estimates and resets evidence during coverage gaps. |
| internal/ui/quota_api_eq_test.go | Tests estimator invalidation and recovery. |
| internal/ui/model.go | Carries coverage warnings through quota observations. |
| internal/codex/usage_diagnostics.go | Adds incomplete-coverage diagnostic formatting. |
| internal/codex/usage_coverage.go | Tracks coverage risks and checks local configuration. |
| internal/codex/usage_coverage_unix.go | Queries effective per-thread feature state. |
| internal/codex/usage_coverage_unix_test.go | Tests feature inventory interpretation and validation. |
| internal/codex/usage_coverage_test.go | Tests local, child-session and disconnected coverage checks. |
| internal/codex/testdata/zstd-stream-v1.json | Adds native zstd interoperability fixtures. |
| internal/codex/session_stream_test.go | Tests approval isolation and continued event processing. |
| internal/codex/session_settings_unix.go | Binds settings mutations to their original connection. |
| internal/codex/session_settings_unix_test.go | Extends daemon fixtures for compression and permissions. |
| internal/codex/session_permissions_unix.go | Verifies applied permission profiles. |
| internal/codex/session_compatibility_unix_test.go | Tests reconnects, multiple clients and queued settings. |
| internal/codex/session_commands_unix.go | Routes model and permission changes through verification. |
| internal/codex/live_usage.go | Integrates compressed histories and coverage status. |
| internal/codex/live_usage_exact_test.go | Tests incomplete-response accounting and replay deduplication. |
| internal/codex/live_usage_compressed.go | Adds bounded baselines and restored-prefix verification. |
| internal/codex/live_usage_compressed_test.go | Tests restoration, rewrites and corrupt histories. |
| internal/codex/daemon_wire.go | Implements bounded, negotiated zstd streaming. |
| internal/codex/daemon_wire_test.go | Tests negotiation, framing, limits and shutdown. |
| internal/codex/daemon_status.go | Adds coverage data to daemon snapshots. |
| internal/codex/daemon_status_unix.go | Integrates compression, coverage queries and account invalidation. |
| internal/codex/daemon_native_unix_test.go | Adds an opt-in native Codex compression smoke test. |
| go.sum | Records compression and TOML dependency checksums. |
| go.mod | Adds dependencies and requires Go 1.27.3. |
Review effort: Balanced
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.

Codex 0.163–0.164 changes response accounting, settings restoration and transport behavior. This PR keeps Codexometer's existing monitoring and session controls compatible, prevents incomplete background usage from producing misleading API-EQ capacity estimates, and preserves accounting when compressed histories are restored.
Scope
No new slash commands, workflow management or settings editors are introduced.
Changes
.jsonl.zstinto bounded baselines under the same logical identity as.jsonl. Retain decoded offsets and recent response IDs; verify the complete restored prefix before accounting for appended responses. Rewrites rebase, duplicate siblings do not count twice, and existing observed totals, per-session tokens, model calls and turn timings survive compression/restoration, including rewritten restores for the same thread. No decompressed transcript is written to disk.x-codex-app-server-compression: zstd-stream-v1format, keeping persistent zstd history separately in each direction and resetting it on reconnect. Fall back to plain JSON when unacknowledged. Enforce message/window bounds and flush boundaries; reject malformed streams, unexpected message types and unknown acknowledgements. Dependencies remain pure Go.The fixes and compatibility changes are separated into individual commits. A separate maintenance commit updates the required Go patch to 1.27.3: the security check found the existing 1.27.2 toolchain affected by GO-2026-6809. No Go module vulnerabilities were reported. CI separately identified security advisories in the existing Vite 8.3.2 development tooling; another maintenance commit updates it to 8.3.5 and rebuilds the embedded frontend.
Evidence and limits
Audited the exact upstream
rust-v0.162.0andrust-v0.164.0tags, including incomplete-response spending, background compaction, compression framing and persisted resume settings. Compression itself predates 0.164.0; this closes Codexometer's existing reader gap alongside the newer upstream compatibility changes.Unavailable background response usage cannot be reconstructed or priced from budget hints. Local configuration checks cannot prove hidden CLI overrides, remote configuration or other-machine activity; enabled flags in potentially selected profiles deliberately produce a conservative warning. These checks do not alter Codex configuration or claim complete billing coverage. Compressed source/decoded histories are limited to 256 MiB each; oversized or unreadable histories qualify coverage rather than silently becoming zero usage.
Validation
go test -race -cover -skip '^TestLocalisedScreens$' -timeout 10m ./.... Exhaustive locale screens remain in CI's dedicated cross-platform step.go vet ./...passes;govulncheckv1.8.0 reports no vulnerabilities after the toolchain patch.CGO_ENABLED=0: Linux, macOS and Windows, each on amd64 and arm64.ZSTD_compressStream2(ZSTD_e_flush), independently of the Go codec; tests cover retained stream history, multi-block messages, fresh-connection resets, plain fallback, malformed/truncated frames, message types, size limits and decoder shutdown.