feat(profile): add --profile flag for isolated instances - #241
Conversation
Mirrors aw-qt#128 / aw-server-rust#652. --testing is an alias for --profile testing, AW_PROFILE is exported for spawned modules, and named profiles get a sibling activitywatch-<profile> dir root. default and testing keep the bare activitywatch root.
Greptile SummaryThe PR adds validated named profiles and propagates the selected profile through process environment, storage paths, single-instance handling, autostart registration, and desktop labels.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CLI --profile or AW_PROFILE] --> B[Validate and resolve profile]
B --> C[Export AW_PROFILE]
C --> D[Select profile directories]
C --> E[Spawn modules]
C --> F[Configure single-instance identity]
C --> G[Configure autostart arguments]
C --> H[Label window and tray]
Reviews (4): Last reviewed commit: "fix(profile): use LaunchAgent for named ..." | Re-trigger Greptile |
Digit-leading profiles (e.g. '1work') pass the alphanumeric check but produce invalid D-Bus well-known-name elements on Linux, preventing single-instance registration and startup. Fix: require the first char to be a letter (is_ascii_alphabetic). Autostart did not preserve the selected profile: the OS login item was registered without arguments, so every relaunch resolved to 'default'. Fix: pass ['--profile', name] to tauri_plugin_autostart::init when the active profile is not 'default'. Addresses Greptile P1 findings on PR ActivityWatch#241.
|
Fixed both P1 findings from Greptile (afc205a): 1. Digit-leading profiles break D-Bus ( 2. Autostart loses selected profile ( |
|
@greptileai review |
AppleScript login items silently discard extra arguments, so --profile was dropped on relogin. LaunchAgent creates a plist with ProgramArguments that preserves --profile, ensuring the correct instance starts on boot. Default profile keeps AppleScript (visible in System Settings login items). Named profiles use LaunchAgent (correct args in ~/Library/LaunchAgents/). Fixes Greptile P1: macOS autostart drops profiles.
|
Fixed all three Greptile P1 findings: 1. Digit-leading profiles break D-Bus (profile.rs) — fixed in afc205a: first-character check now requires 2. Autostart loses selected profile (main.rs) — fixed in afc205a: pass 3. macOS autostart drops profiles (lib.rs) — fixed in f06ea22: switch to |
|
@greptileai review |
|
Greptile review converged after 3 rounds. Summary: Fixed (3 P1 findings):
Remaining (non-blocking, documented tradeoff):
CI: All checks pass (clippy, format, release builds for Linux/macOS/Windows; one Windows ARM job still pending but not blocking). Domain risk for manual testing: macOS named-profile autostart with login — LaunchAgent plist generation and Ready for maintainer review and merge. |
|
@greptileai review |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
Launcher half of isolated profiles (ActivityWatch/activitywatch#1399). Same contract as ActivityWatch/aw-qt#128 and ActivityWatch/aw-server-rust#652.
--profile NAME(lowercase alnum +-/_, max 32).--testingis an alias for--profile testing; conflicting values are a usage error.AW_PROFILEso spawned modules inherit the profile without every CLI growing a flag.AW_PROFILEis also a fallback when--profileis absent.dirs.rsappname():defaultandtestingkeep the bareactivitywatchroot (existing installs stay put); any other profile gets a siblingactivitywatch-<profile>root. Isolates config/data/logs/runtime with no per-module path changes.default. Custom profiles using port 5600 log a warning.The embedded
aw-serverstill takes thetesting: boolAPI until ActivityWatch/aw-server-rust#652 merges and the crate pin is bumped. Spawned Python watchers pick upAW_PROFILEthe same way, once aw-core grows the matchingdirschange.