Skip to content

Conversation

@vrubezhny
Copy link
Contributor

This adds support for a CLI Watcher in che-machine-exec to prevent DevWorkspace idling when long-running CLI tools are running in the terminal.

The watcher is user-configurable via a '.noidle' YAML file. No admin privileges are required.

How configuration is resolved:

The '.noidle' file is located by searching in the following order:

  • A path specified by the CLI_WATCHER_CONFIG environment variable
  • Searching upward from the current project directory toward $PROJECTS_ROOT, looking for .noidle
  • Falling back to '$HOME/.noidle' (e.g. '~/.noidle')
  • If not found, CLI Watcher waits and checks again on the next poll

Example .noidle configuration:

enabled: true
watchedCommands:
  - helm
  - odo
  - sleep
checkPeriodSeconds: 60

Where:

  • enabled: Enables or disables the CLI watcher (boolean)
  • watchedCommands: List of command names to monitor
  • checkPeriodSeconds: Polling interval in seconds (default is 60)

Benefits:

  • Works entirely in user space — no container or cluster admin config needed
  • Supports live updates (file can be added, edited, or removed while running)
  • Helps avoid idle timeout disconnects during long-running CLI workflows
  • Allows workspace authors to tailor idle behavior to specific tools

Note: Some processes are always excluded from watching:

  • PID 1 (the main container process)
  • tail (typically always running in containers)

Issue: eclipse-che/che#23529

…kspace from stopping due to idling

This adds support for a CLI Watcher in che-machine-exec to prevent DevWorkspace idling when long-running CLI tools are running in the terminal.

The watcher is user-configurable via a '.noidle' YAML file. No admin privileges are required.

How configuration is resolved:

The '.noidle' file is located by searching in the following order:

- A path specified by the CLI_WATCHER_CONFIG environment variable
- Searching upward from the current project directory toward $PROJECTS_ROOT, looking for .noidle
- Falling back to '$HOME/.noidle' (e.g. '~/.noidle')
- If not found, CLI Watcher waits and checks again on the next poll

Example .noidle configuration:

```yaml
enabled: true
watchedCommands:
  - helm
  - odo
  - sleep
checkPeriodSeconds: 60
```

Where:
- enabled: Enables or disables the CLI watcher (boolean)
- watchedCommands: List of command names to monitor
- checkPeriodSeconds: Polling interval in seconds (default is 60)

Benefits:

- Works entirely in user space — no container or cluster admin config needed
- Supports live updates (file can be added, edited, or removed while running)
- Helps avoid idle timeout disconnects during long-running CLI workflows
- Allows workspace authors to tailor idle behavior to specific tools

Note: Some processes are always excluded from watching:
- PID 1 (the main container process)
- tail (typically always running in containers)

Issue: eclipse-che/che#23529

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
@vrubezhny vrubezhny self-assigned this Nov 5, 2025
@azatsarynnyy azatsarynnyy merged commit b327303 into eclipse-che:7.111.x Nov 6, 2025
9 checks passed
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.

3 participants