Skip to content

Intentional process kills via /ps are silent to the agent #72

Description

@aliou

Summary

When a user kills a running process via the /ps overview panel (pressing x), the agent receives no notification at all. This is a regression from v0.9.5, where the agent at least saw a lifecycle message in context, even if it did not always get a turn.

Observed behavior

  1. Start a long-running process, e.g. bash tests/e2e/scripts/continuous-output.sh.
  2. Open /ps and press x on the running process.
  3. The process terminates, but the agent is never notified — neither as a turn nor as context.

Code analysis

In v0.9.5 (src/hooks/process-end.ts), process_ended events were always sent to the conversation (display: true). The alertOnKill/alertOnSuccess/alertOnFailure flags only controlled triggerAgentTurn. Killing a process via /ps set alertOnKill = false in manager.kill, so the agent was not woken, but it still received a context message.

Since v0.10.0:

  • extensions/processes/handlers/kill-process.ts marks the stop as intentional with notifications.markIntentionalStop(id).
  • extensions/processes/notifications/service.ts suppresses the killed/exit notification entirely for intentional stops.

As a result, intentional kills from /ps are completely invisible to the agent.

Expected behavior

Intentional kills should not wake the agent by default, but they should still be delivered as a context notification so the agent can keep its state accurate and respond when context next returns to it.

Suggested fix

Instead of fully suppressing notifications for intentional stops, emit them at context attention level. This preserves the v0.9.5 behavior where the agent knows the process ended, without forcing an idle turn.

Related

  • extensions/processes/handlers/kill-process.ts (killIntentionally)
  • extensions/processes/notifications/service.ts (intentional stop suppression)
  • Prior v0.9.5 behavior in src/hooks/process-end.ts

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions