Skip to content

v2.35.0: Daemons can report their current activity through OSC 7501; stop --all asks before stopping other projects

Latest

Choose a tag to compare

@jdx jdx released this 16 Nov 20:14
· 11 commits to main since this release
Immutable release. Only release title and notes can be modified.
04e30ca

Daemons can now report what they are doing, and pitchfork shows it in list, status, the TUI and the web UI. pitchfork stop --all now asks before it stops daemons that belong to other projects, and progress output stays readable when stderr is redirected.

Added

  • Daemons can report their status with OSC 7501 (#1125) by @jdx. Pitchfork reads Program Status Protocol (OSC 7501) reports from daemon output and shows the most recent one in pitchfork list, pitchfork status, the TUI and the web UI. You can see which phase a long-running job or cron job is in without reading its logs.

    # in a script run by a daemon
    printf '\033]7501;state=working:progress=40:msg=%s\033\\' "$(printf 'Syncing GitHub issues' | base64)"
    $ pitchfork list
    Name          Status
    nightly-sync  running  working 40% Syncing GitHub issues
    
    • This is always on and needs no configuration. Daemons that never emit OSC 7501 behave as before. It works for piped and PTY daemons, and a report is picked up without waiting for a newline.
    • idle, working and blocked reports are cleared when the process exits. done and error reports stay until the next run starts.
    • Only the root record is tracked, so reports with an id are ignored. Reports with an invalid msg (control characters, bad base64, or anything over the spec limits) are also ignored.
    • list --json and status --json now include an optional program_status object, and the web API includes a program_status string.
    • The new guide is at docs/guides/program-status.md.

Fixed

  • pitchfork stop --all asks before stopping daemons outside the current project (#1123, fixes #1122) by @jdx. Before, running stop --all to shut down one project's daemons also stopped every other project's daemons. Now, if it would stop daemons that the current project's config doesn't define, it lists them first:

    $ pitchfork stop --all
    This will stop the following daemons outside this project:
      * agent-env-docker/dockerd
      * agent-env-files/dufs
    Stop all daemons? [y/N]
    

    In an interactive terminal it stops them only if you answer y or yes. Without a terminal it refuses and exits non-zero. The new -f/--force flag, which only works with --all, skips the check. Behavior doesn't change when every running daemon belongs to the current project, or when you use --local, --global, --group or name the daemons. Outside any project, every daemon counts as outside.

  • Progress output no longer floods logs when stderr isn't a terminal (#1127, fixes #1126) by @jdx, with the patch suggested by @neilconway. When stderr goes to CI logs, files or pipes, pitchfork now prints one plain line per status change. Before, the spinner redraws produced thousands of repeated lines full of escape codes. Interactive terminals still get the animated spinner, and CLX_TEXT_MODE=1 still forces text mode.

  • Windows process stats can no longer hang on parent-PID cycles (#1130) by @jdx. Windows can report a process tree that contains cycles. Collecting CPU and memory stats now visits each process only once, so it can't loop forever or count a process twice. The same PR makes schema, usage and api-schema start without spinning up a worker thread pool.

Breaking Changes

  • Scripts, CI jobs and agents that run pitchfork stop --all without a terminal now fail if daemons from other projects are running. To keep the old machine-wide behavior, use pitchfork stop --all --force. To stop only the current project's daemons, use pitchfork stop --local.

Full Changelog: v2.34.0...v2.35.0

💚 Sponsor pitchfork

pitchfork is built and maintained by @jdx, an open source developer at entire.io, the title sponsor of his open source work.

If pitchfork has a place in your development workflow, please consider becoming an individual or company sponsor. Your support funds ongoing development and helps keep pitchfork fast, free, and independent.