Skip to content

fix(notifications): emit context notification for intentional stops - #87

Merged
aliou merged 3 commits into
chore/code-tweaksfrom
fix/intentional-stop-context-notification
Aug 22, 2026
Merged

fix(notifications): emit context notification for intentional stops#87
aliou merged 3 commits into
chore/code-tweaksfrom
fix/intentional-stop-context-notification

Conversation

@378-kaiabot

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

Copy link
Copy Markdown

Note

Automated pull request by Pi, model radius/glm-5.2. Implemented and validated empirically against
aliou/pi-processes on branch chore/code-tweaks. See the local run log for the full investigation.

Summary

Fixes #72.

Intentional process kills via the /ps overview panel (pressing x) were completely silent to the agent since v0.10.0. killIntentionally marks the stop with markIntentionalStop, and NotificationService.handleProcessEnded suppressed the lifecycle notification entirely for intentional stops — so the agent never learned the process ended, neither as a turn nor as context.

This was a regression from v0.9.5, where process_ended events were always sent to the conversation (display: true) and the alertOnKill flag only controlled triggerAgentTurn.

Change

Instead of fully suppressing notifications for intentional stops, emit them at context attention. This preserves the v0.9.5 behavior:

  • The agent is not woken (triggerTurn stays false).
  • The agent does receive the lifecycle message so it can keep its state accurate and respond when context next returns to it.

The user's onKilled/onSuccess/onFailure config is intentionally ignored for intentional stops: a user-initiated kill should never wake the agent, and should always be visible as context.

Files

  • extensions/processes/notifications/service.ts — emit a context lifecycle notification in the isIntentionalStop branch instead of returning early.
  • extensions/processes/notifications/service.test.ts — updated the two tests that asserted full suppression (suppresses killed notification for intentional stop, suppresses $name exit notification for intentional stop) to assert a context notification is emitted, plus registry cleanup.
  • .changeset/intentional-stop-context-notification.md — patch changeset.

Verification

  • pnpm test — 576 passed.
  • pnpm typecheck, pnpm lint, pnpm check:changesets — clean.
  • Pre-commit hooks ran green.

Run host: golden-hugo-lefevre · Session: 01a00ed9-e2cb-78d1-8cbf-c0b091d55f0f · Model: radius/glm-5.2

Intentional process kills via the /ps overview panel were completely
silent to the agent since v0.10.0: markIntentionalStop caused
NotificationService to suppress the lifecycle notification entirely.

Emit the notification at context attention instead of fully suppressing
it. The agent is not woken (triggerTurn stays false), but it receives
the lifecycle message so it can keep its state accurate and respond when
context next returns.

The user's onKilled/onSuccess/onFailure config is intentionally ignored
for intentional stops: a user-initiated kill should never wake the
agent, and should always be visible as context.
@378-kaiabot
378-kaiabot Bot force-pushed the fix/intentional-stop-context-notification branch from 066cade to f6b1d0f Compare August 17, 2026 08:43
Document how process lifecycle and log-watch events become agent
notifications: the two-layer fanout (NotificationService emits on
CHANNELS.NOTIFICATION, delivery listener sends the Pi message), the
per-process notify config and defaults, attention-level mapping, the
forced-display rule for crashes/failures, the intentional-stop config
bypass, the terminate_timeout non-emit path, log-match matching and
rate limiting, and a summary matrix of end state to attention.

Uses callstacks per end state to show which notification each path
triggers and where user config is ignored. Focuses on events; UI
rendering is out of scope.
@aliou aliou self-assigned this Aug 17, 2026
@aliou
aliou self-requested a review August 17, 2026 08:48
Add docs/README.md as an index for the docs directory, covering
notifications.md and the two future-design notes. Update AGENTS.md
to point at docs/ for both living docs and future-design proposals,
with upkeep rules: update the relevant doc when lifecycle,
notifications, config, or public behavior changes; anchor call
stacks to symbols and plain paths, never line numbers.
@378-kaiabot
378-kaiabot Bot force-pushed the fix/intentional-stop-context-notification branch from 5b6f7dc to a9acdca Compare August 17, 2026 09:03
@378-kaiabot
378-kaiabot Bot force-pushed the fix/intentional-stop-context-notification branch from a9acdca to 4cc4631 Compare August 17, 2026 11:45
@378-kaiabot
378-kaiabot Bot force-pushed the fix/intentional-stop-context-notification branch from 4cc4631 to a9acdca Compare August 17, 2026 16:48
@aliou aliou linked an issue Aug 17, 2026 that may be closed by this pull request
@aliou
aliou merged commit bfcdc89 into main Aug 22, 2026
4 checks passed
@aliou
aliou deleted the fix/intentional-stop-context-notification 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.

Intentional process kills via /ps are silent to the agent

2 participants