Repository navigation
feat(sync): add macos launchd sync scheduling - #309
Merged
Merged
Conversation
Signed-off-by: samzong <samzong.lu@gmail.com>
This was referenced Oct 14, 2026
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Signed-off-by: samzong <samzong.lu@gmail.com>
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.
Summary
Add
recall sync schedule install|uninstall|statusto manage a macOS user LaunchAgent runningrecall sync --project all. Install immediately kickstarts the first sync. Subsequent runs retain the requested interval, defaulting to 30 minutes. Other platforms reject these commands with a nonzero exit status.The plist uses the absolute executable path, user log files, and
AbandonProcessGroup=trueso the embedding worker survives the sync process. Scheduled and manual syncs share the existing blocking lock; contention reports the lock owner's PID before waiting. Installation explains that macOS may request multiple folders in sequence: answer each prompt within 60 seconds, and reinstall to retry a failed first sync. Status reports the loaded job's last exit code, including the never-exited state.Rationale
launchd owns scheduling without a resident Recall daemon. A manual plist template would use the same scheduler but leave executable-path changes, load state, and cleanup to users. The CLI manages those operations and retains existing manual sync behavior. The accepted freshness target is the configured interval, defaulting to 30 minutes while the logged-in Mac is awake.
Core sync behavior change: Git metadata probe timeout
--project allto bypass automatic project inference; this does not bypass sync probes. There is no automatic retry.search,session list, andexportalso receive timeout errors. TUI scope inference remains best effort and reports an inference error before its existing global fallback.Test evidence
Toolchain: Recall 0.6.3, Cargo 1.96.0, cargo-audit 0.22.2, macOS 27.0.1 (26A434).
Final staged fingerprint:
cd8a079c4075c9bf9504df65c624171bd9b0b0f8, basea1f0ba53e714f2de2add48b43040135b94662d3e.The real-index acceptance artifact was built with
cargo build --releasefrom staged fingerprint9d46ce43f5f0989cac1edf20b53587cd5c391556; binary SHA25680cbfc8d42fdb93200465b97c4ca2a2c8bf3e770e6213b7c50c3893edf223b95.cargo build --releaseexited 0 in 1m52s; SHA25695ea2d30a5ae6dbd03219b6068de45275571b2c609391c5a010394dd843d0410. The final delta changes installation text, loaded-status reporting, documentation, and test duration; plist, kickstart, production timeout, and sync/error propagation are unchanged from the real-index acceptance artifact. The shared launchctl load query still treats exit 0 as loaded and 113 as missing.make check: exit 0,All checks passed; dependency audit, formatting, workspace Clippy with--all-targets --features bench, and workspace tests passed (947 core tests).search,session list, andexportrejected failed inference and succeeded with--project all. These previous entry experiments used the former five-second threshold; they were not repeated at 60 seconds. Normal and non-Git directory behavior was exercised again by the final workspace tests.Git metadata probe timed out after 60s; it may be blocked by folder permissions or a stalled Git process. The operation was stopped; this is not evidence of index corruption. Check folder permissions, operating system privacy controls, and whether Git responds in the reported directory, then retry. Read commands can use `--project all` to bypass automatic project inference../target/release/recall sync schedule install --interval 2mexited 0 and printedfirst sync started now; if macOS asks for folder access, click Allow within 60 seconds.launchctl print gui/501/io.github.samzong.recall.syncshowedprogram = /Users/x/git/samzong/Recall/target/release/recall, argumentssync --project all,run interval = 120 seconds, andabandon process group. Status agreed: installed, loaded, binary exists.authValue=2) in approximately 0.74 seconds, then an unanswered Downloads prompt caused a root probe of/Users/x/Downloadsto time out. The job exited 1 after 69.6 seconds, stdout was empty, and database mtime did not advance. The diagnostic is recorded at/tmp/recall-schedule-runtime-60s.log:110and the Documents TCC result in/tmp/recall-schedule-tcc-60s-request.log. The acceptance watchdog had matched only Documents; its matching was expanded to all Recall folder-access prompts. That 0.74-second TCC record belongs to the failed run, not the successful one.runs = 1. The successful run was PID 60057. At 108.9 seconds the job completed withlast exit code = 0. Fresh stdout was524 new, 8 updated, 28 backfilled, 8219 messages in 1m48s. Real database mtime advanced from1791948681101686409(2026-10-14T03:31:21.101686+00:00) to1791953105009847701(2026-10-14T04:45:05.009848+00:00). This was a normal incremental sync without--force; no additional installation or trigger was used.launchctl printexited 113 with service not found; plist was absent; status returnedNot installed,Loaded: no. Observed sync PID 60057 was absent. A nonblocking exclusive acquisition of the realsync.locksucceeded immediately and was released./bin/sh(no Recall sync):Last exit code: (never exited)before kickstart, thenLast exit code: 0andLast exit code: 7matching nativelaunchctl print. With no user plist, it accurately reportedNot installedandLoaded: yes. Cleanup used the final CLI uninstall: native print returned 113, status reportedLoaded: nowithout an exit-code field, and the real database mtime was unchanged. The real-index sync was not repeated after rebuilding.First sync: started now; macOS may ask for access to multiple folders in sequence (Documents, Downloads, Desktop, or other volumes). Click Allow within 60 seconds for each prompt; if the first sync fails, rerun `recall sync schedule install`.Unverified
Gate gaps
CI runs
make checkon Ubuntu. It does not exercise macOS plist roundtrips, launchd lifecycle and embedding-worker survival, sequential TCC permission prompts, real-index log/database updates, or loaded status output. Native acceptance remains a separate macOS check.Windows probe termination and the non-macOS CLI entrypoints have no real-installation evidence here. Uninterruptible kernel-I/O cleanup, sleep/logout, and another scheduled interval also remain outside the executed checks. These coverage gaps require platform testing or explicit manual acceptance; a green unit-test run alone does not cover them.