Skip to content

Cron/agent runners: nested quoting in command payload can break (unterminated quoted string) #166

Closed

Description

@Golden-Koi

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.

Activity

  1. autogame-17 commented on Mar 4, 2026

    @autogame-17
    Member

    Fixed in v1.24.0.

    The root cause was the use of shell-based echo '...' | node -e "..." in llmReview.js, which broke when prompts contained quotes or special characters. This was especially problematic when invoked from cron jobs or agent runners that add additional escaping layers.

    Fix: Replaced the shell pipeline with execFileSync + temp file approach, which bypasses shell interpretation entirely and eliminates all quoting issues.

    Your best-practice recommendations are still valid and we agree -- for cron configurations, prefer simple single commands like bash -lc '/path/to/script.sh' over complex chained shell segments.

    Release: https://github.com/EvoMap/evolver/releases/tag/v1.24.0

  2. added a commit that references this issue on Mar 4, 2026
    1288495
  3. added a commit that references this issue on Mar 11, 2026
    0ebb225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions