Skip to content

feat: add debug extension for programmatic process start - #93

Merged
aliou merged 1 commit into
fix/intentional-stop-context-notificationfrom
debug/programmatic-process-control
Aug 22, 2026
Merged

feat: add debug extension for programmatic process start#93
aliou merged 1 commit into
fix/intentional-stop-context-notificationfrom
debug/programmatic-process-control

Conversation

@378-kaiabot

@378-kaiabot 378-kaiabot Bot commented Aug 17, 2026

Copy link
Copy Markdown

Note

Automated pull request by Pi, model aperture/hf:zai-org/GLM-5.2. Implemented and validated empirically against
aliou/pi-processes on branch fix/intentional-stop-context-notification. See the local run log for the full investigation.

Summary

Starting a background process during debugging required prompting the agent to use the process tool — there was no
way to do it programmatically from a slash command. This adds a processes-debug extension (not listed in
package.json) that registers /debug:ps:start <name> <command>, which starts a process through the core extension's
new COMMAND_START protocol channel. The process is fully visible to the agent's process tool (list, output, stop).

Verified empirically: loaded the local extensions via pi -ne -e ~/pi-processes-debug/ -e ~/pi-processes-debug/extensions/processes-debug/index.ts,
ran /debug:ps:start test ./tests/e2e/scripts/continuous-output.sh, confirmed the process appeared in the status bar
(ps: ● test), then prompted the agent to list processes — it found test (proc_1b8d) running.

Changes

  • extensions/shared/protocol/channels.ts — added COMMAND_START channel alongside existing COMMAND_KILL / COMMAND_CLEAR.
  • extensions/shared/protocol/commands.ts — added CommandStartPayload and CommandStartResult types.
  • extensions/shared/protocol/index.ts — exported the new types.
  • extensions/processes/handlers/commands.ts — handle COMMAND_START: calls manager.start() and notifications.register() with a default empty notify config, same path the process tool's executeStart takes.
  • extensions/processes/client.ts — added requestStart client helper that emits on the COMMAND_START channel and returns a promise.
  • extensions/processes-debug/index.ts — the debug extension: a single /debug:ps:start command that parses <name> <command> and calls requestStart. Not in package.json; loaded explicitly via -e.

Verification

  • tsc --noEmit
  • biome check ✅ (10 files, no fixes applied)
  • vitest run ✅ (576 passed, 59 test files)

Stacked on #87 — merge that first.


Run host: golden-hugo-lefevre · Session: 01a00fb1-0d78-790a-8fbf-f6abd049c168 · Model: aperture/hf:zai-org/GLM-5.2

Add a new 'processes-debug' extension that is NOT listed in package.json.
Load it alongside the local core extension via:
  pi -ne -e ~/pi-processes-debug/ -e ~/pi-processes-debug/extensions/processes-debug/index.ts

It registers a single /debug:ps:start command that starts a background
process through the core extension's protocol channel (new COMMAND_START),
so the process is fully visible to the agent's process tool. This enables
starting processes during debugging without prompting the agent.

Changes to the core extension:
- Add COMMAND_START channel and CommandStartPayload type to the shared protocol
- Handle COMMAND_START in registerCommandHandlers (calls manager.start +
  notifications.register with default empty notify config)
- Add requestStart client helper in extensions/processes/client.ts
@378-kaiabot
378-kaiabot Bot force-pushed the debug/programmatic-process-control branch from 5ebc97e to 544f2f7 Compare August 17, 2026 16:48
@aliou
aliou marked this pull request as ready for review August 18, 2026 18:36
@aliou
aliou merged commit 69298e2 into main Aug 22, 2026
2 checks passed
@aliou
aliou deleted the debug/programmatic-process-control branch August 22, 2026 11:20
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.

2 participants