Skip to content

Daemon module#1

Merged
EdgeCaser merged 3 commits intomainfrom
daemon-module
Mar 21, 2026
Merged

Daemon module#1
EdgeCaser merged 3 commits intomainfrom
daemon-module

Conversation

@EdgeCaser
Copy link
Copy Markdown
Owner

No description provided.

EdgeCaser and others added 3 commits March 21, 2026 13:05
…est, and service install

Implements the full optional daemon module (pip install memsync[daemon]):
- DaemonConfig dataclass in config.py with 20 configurable fields
- scheduler.py: APScheduler wrapper with 4 jobs (nightly refresh, backup
  mirror, drift check, weekly digest) — all jobs return early gracefully
- web.py: Flask UI for browser-based GLOBAL_MEMORY.md view/edit
- capture.py: REST endpoint for iPhone Shortcuts mobile note capture
- digest.py: weekly email digest via Claude API
- service.py: systemd (Linux) and launchd (Mac) service installation
- watchdog.py: thin wrapper for standalone drift check invocation
- notify.py: env-var-first SMTP password, file-flag, log channels
- 8 daemon CLI subcommands: start/stop/status/schedule/install/uninstall/web
- 67 new tests (188 total, 25 smoke), 80% coverage, 0 lint errors
- pyproject.toml: [daemon] optional dependency group (apscheduler, flask)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Step-by-step installation and usage guide for users with minimal code
experience. Covers Python installation, API key setup, memsync init,
filling in the memory file, the daily refresh workflow, multi-machine
setup, and a troubleshooting section for the most common error cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@EdgeCaser
Copy link
Copy Markdown
Owner Author

daemon time

@EdgeCaser EdgeCaser merged commit 8126fab into main Mar 21, 2026
0 of 7 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 255264784f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pip install -e ".[dev]"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Install daemon extras before running pytest in CI

In the test job, dependencies are installed with pip install -e ".[dev]", but the test suite includes tests/test_daemon_* modules that import memsync.daemon.* at import time, which requires optional daemon packages like Flask/APScheduler. With the current install line, those imports fail with ModuleNotFoundError, so CI will fail before executing the daemon tests; install daemon extras in this job (for example .[dev,daemon]) or exclude daemon tests from this matrix.

Useful? React with 👍 / 👎.

Comment on lines +35 to +36
sync_root = config.sync_root or provider.detect()
memory_root = provider.get_memory_root(sync_root)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle missing sync root in capture endpoint

get_session_log() uses config.sync_root or provider.detect() and immediately passes the result into provider.get_memory_root(...) without checking for None. If the configured provider is unavailable (or its folder is temporarily not mounted) and sync_root is unset, POST /note raises a TypeError and returns 500 instead of a graceful error/skip path, making the capture service unusable in that state.

Useful? React with 👍 / 👎.

Comment on lines +65 to +66
sync_root = config.sync_root or provider.detect()
return provider.get_memory_root(sync_root) / "GLOBAL_MEMORY.md"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle missing sync root in web UI path resolver

The web UI path resolver has the same unchecked provider detection path: it computes sync_root = config.sync_root or provider.detect() and then builds the memory path from it without guarding None. On hosts where the provider cannot be detected, GET / and POST /save can fail with server errors instead of returning a clear actionable response, which breaks the daemon web interface whenever sync storage is unavailable.

Useful? React with 👍 / 👎.

@EdgeCaser EdgeCaser deleted the daemon-module branch March 22, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant