Name each project's notifier in its config, with Mattermost and Slack as backends
CI / tests (pull_request) Successful in 2m3s

This commit is contained in:
2026-11-14 22:53:00 +01:00
parent f648f4235a
commit 6a553b9574
25 changed files with 495 additions and 229 deletions
+3 -3
View File
@@ -12,10 +12,10 @@ import termios
import time
import typing
from mattermost_dm.dm import dm, http_json
from failure import Failure
from git_cli import git_repo
from machine_load.memory import Memory, read_memory
from notifier.notify import notify
# Seconds before a Python script loop-claude runs is stopped, so a hung one, such as chunk-preflight, cannot hold the loop.
PYTHON_TIMEOUT = 600
@@ -35,7 +35,7 @@ class Effects:
claude_on_terminal: typing.Callable[[list[str], str, dict[str, str]], int]
# Drops what was typed on the terminal and not yet read.
discard_typed: typing.Callable[[], None]
# Sends the human a direct message on Mattermost, as `mattermost-dm` does, for the project whose checkout holds the current directory; a Failure where it could not.
# Sends the human a direct message through the notifier the project's config names, as `notify` does, for the project whose checkout holds the current directory; a Failure where it could not.
dm: typing.Callable[[str], Failure | None]
execv: typing.Callable[[str, list[str]], None]
git: git_repo.Git
@@ -69,7 +69,7 @@ def system_effects() -> Effects:
claude=lambda args, cwd, stdin: subprocess.run(["claude", *args], capture_output=True, cwd=cwd, input=stdin, text=True),
claude_on_terminal=claude_on_terminal,
discard_typed=lambda: termios.tcflush(sys.stdin, termios.TCIFLUSH),
dm=lambda text: dm(text, None, pathlib.Path.home(), http_json),
dm=lambda text: notify(text, None, pathlib.Path.home()),
execv=os.execv,
git=git_repo.git,
input=input,