Skip to content

Background Jobs & Shell Watchdog

Hardware engineering frequently involves lengthy EDA flows such as synthesis, place-and-route, formal proofs, or full simulation regressions. To keep your interactive workflow fluid, NEX features robust background job management and a shell watchdog.

Background Shell Jobs

Instead of blocking the interface while waiting for long commands to finish, NEX can run these tasks as detached background jobs. When a long process is initiated, NEX receives a job handle immediately, freeing up the chat interface so you can continue working on other files or tasks.

Managing Jobs

NEX provides integrated tooling and a dedicated /jobs UI to manage background tasks:

  • Polling: NEX can check a background job's status and read new log output incrementally without downloading the entire log history every time.
  • Listing: View all running and finished background jobs, including their current status and total runtime.
  • Killing: If a job is stuck or no longer needed, NEX can terminate it cleanly. The partial log output is preserved on disk for debugging.

Searching Logs Mid-Run

Because the full log of a background job is securely stored on disk, NEX can perform targeted searches (e.g., using grep) through the log file even while the job is still running.

Shell Watchdog

NEX emits a Shell Watchdog heartbeat while a foreground shell command runs. The heartbeat reports elapsed time and time since the command last produced output; it does not stop the command.

By default, a heartbeat appears every 300 seconds. Set SHELL_WATCHDOG_INTERVAL to change the interval in seconds, or set it to 0 to disable heartbeats. Background jobs are managed separately through /jobs.

Token Optimization Features

Alongside these capabilities, NEX includes underlying optimizations to make your sessions faster and more cost-effective:

  • Poll Wait Mode: Reduces the overhead of checking job statuses by waiting efficiently, preventing unnecessary rapid polling.
  • Read-Path Capping: Prevents flooding the LLM context window when searching or reading very large directories and files.
  • Atomic Multi-edit: Applies complex, multi-file patches in a single structured transaction. This not only saves token spend but ensures that edits either succeed entirely or fail safely without leaving files in a corrupted intermediate state.