@rallycry/conveyor-agent 10.7.5 → 10.8.2

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.
package/dist/cli.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  runStartCommand,
29
29
  sampleKeyUsage,
30
30
  terminateProcessGroup
31
- } from "./chunk-CWTQXS34.js";
31
+ } from "./chunk-LBMFXTIV.js";
32
32
  import "./chunk-7TQO4ZF4.js";
33
33
 
34
34
  // src/cli.ts
package/dist/index.d.ts CHANGED
@@ -306,10 +306,10 @@ declare class ModeController {
306
306
  /**
307
307
  * Auto mode always bypasses the plan turn: resolveInitialMode calls
308
308
  * transitionToBuilding() at boot, so the agent runs with
309
- * `--dangerously-skip-permissions` from turn 1 and documents its plan into
310
- * the card (via update_task_plan) as the approach firms up non-blocking,
311
- * never a gate. Use discovery mode for a plan turn that stops for human
312
- * approval. Non-auto modes never bypass.
309
+ * `--dangerously-skip-permissions` from turn 1. The prompts require it to
310
+ * post its plan to the card (via update_task_plan) before writing code
311
+ * a record for the team, never an approval gate. Use discovery mode for a
312
+ * plan turn that stops for human approval. Non-auto modes never bypass.
313
313
  */
314
314
  canBypassPlanning(_context: ModeTaskContext): boolean;
315
315
  /** Handle mode change from server */
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  unshallowRepo,
21
21
  updateRemoteToken,
22
22
  uploadSnapshotToGcs
23
- } from "./chunk-CWTQXS34.js";
23
+ } from "./chunk-LBMFXTIV.js";
24
24
  import "./chunk-7TQO4ZF4.js";
25
25
 
26
26
  // src/runner/worktree.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rallycry/conveyor-agent",
3
- "version": "10.7.5",
3
+ "version": "10.8.2",
4
4
  "description": "Conveyor Agent Runner v10 - PTY harness for the task chat (SDK harness for audit/project-chat). Agent-as-User architecture with BaseService patterns. Works locally too.",
5
5
  "keywords": [
6
6
  "agent",
@@ -835,6 +835,22 @@ trap 'echo "[pool] SIGTERM received, forwarding to agent..."; pkill -TERM -f con
835
835
  # sleep so the pod idles instead of spinning.
836
836
  GIT_PREP_MAX_RETRIES=3
837
837
  _git_prep_attempts=0
838
+ # Bounded agent-crash supervision. An agent that keeps dying is a pod that keeps
839
+ # burning; cap the restarts, report every attempt to the API (the report posts to
840
+ # the task's activity log, which is also what keeps the pod alive through
841
+ # recovery), and exit for good once the cap is hit.
842
+ AGENT_CRASH_ATTEMPTS=0
843
+ AGENT_CRASH_MAX=3
844
+
845
+ report_agent_crash() {
846
+ # $1 = exit code, $2 = attempt, $3 = final (true/false). Best-effort.
847
+ curl -s -m 10 -X POST \
848
+ -H "Authorization: Bearer ${POD_BOOTSTRAP_TOKEN}" \
849
+ -H "Content-Type: application/json" \
850
+ -d "{\"exitCode\":${1},\"attempt\":${2},\"final\":${3}}" \
851
+ "${CONVEYOR_API_URL}/api/v3/pods/agent-crash" >/dev/null 2>&1 || true
852
+ }
853
+
838
854
  while true; do
839
855
  if [ -f "$GIT_FAILED_MARKER" ]; then
840
856
  if [ "$_git_prep_attempts" -lt "$GIT_PREP_MAX_RETRIES" ]; then
@@ -852,11 +868,18 @@ while true; do
852
868
  echo "[pool] agent exited cleanly (code 0), shutting down pod."
853
869
  exit 0
854
870
  fi
871
+ AGENT_CRASH_ATTEMPTS=$((AGENT_CRASH_ATTEMPTS + 1))
872
+ if [ "$AGENT_CRASH_ATTEMPTS" -ge "$AGENT_CRASH_MAX" ]; then
873
+ echo "[pool] agent crashed (code $_exit_code) — attempt cap ${AGENT_CRASH_MAX} reached, giving up."
874
+ report_agent_crash "$_exit_code" "$AGENT_CRASH_ATTEMPTS" true
875
+ exit 1
876
+ fi
877
+ report_agent_crash "$_exit_code" "$AGENT_CRASH_ATTEMPTS" false
855
878
  if [ -f "$GIT_FAILED_MARKER" ] && [ "$_git_prep_attempts" -ge "$GIT_PREP_MAX_RETRIES" ]; then
856
- echo "[pool] agent crashed (code $_exit_code) after git prep exhausted retries, backing off (60s)..."
879
+ echo "[pool] agent crashed (code $_exit_code) after git prep exhausted retries, backing off (60s, attempt ${AGENT_CRASH_ATTEMPTS}/${AGENT_CRASH_MAX})..."
857
880
  sleep 60
858
881
  else
859
- echo "[pool] agent crashed (code $_exit_code), retrying in 10s..."
882
+ echo "[pool] agent crashed (code $_exit_code), retrying in 10s (attempt ${AGENT_CRASH_ATTEMPTS}/${AGENT_CRASH_MAX})..."
860
883
  sleep 10
861
884
  fi
862
885
  done