Skip to content

fix(schedule-crons): point example sync-memory cron at workspace script - #732

Merged
sonichi merged 2 commits into
mainfrom
fix/crons-example-sync-memory-path
May 16, 2026
Merged

sonichi merged 2 commits into
mainfrom
fix/crons-example-sync-memory-path

Conversation

@qingyun-wu

Copy link
Copy Markdown
Collaborator

Summary

`crons.example.json` ships a sync-memory cron prompt pointing at `/.sutando-memory-sync/scripts/sync-memory.sh`. That path only exists after a successful first-time setup — `scripts/sync-memory.sh` clones the private memory repo to `/.sutando-memory-sync/` on first run.

For any user who copies the example and registers the cron before running setup (or never sets `SUTANDO_MEMORY_REPO` at all), every 30-min firing is just `bash: /Users//.sutando-memory-sync/scripts/sync-memory.sh: No such file or directory`.

Hit this today on the primary node: my own `crons.json` had `src/sync-memory.sh` (also wrong — the file lives at `scripts/sync-memory.sh`), corrected locally + on the running cron, then noticed the checked-in template was equivalently broken.

Why the workspace path is the right default

`scripts/sync-memory.sh` handles both the pre-setup and post-setup case gracefully:

  • Pre-setup: prints `sync-memory: SUTANDO_MEMORY_REPO not set in .env, skipping sync.` and exits 0.
  • Post-setup: auto-detects the clone via `SUTANDO_MEMORY_SYNC_DIR` / script-relative resolution (see comments in `scripts/sync-memory.sh:1-30`), then runs as before.

The clone-local path doesn't get that fallback — it's just a missing file when setup hasn't happened.

Test plan

  • `bash scripts/sync-memory.sh` (no `SUTANDO_MEMORY_REPO` set) → `skipping sync.`, exit 0.
  • JSON validates.
  • Owner: after setting `SUTANDO_MEMORY_REPO` + completing first-time setup, the cron continues to work because the script's self-detection takes over.

🤖 Generated with Claude Code

qingyun-wu and others added 2 commits May 15, 2026 17:39
`crons.example.json` shipped a sync-memory cron prompt pointing at
`~/.sutando-memory-sync/scripts/sync-memory.sh`. That path only exists
*after* a successful first-time setup (the workspace script clones the
private memory repo there on first run).

For any user who copies the example and lands a 30-min cron before
running setup — or who never sets `SUTANDO_MEMORY_REPO` at all — every
cron firing is just `bash: ...: No such file or directory`.

`scripts/sync-memory.sh` (the workspace path) handles both the
pre-setup and post-setup case gracefully:
- Pre-setup: prints `SUTANDO_MEMORY_REPO not set in .env, skipping sync.`
- Post-setup: auto-detects the clone via SUTANDO_MEMORY_SYNC_DIR /
  script-relative resolution, then runs as before.

Point the example at the workspace path so the cron is functional
before setup completes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@sonichi sonichi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM. One-line example-config fix; correct that scripts/sync-memory.sh is the bootstrap, ~/.sutando-memory-sync/... only exists post-clone.

@sonichi
sonichi merged commit 040f675 into main May 16, 2026
1 check passed
@sonichi
sonichi deleted the fix/crons-example-sync-memory-path branch May 16, 2026 06:41
liususan091219 pushed a commit to liususan091219/sutando-fork that referenced this pull request May 28, 2026
…pt (sonichi#732)

`crons.example.json` shipped a sync-memory cron prompt pointing at
`~/.sutando-memory-sync/scripts/sync-memory.sh`. That path only exists
*after* a successful first-time setup (the workspace script clones the
private memory repo there on first run).

For any user who copies the example and lands a 30-min cron before
running setup — or who never sets `SUTANDO_MEMORY_REPO` at all — every
cron firing is just `bash: ...: No such file or directory`.

`scripts/sync-memory.sh` (the workspace path) handles both the
pre-setup and post-setup case gracefully:
- Pre-setup: prints `SUTANDO_MEMORY_REPO not set in .env, skipping sync.`
- Post-setup: auto-detects the clone via SUTANDO_MEMORY_SYNC_DIR /
  script-relative resolution, then runs as before.

Point the example at the workspace path so the cron is functional
before setup completes.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants