Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: patty-io/pi-patty-bg-tasks
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Apothic-AI/bizzy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 12 commits
  • 28 files changed
  • 1 contributor

Commits on Oct 8, 2026

  1. fix(input): steering backgrounds the command without aborting the turn

    Port upstream #27 (drop ctx.abort, deliver as steer)
    and #21 (assert the turn is never aborted; correct the bash.ts comments).
    
    #27 keeps #21 abort fix and additionally switches delivery from followUp to
    steer: a follow-up is drained only once a turn produces NO tool calls, so
    steering otherwise waited for the entire tool-chaining run to settle.
    #21 tests asserted followUp delivery and were retargeted to steer.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    12401dd View commit details
    Browse the repository at this point in the history
  2. fix(jobs): report a still-running job as running, not finished

    Port upstream #26. attachAction fell through to "finished" even when the job
    was still running (wait:false, or a job outliving its awaited donePromise),
    telling both the agent and the user that a live job had ended.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    13ad151 View commit details
    Browse the repository at this point in the history
  3. fix(bash): fire the bash timeout in non-interactive sessions

    Port upstream #15. The timeout timer returned early when the session was
    non-interactive, so the bash timeout never fired under -p / RPC.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    403d74e View commit details
    Browse the repository at this point in the history
  4. fix: report cleanup and resolution failures

    Port upstream #28. Monitor-follow cleanup and log-path resolution failures
    were swallowed rather than surfaced.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    27c63aa View commit details
    Browse the repository at this point in the history
  5. fix(monitor): a stale extension ctx no longer crashes pi via the stre…

    …am emit
    
    Port upstream #19. Preferred over the equivalent ad-hoc fix carried in the
    @ESSO0428 fork (1ea0e6d), which is not brought over.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    de5db4d View commit details
    Browse the repository at this point in the history
  6. fix: reap detached background jobs when the parent pi exits

    Port upstream #20. v2.0.0 kills jobs on session_shutdown, but spawn.ts
    unrefs the children, so a crashed or SIGKILLed pi left them running
    forever. Wires process exit plus SIGINT/SIGTERM/SIGHUP.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    d4e376b View commit details
    Browse the repository at this point in the history
  7. test(commands): fix the /bg-version assertion

    The notice ends with the absolute install directory, so anchoring on a
    trailing "pi-patty-bg-tasks" could never match. This suite was already
    red at v2.0.0, before any of the ported fixes.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    246c788 View commit details
    Browse the repository at this point in the history
  8. chore(deps): retarget peer/dev deps to pi >=1.1.0

    v2.0.0 was developed against pi 0.83 and pinned peers at >=0.79.0. Compiles
    and tests clean against 1.1.0; drop the old-version floor.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    6792435 View commit details
    Browse the repository at this point in the history
  9. chore(pkg)!: rename to pi-bizzy-bg-tasks and repoint at Apothic-AI/bizzy

    Renamed from pi-patty-bg-tasks so the fork never shadows the upstream npm
    package, and republished from Apothic-AI/bizzy. Upstream is untouched and
    nothing is sent back.
    
    - package.json: name, version 2.0.0 -> 2.1.0, repository URL, and a fork
      note in the description. `author` stays "Patrick Rho" — MIT requires
      the original copyright and he wrote this code.
    - LICENSE: keeps (c) patty.io, adds (c) Apothic for the fork changes.
    - READMEs (en/ko/zh): title, npm badge, install and clone commands, and a
      fork banner; author sections credit both Patty (original) and Apothic
      (fork maintainer). English README gains a "Fork deltas" section.
    - src/index.ts + src/commands.ts: header and the /bg-version fallback name.
    - commands.test.ts now matches an npm name@semver shape instead of
      hardcoding the package name, so a future rename cannot break it.
    - docs/superpowers/* deliberately left alone: dated design and plan records
      that name the package as it was, with the original authors paths.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    03f8f33 View commit details
    Browse the repository at this point in the history
  10. fix(test): hold the event loop open while awaiting background spawns

    spawnWithFileOutput calls proc.unref() so a background job never keeps pi
    alive. That is correct for production, but it means that once a spawn has
    returned nothing references the pending child, so a test awaiting that
    childs exit sees Node resolve the loop first and is cancelled with
    "Promise resolution is still pending but the event loop has already
    resolved". Because the unaffected tests still exit 0, this hid itself as
    a silently shrinking suite.
    
    Affected suites, measured before and after:
      spawn         0 pass / 6 cancelled  ->  6 pass / 0 cancelled
      bash-results  1 pass / 5 cancelled  ->  6 pass / 0 cancelled
      monitor       4 pass / 2 cancelled  ->  6 pass / 0 cancelled
    Whole suite: 150 pass / 1 fail / 12 cancelled -> 171 pass / 0 fail / 0 cancelled.
    
    Holding the loop once per file rather than wrapping each await means a test
    added later cannot silently regress back into cancellation. Production code
    is untouched; removing proc.unref() would make pi hang until every
    background job finished.
    
    The test script also gains --test-timeout=30000. Previously a spawn whose
    exit never resolved surfaced as a fast cancellation; with the loop held it
    would hang forever, so the timeout turns that into a visible failure.
    
    Notably this now actually executes the non-interactive bash-timeout case
    from #15 and the timeout-kill path, neither of which had ever run.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    641a4bb View commit details
    Browse the repository at this point in the history
  11. docs(readme): correct the now-fixed test-gap note

    The Fork deltas section described the spawn/bash-results/monitor
    cancellations as a known gap left open. That was true when written and is
    now false: the previous commit fixed them. Rewrite the bullet to record the
    fix, including that the non-interactive timeout case had never actually
    executed, and to state the new 171/0/0 result.
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    9e0015b View commit details
    Browse the repository at this point in the history
  12. fix: private per-user log dir, resilient spawn, agent_bg child isolation

    Three defects found by audit, each verified with a probe before and after.
    
    1. Job logs were world-readable. LOG_DIR was a hardcoded /tmp/pi-bg, and
       mkdirSync gave 0755 with openSync giving 0664, so every background job log
       was readable by any local user. Logs carry whatever a command printed,
       including anything echoed out of its own environment, and a predictable
       path in a shared directory is also pre-creatable by another user, whose
       ownership we would then write into. Logs now live under
       $XDG_STATE_HOME/pi-bg (absolute check, else ~/.local/state/pi-bg) at
       0700/0600, matching where pi-bg-bash keeps them.
    
    2. A vanished log directory wedged the process permanently. A module-level
       logDirCreated flag meant that once anything removed the directory (tmp
       cleaner, reboot, an agent running rm -rf) every LATER spawn in that
       process threw ENOENT for the rest of its life, because the flag said the
       directory existed so it was never recreated. openLogFd now creates it on
       ENOENT and retries, paying one mkdir only on the failure path. Proven:
       a second spawn after removing the dir went ENOENT before, works now.
    
    3. agent_bg children inherited this extension. The worker was spawned as a
       plain `pi -p`, so it loaded us too: it could nest further agent_bg calls,
       auto-background its own commands into a turn that had already ended
       (losing their completion notice), and install process signal handlers on a
       process it does not own. pi cannot exclude a single extension from a child
       (--no-extensions also strips the user own skills and MCP), so the child is
       marked via env and the extension stands down inside it. This is the concern
       behind upstream #7, which could not be ported because its file no longer
       exists upstream.
    
    Also: the model-facing tool descriptions hardcoded /tmp/pi-bg, so they now
    derive from LOG_DIR rather than going stale silently.
    
    7 regression tests added. Each was verified to FAIL against the unfixed code.
    The first attempt at the /tmp guard asserted against os.tmpdir() and passed
    against the broken value, because this box sets TMPDIR=/tmp/user/1000; it now
    compares the literal /tmp and pins the resolved root. Suite: 178 pass / 0 fail
    / 0 cancelled. Version 2.2.0 (log location is user-visible).
    bitnom committed Oct 8, 2026
    Configuration menu
    Copy the full SHA
    734332e View commit details
    Browse the repository at this point in the history
Loading