Skip to content

feat: Enhanced CLI Watcher with automatic terminal process monitoring#363

Open
vrubezhny wants to merge 1 commit into
eclipse-che:mainfrom
vrubezhny:feat-idling-interative-cli-activity-tracking
Open

feat: Enhanced CLI Watcher with automatic terminal process monitoring#363
vrubezhny wants to merge 1 commit into
eclipse-che:mainfrom
vrubezhny:feat-idling-interative-cli-activity-tracking

Conversation

@vrubezhny

Copy link
Copy Markdown
Contributor

CLI Watcher now automatically detects and tracks terminal-based development activity, distinguishing between interactive CLIs (vim, REPLs) and work processes (builds, deploys) without manual configuration.

Key Features:

  • Fully automatic: Only requires 'enabled: true' - auto-detects ALL terminal processes
  • Smart defaults: Adapts activityWindow and gracePeriod to workspace idle timeout
  • Automatic classification: Interactive (vim, python REPL) vs work (builds, deploys)
  • Backward compatible: Old configs continue working with deprecation warnings
  • Safety mechanisms: Grace period (5min), max age limit (6h), activity monitoring
  • Flexible duration parsing: Accepts 6h, 25m, 60 (seconds), or duration strings

Configuration:

  • Minimal: enabled: true (that's it!)
  • Smart defaults: Auto-calculated from workspace idle timeout
  • Time settings: checkPeriod, activityWindow, gracePeriod, maxProcessAge
  • Override options: watchedCommands (fix misclassification), ignoredCommands (skip entirely)

Technical Implementation:

  • User process filtering: Parent TTY chain analysis (filters shells, system processes)
  • Interactive detection: Foreground process group + TTY read analysis
  • Activity tracking: TTY access time (Atime) monitoring for user input
  • Multicall binary support: Uses /proc/comm for proper command detection
  • Self-skip: che-machine-exec doesn't watch itself
  • Config validation: Warns about misconfigurations without breaking

Documentation:

  • timeout/CLI-WATCHER.md - Comprehensive guide with testing scenarios
  • timeout/.noidle.minimal - Minimal config example
  • timeout/.noidle.example - Full config with all options

Issue: https://redhat.atlassian.net/browse/CRW-11505

CLI Watcher now automatically detects and tracks terminal-based development
activity, distinguishing between interactive CLIs (vim, REPLs) and work
processes (builds, deploys) without manual configuration.

Key Features:
- Fully automatic: Only requires 'enabled: true' - auto-detects ALL terminal processes
- Smart defaults: Adapts activityWindow and gracePeriod to workspace idle timeout
- Automatic classification: Interactive (vim, python REPL) vs work (builds, deploys)
- Backward compatible: Old configs continue working with deprecation warnings
- Safety mechanisms: Grace period (5min), max age limit (6h), activity monitoring
- Flexible duration parsing: Accepts 6h, 25m, 60 (seconds), or duration strings

Configuration:
- Minimal: enabled: true (that's it!)
- Smart defaults: Auto-calculated from workspace idle timeout
- Time settings: checkPeriod, activityWindow, gracePeriod, maxProcessAge
- Override options: watchedCommands (fix misclassification), ignoredCommands (skip entirely)

Technical Implementation:
- User process filtering: Parent TTY chain analysis (filters shells, system processes)
- Interactive detection: Foreground process group + TTY read analysis
- Activity tracking: TTY access time (Atime) monitoring for user input
- Multicall binary support: Uses /proc/comm for proper command detection
- Self-skip: che-machine-exec doesn't watch itself
- Config validation: Warns about misconfigurations without breaking

Documentation:
- timeout/CLI-WATCHER.md - Comprehensive guide with testing scenarios
- timeout/.noidle.minimal - Minimal config example
- timeout/.noidle.example - Full config with all options

Issue: https://redhat.atlassian.net/browse/CRW-11505

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
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