Repository navigation
FIX: detect rollout activity despite stale Windows timestamps - #87
Conversation
Use owned event timestamps and observed size changes alongside filesystem mtime. Bootstrap complete tail records, including oversized records, without recounting tokens. Preserve definite requests and real inactivity warnings.
|
Updated and reviewed against main/v0.24.0. a05592b merges current main without rewriting the contributor commit. 8112a30 fixes the review findings: compressed-history event freshness and growth preservation, logical byte-size tracking including partial tails (so identical restores do not look like new activity), bounded/cancellable activity scans and cancellation during restoration verification. Main’s current-turn failure guards are retained. Added deterministic regressions for these paths and documented the conservative 4 MiB record limit. Validation passed: full Go core race suite, all-package vet, all-17-language screen matrix, all 96 browser tests, frontend checks/build, native Windows activity/history/failure tests, Go vulnerability scan and both frontend dependency audits. Embedded frontend assets remain unchanged. The PR description now reflects the actual delta from current main. |
There was a problem hiding this comment.
🟡 Changes recommended
Five unresolved moderate findings affect activity preservation, coverage freshness, bounded scanning, and ownership handling.
1 open issue
What changed in this PR
This pull request improves rollout activity detection when Windows modification times are stale, while preserving token accounting and session behavior across plain and compressed histories.
Changes:
- Adds bounded, cancellable scanning for file growth and owned event timestamps.
- Integrates activity tracking with discovery, polling, compression restoration, and same-thread rebasing.
- Adds regression coverage and README documentation for Windows behavior and scan limits.
Review findings:
internal/codex/live_usage.go(moderate, 1 vote): Preserve the newer observed event timestamp during same-thread history rebasing.internal/codex/live_usage.go(moderate, 1 vote): Use activity-based freshness and the reader clock when selecting linked-child coverage candidates.internal/codex/live_usage_compressed.go(moderate, 3 votes): Restrict compressed-history event observation to the documented bounded decoded tail.internal/codex/live_usage_compressed.go(moderate, 1 vote): Defer compressed event ownership checks until session metadata is known.internal/codex/live_usage_compressed.go(moderate, 1 vote): Preserve the newer event timestamp during compressed same-thread rebasing.
| File | Description |
|---|---|
README.md |
Documents stale Windows timestamps, fallback activity signals, and scan limits. |
internal/codex/rollout_activity.go |
Implements bounded plain JSONL activity scanning, ownership filtering, and cancellation. |
internal/codex/rollout_activity_test.go |
Tests stale timestamps, growth, partial records, ownership, boundaries, and precedence. |
internal/codex/rollout_activity_smoke_test.go |
Adds an explicit opt-in read-only local-session smoke test. |
internal/codex/rollout_activity_compressed_test.go |
Tests compressed restoration, rebasing, bounds, ownership, and cancellation. |
internal/codex/live_usage.go |
Integrates activity signals into discovery, consumption, session grouping, and cancellation. |
internal/codex/live_usage_test.go |
Makes inactivity behavior deterministic under the new activity model. |
internal/codex/live_usage_exact_test.go |
Updates exact-usage tests for context-aware file discovery. |
internal/codex/live_usage_compressed.go |
Restores compressed histories and tracks decoded size and event freshness. |
internal/codex/live_usage_compressed_test.go |
Updates compressed-history integration coverage. |
Review effort: Lite
|
thanks @Peace7, this was released as https://github.com/merefield/codexometer/releases/tag/v0.24.1 |

Why
Windows may retain an old rollout modification time while Codex keeps its writer handle open. Relying on that timestamp alone can produce a false CHECK SESSION warning during genuine activity, or exclude a live rollout once its apparent age exceeds the active-history horizon. This is separate from the older-turn failure restoration fixed in #90.
Activity detection
Bounded work and cancellation
Review and integration
Merged current main (v0.24.0), resolving the reader/README conflicts while retaining subsequent compressed-history, error-status and security fixes. Retained the original contributor's implementation and tests, then added coverage for the integration edge cases identified in review.
Validation
govulncheckand both runtime-only/all-dependency frontend audits reported no vulnerabilities.The optional local-session smoke test remains read-only and requires explicit environment opt-in. No new live Codex turn was started to test this change.