agentradar-cli 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -138,6 +138,13 @@ else
138
138
  # `agentradar join` pins `--resume <id>` / `--session-id <id>` so the service never resumes the vendor's
139
139
  # own conversation in the same folder; an env file that sets nothing keeps `--continue`.
140
140
  AR_RESUME_FLAGS="${AR_RESUME_FLAGS:---continue}"
141
+ # A heal (below) wrote its new session id next to the env file; a restart honors it, so it never resumes the poisoned id.
142
+ # Only while newer than the env file: a re-join rewrites the env file and its pin wins again.
143
+ _SID_FILE="${ENV_FILE}.session-id"
144
+ if [ -f "${_SID_FILE}" ] && [ "${_SID_FILE}" -nt "${ENV_FILE}" ] && IFS= read -r _saved_sid < "${_SID_FILE}" \
145
+ && [[ "${_saved_sid}" =~ ^[0-9a-fA-F-]{36}$ ]]; then
146
+ AR_RESUME_FLAGS="--resume ${_saved_sid}"; AR_FRESH_FLAGS="--session-id ${_saved_sid}"
147
+ fi
141
148
  : "${MCP_CONFIG:?MCP_CONFIG required (path to awp-only.json)}"
142
149
  # SC2086: CLAUDE_EXTRA_FLAGS is intentionally UNQUOTED so "--chrome" (etc.) word-splits into flags.
143
150
  # shellcheck disable=SC2086
@@ -332,7 +339,8 @@ ensure_agent() {
332
339
  case "${AR_AGENT_HARNESS}:${AR_RESUME_FLAGS} ${AR_FRESH_FLAGS}" in
333
340
  claude:*--resume\ *|claude:*--session-id\ *)
334
341
  _new_sid="$(node -e 'process.stdout.write(require("crypto").randomUUID())')" || die "could not generate a fresh session id"
335
- _resume_now="--session-id ${_new_sid}"; AR_RESUME_FLAGS="--resume ${_new_sid}"; AR_FRESH_FLAGS="--session-id ${_new_sid}" ;;
342
+ _resume_now="--session-id ${_new_sid}"; AR_RESUME_FLAGS="--resume ${_new_sid}"; AR_FRESH_FLAGS="--session-id ${_new_sid}"
343
+ printf '%s\n' "${_new_sid}" > "${_SID_FILE}.tmp" && mv "${_SID_FILE}.tmp" "${_SID_FILE}" || log "WARN could not save the new session id to ${_SID_FILE}" ;;
336
344
  esac
337
345
  _FORCE_FRESH=0
338
346
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentradar-cli",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },