Skip to content

Manage idle localhost servers and their process trees - #200

Closed
yxlyx wants to merge 1 commit into
mainfrom
feat/199-idle-localhost-lifecycle
Closed

Manage idle localhost servers and their process trees#200
yxlyx wants to merge 1 commit into
mainfrom
feat/199-idle-localhost-lifecycle

Conversation

@yxlyx

@yxlyx yxlyx commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • automatically move simple recognized localhost/dev-server commands (npm run dev, pnpm preview, next start, vite, python -m http.server, etc.) into supervised background jobs
  • pause managed servers after 30 minutes of inactivity and stop them after 2 hours, with global environment overrides and a per-job keep_alive pin
  • add bash_resume plus managed/paused/pinned/idle-stopped visibility in /jobs
  • launch shell tools in their own POSIX process groups, so cancellation, timeout, bash_kill, idle stop, and session exit terminate npm/node/XCTest-style descendant trees rather than only /bin/sh
  • document the lifecycle and configuration

Idle activity is deliberately local to the managed job: new stdout/stderr or an explicit bash_output/bash_resume call. Codegraff does not scan or interfere with unrelated localhost listeners.

Defaults can be configured with:

GRAFF_SERVER_PAUSE_MINUTES=15 GRAFF_SERVER_STOP_MINUTES=60 graff
GRAFF_SERVER_IDLE=off graff

Tests

  • zig fmt --check on all changed Zig files
  • zig build test (includes command-recognition/lifecycle tests and a process-group cleanup integration test)
  • zig build -Doptimize=ReleaseFast
  • cross-build: zig build -Dtarget=x86_64-linux -Doptimize=ReleaseFast
  • cross-build: zig build -Dtarget=x86_64-windows -Doptimize=ReleaseFast
  • generated graff --schema parses as JSON and includes bash_resume

Closes #199.
Related to #198.

Automatically supervise recognized development servers, pause and stop them after configurable inactivity, expose resume and keep-alive controls, and terminate POSIX process trees instead of leaving descendants behind.

Closes #199
Related to #198

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
@justrach

Copy link
Copy Markdown
Owner

Closing as abandoned vs tip. Idle localhost supervision is parked (#199): jobs already cover tool-started bash; they do not pause forgotten next dev trees, and 282 is not starting a process-supervisor product. Reopen against tip if that product is wanted.

@justrach justrach closed this Aug 31, 2026
cursor Bot pushed a commit that referenced this pull request Aug 31, 2026
The parked Smolify and idle-localhost PRs are closed as abandoned vs tip;
issues stay inventory. Live leftovers remain #675 and #677.
yermakoffivan pushed a commit to yermakoffivan/codegraff that referenced this pull request Aug 31, 2026
…justrach#694

Record the three product merges on the new release branch, remap the
TLS-generation ADR to 0048 so 0042 stays TUI claims, and leave justrach#277 /
justrach#200 parked.
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.

Auto-pause and stop Codegraff-started localhost servers after inactivity

2 participants