← Back to PRs

#10912: feat: add --session-key to clawdis system event

by SocialNerd42069 open 2026-02-07 05:24 View on GitHub →
docs gateway cli docker agents stale
## Summary Fixes issue #4 - background CLI callbacks (like Codex or heartbeats) can now target a specific session instead of always routing to main. ## Problem When a background process calls `clawdis system event`, it has no way to pass thread context. The Gateway always wakes up in the main channel instead of the originating thread. ## Solution Add `--session-key` option to `clawdis system event`: ```bash clawdis system event --text 'Task done!' --mode now --session-key 'agent:main:slack:channel:C123:thread:456' ``` ## Changes - Add `--session-key` option to CLI (`src/cli/system-cli.ts`) - Pass sessionKey through wake payload (`src/gateway/hooks.ts`) - Use provided sessionKey in dispatchWakeHook, falls back to main if not provided (`src/gateway/server/hooks.ts`) ## Testing - Build passes - Backward compatible (sessionKey is optional, defaults to main session) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> - Adds a `--session-key` option to `clawdis system event` and threads the value through the gateway wake hook payload so background callbacks can target a specific session. - Updates hook normalization and dispatch types (`normalizeWakePayload`, `dispatchWakeHook`) to carry an optional `sessionKey` and fallback to the main session. - Enhances followup-runner Slack behavior by reconstructing thread/channel context so tool sends stay in the originating thread. - Includes several unrelated container/docs changes (Dockerfile tooling installs, new compose override, backup compose file, cron bug doc). <h3>Confidence Score: 2/5</h3> - Not safe to merge as-is due to unrelated container changes and an incomplete sessionKey plumbing path. - Core `sessionKey` wiring looks straightforward, but the PR introduces substantial unrelated Docker/image changes (external binary downloads) and adds a tracked backup compose file. Additionally, hook-mapped wake actions don’t forward `sessionKey`, so the feature is inconsistent across code paths. - Dockerfile, docker-compose.yml.bak, src/gateway/server-http.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs