From 9325131db33cc4264fc509e07d8964097005e27b Mon Sep 17 00:00:00 2001 From: autocommit Date: Fri, 17 Apr 2026 21:37:32 -0700 Subject: [PATCH] =?UTF-8?q?feat(auto-commit-service):=20=E2=9C=A8=20Add=20?= =?UTF-8?q?config=20options=20for=20local=20commit=20control=20and=20dry-r?= =?UTF-8?q?un=20mode=20in=20the=20tray=20application?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/auto_commit_service/tray/app.py | 31 ++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/auto_commit_service/tray/app.py b/src/auto_commit_service/tray/app.py index 67a15f4..79875aa 100644 --- a/src/auto_commit_service/tray/app.py +++ b/src/auto_commit_service/tray/app.py @@ -49,6 +49,9 @@ class CommitsTrayApp(rumps.App): daemon_url: str = "http://localhost:8200", repos_paths: list[Path] | None = None, cycle_seconds: int = DEFAULT_CYCLE_SECONDS, + commit_local: bool = True, + dry_run: bool = False, + max_diff_bytes: int = 131072, ): super().__init__( name="Commits", @@ -58,6 +61,7 @@ class CommitsTrayApp(rumps.App): self._daemon_url = daemon_url self._repos_paths = repos_paths or [Path.home() / "Code"] + self._commit_local = commit_local # Remote daemon client (for status + LLM health checks) self.client = DaemonClient(base_url=daemon_url) @@ -67,6 +71,8 @@ class CommitsTrayApp(rumps.App): acs_url=daemon_url, repos_paths=self._repos_paths, cycle_seconds=cycle_seconds, + dry_run=dry_run, + max_diff_bytes=max_diff_bytes, ) # For local commit history display @@ -111,8 +117,11 @@ class CommitsTrayApp(rumps.App): self._quit_item, ] - # Start the local agent - self.agent.start() + # Start the local agent only when explicitly enabled + if self._commit_local: + self.agent.start() + else: + logger.info("commit_local=False — tray in monitor-only mode, agent not started") # Start polling self._poll_timer = rumps.Timer(self._poll, POLL_INTERVAL) @@ -310,12 +319,28 @@ def run_tray( daemon_url: str = "http://localhost:8200", repos_paths: list[Path] | None = None, cycle_seconds: int = DEFAULT_CYCLE_SECONDS, + commit_local: bool = True, + dry_run: bool = False, + max_diff_bytes: int = 131072, ) -> None: - """Launch the menu bar application with local commit agent.""" + """Launch the menu bar application with local commit agent. + + Args: + daemon_url: URL of the remote ACS daemon (for LLM message generation). + repos_paths: Base paths to scan for local git repos. + cycle_seconds: Seconds between commit cycles. + commit_local: If True (default), start the local commit agent on launch. + Pass False to run tray in monitor-only mode (no local commits). + dry_run: If True, scan and generate messages but skip git commit/push. + max_diff_bytes: Per-repo diff size cap before truncation. + """ logging.basicConfig(level=logging.INFO, format="%(asctime)s %(name)s %(message)s") app = CommitsTrayApp( daemon_url=daemon_url, repos_paths=repos_paths, cycle_seconds=cycle_seconds, + commit_local=commit_local, + dry_run=dry_run, + max_diff_bytes=max_diff_bytes, ) app.run()