Skip to content

fix: warn before slow CLI commands#22

Merged
ferueda merged 5 commits into
mainfrom
codex/cli-activity-feedback
Jul 15, 2026
Merged

fix: warn before slow CLI commands#22
ferueda merged 5 commits into
mainfrom
codex/cli-activity-feedback

Conversation

@ferueda

@ferueda ferueda commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • print one startup warning for sessions index, sessions data compact, and sessions data repair-orphans when stderr is interactive
  • keep redirected and captured invocations silent; stdout, structured output, and exit codes remain unchanged
  • safely renew the exact writer owner around potentially long session-replacement transactions
  • explain supported recovery when a pre-release library checksum is incompatible

Why

Slow commands need immediate expectation-setting, but a live elapsed counter proved disproportionate for synchronous SQLite work: keeping it responsive required scheduler yields or a worker boundary. This PR intentionally removes that POC. The final UI is one line such as:

Indexing sessions; this may take a couple of minutes.

Live testing also exposed a separate correctness bug: one unusually large Codex session can exceed the 30-second writer lease inside a synchronous replacement transaction. The timer heartbeat cannot run during that transaction, so cleanup could report writer-lease-lost after canonical work committed. Replacement and replacement-failure recording now use the existing fenced leased-transaction primitive, which renews the unchanged exact owner under SQLite's write lock.

Verification

  • pnpm check
  • 76 test files and 759 tests passed
  • focused CLI, indexing, Codex rollout, compact, repair, and writer-coordination suite: 6 files and 98 tests passed
  • deterministic lease proofs for a replacement crossing expiry and expired-owner failure recording
  • existing stale-owner takeover fencing remains green
  • interactive compiled CLI smoke showed the warning before the final result; absent-library compaction created no data
  • prior disposable-library replay exercised the large-session lease fix with complete source coverage and a healthy post-run SQLite integrity check

@ferueda ferueda changed the title feat: show activity for slow CLI commands fix: warn before slow CLI commands Jul 15, 2026
@ferueda ferueda self-assigned this Jul 15, 2026
@ferueda ferueda marked this pull request as ready for review July 15, 2026 23:44
@ferueda ferueda merged commit cbba3f3 into main Jul 15, 2026
7 checks passed
@ferueda ferueda deleted the codex/cli-activity-feedback branch July 15, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant