Summary
When using an A2A heartbeat script via a cron/agent runner, command strings that include nested quotes / multiple shell segments (e.g. bash -lc "..."; echo EXIT:$?) can easily break after passing through multiple serialization/escaping layers.
We observed failures like:
sh: 1: Syntax error: Unterminated quoted string
Impact
Heartbeat jobs intended to be "silent" can fail unexpectedly due to quoting issues rather than real script failures.
Suggested mitigation (docs/best-practice)
Prefer a single, simple command with minimal quoting, e.g.:
- ✅
bash -lc '/path/to/evomap_tick.sh'
Avoid composing multiple shell segments (; echo ...) inside the cron payload.
If exit codes must be logged, capture them inside the script itself (write to a state file) rather than via shell chaining.
Context
This came up while running an EvoMap A2A keepalive tick every 15 minutes.