Skip to content

fix: use stdout-based config dir detection instead of exitCode#215

Open
isaacrowntree wants to merge 1 commit intocloudflare:mainfrom
isaacrowntree:fix/sync-exitcode
Open

fix: use stdout-based config dir detection instead of exitCode#215
isaacrowntree wants to merge 1 commit intocloudflare:mainfrom
isaacrowntree:fix/sync-exitcode

Conversation

@isaacrowntree
Copy link

Summary

Fixes #212

  • The sandbox API sometimes returns null for process.exitCode even when the process succeeds
  • This caused null !== 0 to always evaluate true, making R2 backups permanently fail with "Sync aborted: no config file found"
  • Switch from test -f openclaw.json (exitCode-based) to ls -A (stdout-based) which is reliable regardless of exitCode
  • Also broadens the check from requiring a specific config file to checking the directory has any content, supporting OpenClaw versions that store config data in subdirectories without openclaw.json

Test plan

  • Existing sync tests updated and passing
  • New test: syncs successfully when directory has content but exitCode is null
  • New test: correctly aborts when both config directories are empty
  • Deploy and verify cron backups run successfully

🤖 Generated with Claude Code

…flare#212)

The sandbox API sometimes returns null for process.exitCode even when
the process succeeds. This caused `null !== 0` to always evaluate true,
making R2 backups permanently fail with "no config file found".

Switch from `test -f openclaw.json` (exitCode check) to `ls -A` (stdout
check) which is reliable regardless of exitCode. Also broadens the check
from requiring a specific config file to checking the directory has any
content, supporting OpenClaw versions that may not create openclaw.json.

Fixes cloudflare#212

Co-Authored-By: Claude Opus 4.6 <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.

R2 backup does not run: Sync aborted: no config file found

1 participant