Add --port (and --host) so aw-tauri can supervise on non-default ports - #40
Open
rmorgans wants to merge 1 commit into
Open
Add --port (and --host) so aw-tauri can supervise on non-default ports#40rmorgans wants to merge 1 commit into
rmorgans wants to merge 1 commit into
Conversation
aw-tauri passes `--port <n>` to autostarted modules whenever its server is
not on the default port 5600:
} else if server_port != 5600 {
command.args(["--port", server_port.to_string().as_str()]);
}
aw-watcher-input accepted only `--testing` and `--help`, so it exited with
`Error: No such option: --port` and aw-tauri retried it until it gave up.
The watcher therefore could not be supervised by aw-tauri on any non-default
port, including the standard testing port 5666.
ActivityWatchClient already takes `host` and `port`, so this just exposes and
forwards them. `--host` is included alongside `--port` to match aw-watcher-afk,
which has offered both for the same reason.
Typed with Optional rather than `X | None` to stay within the declared
`python = "^3.8"`.
Verified on macOS 26.6.2 (Apple Silicon), ActivityWatch 0.14.0b4:
- before: aw-tauri on 5666 fails to start the released watcher, and
aw-watcher-input_<host> is absent while the afk and window buckets exist
- after: `aw-watcher-input --port 5666` connects, creates its bucket on
5666, and records events with real input data
- `make typecheck` clean, black reports no changes, `--help` exits 0
Greptile SummaryExposes the ActivityWatch server address through the watcher CLI so supervisors can run it against non-default endpoints.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The new options match the client’s accepted argument types and override semantics, while omitted values continue to resolve through the existing production or testing configuration. Important Files Changed
Reviews (1): Last reviewed commit: "feat: add --host and --port options" | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
aw-tauripasses--port <n>to autostarted modules whenever its server uses a non-default port (manager.rs#L737-L745):aw-watcher-inputaccepted only--testingand--help, so it cannot be supervised by aw-tauri on any non-default port — including the standard testing port 5666. It is the only bundled watcher with this gap;aw-watcher-afkandaw-watcher-windowboth take--port.Reproduction
With
aw-watcher-inputin the autostart list, aw-tauri logs:aw-tauri retries and then leaves the module stopped. Measured on 5666: the
aw-watcher-afk_<host>andaw-watcher-window_<host>buckets are created,aw-watcher-input_<host>is absent, and no input events are collected.At the default port 5600 no argument is injected and the watcher runs correctly, so this only affects non-default ports.
Fix
ActivityWatchClientalready acceptshostandport, so this exposes and forwards them.--hostis included alongside--portto matchaw-watcher-afk, which offers both.Typed with
Optional[...]rather thanX | Noneto stay within the declaredpython = "^3.8".Verification
On the same machine and build:
No such option: --port; input bucket absentaw-watcher-input --port 5666aw-watcher-input_<host>on 5666, records events with real input datamake typecheckSuccess: no issues found in 3 source filesblack --check1 file would be left unchangedaw-watcher-input --helpmake testasserts)Confirmed the events landed on the 5666 server rather than the one on 5600.
Workarounds, for anyone hitting this before it lands
args = "--testing"— explicitcustom_argsstop aw-tauri injecting--port. That does not help for arbitrary non-default ports.🤖 Generated with Claude Code