Skip to content

docs: document env vars for notify-send hooks in detached sessions#3531

Merged
Sayt-0 merged 1 commit into
mainfrom
docs/notify-send-hook-env-vars
Jul 8, 2026
Merged

docs: document env vars for notify-send hooks in detached sessions#3531
Sayt-0 merged 1 commit into
mainfrom
docs/notify-send-hook-env-vars

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

The "Get Desktop Notifications with Hooks" tip did not mention the environment variables notify-send needs outside a desktop terminal, and misstated when sound_threshold applies.

Changes

Change Detail
notify-send env vars Added a paragraph and example using the per-hook env option with DISPLAY and DBUS_SESSION_BUS_ADDRESS for detached contexts (SSH, tmux started outside the desktop session, containers), where the notification is otherwise dropped silently
Sound sentence Corrected: the failure sound plays immediately on error; sound_threshold (default 10s) only gates the success sound (see pkg/tui/page/chat/runtime_events.go)
Closing link Now points to the per-hook options (env, working_dir, timeout) documented in the hooks reference

Notes

  • Hooks inherit the process environment (pkg/hooks/handler.go); docker-agent injects no env vars into hooks, the payload arrives via stdin JSON. The per-hook env option is the supported way to provide missing session variables.
  • env placement in the example matches the HookDefinition schema in agent-schema.json.

Validation

  • markdownlint: 0 errors

The desktop notifications tip did not mention that notify-send needs
DISPLAY and DBUS_SESSION_BUS_ADDRESS when docker-agent runs outside a
desktop terminal (SSH, detached tmux, containers), where the hook
fails silently. Add an example using the per-hook env option.

Also correct the sound_threshold sentence: the failure sound plays
immediately on error, the threshold only gates the success sound.
@Sayt-0 Sayt-0 requested a review from a team as a code owner July 8, 2026 11:18
@Sayt-0 Sayt-0 merged commit b14164c into main Jul 8, 2026
18 checks passed
@Sayt-0 Sayt-0 deleted the docs/notify-send-hook-env-vars branch July 8, 2026 11:28
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