diff --git a/lib/daemon.sh b/lib/daemon.sh index bd64942..fff2c56 100644 --- a/lib/daemon.sh +++ b/lib/daemon.sh @@ -117,7 +117,13 @@ _start_gmail_poller() { # Export needed env vars for subprocess export GARC_DIR GARC_LIB GARC_CONFIG GARC_CACHE_DIR GARC_DEFAULT_AGENT - [[ -f "${GARC_CONFIG}/config.env" ]] && export $(grep -v '^#' "${GARC_CONFIG}/config.env" | xargs) 2>/dev/null || true + # Use set -a/+a instead of export $(xargs) to handle values with spaces + if [[ -f "${GARC_CONFIG:-${HOME}/.garc}/config.env" ]]; then + set -a + # shellcheck disable=SC1090 + source "${GARC_CONFIG:-${HOME}/.garc}/config.env" 2>/dev/null || true + set +a + fi ( _gmail_poller_loop "${agent_id}" "${interval}" "${label}" "${max_msgs}" \ >> "${GMAIL_POLLER_LOG}" 2>&1 ) & diff --git a/lib/ingress.sh b/lib/ingress.sh index 026a57d..bfb505e 100644 --- a/lib/ingress.sh +++ b/lib/ingress.sh @@ -394,7 +394,13 @@ _ingress_context() { [[ -z "${queue_file}" ]] && { echo "Queue item not found: ${queue_id}" >&2; return 1; } local agent_id="${GARC_DEFAULT_AGENT:-main}" - local context_path="${GARC_CACHE_DIR}/workspace/${agent_id}/AGENT_CONTEXT.md" + local context_path="${GARC_CACHE_DIR:-${HOME}/.garc/cache}/workspace/${agent_id}/AGENT_CONTEXT.md" + + if [[ ! -f "${context_path}" ]]; then + echo "⚠️ Agent context not found: ${context_path}" >&2 + echo " Run 'garc bootstrap --agent ${agent_id}' first." >&2 + echo " Continuing without agent context." >&2 + fi python3 "${INGRESS_HELPER}" build-prompt \ --queue-file "${queue_file}" \ @@ -629,13 +635,13 @@ _ingress_update_status() { queue_file=$(_find_queue_file "${queue_id}") [[ -z "${queue_file}" ]] && return 1 - python3 - <