aiur-cli 0.0.8 → 0.0.9-nightly.5a0d430

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.
@@ -560,6 +560,46 @@ parse_todo_args() {
560
560
  [ "$saw_todo" -eq 1 ] && [ "${#parsed_targets[@]}" -gt 0 ]
561
561
  }
562
562
 
563
+ # `--todo` is the one control command whose runtime scales with its arguments
564
+ # rather than with daemon state: every requested ID is a GitHub issue fetch, and
565
+ # `--only` adds an active-ticket enumeration plus up to 50 serial label DELETEs.
566
+ # On a repo with a deep `agent:todo` queue that is minutes of network work, and
567
+ # the shared 10s budget killed it every time — labels half-applied, outcome
568
+ # reported as unknown, `--only` scoping unusable (#2519). Size the watchdog to
569
+ # the work instead. An explicit operator override still wins outright.
570
+ todo_rpc_seconds_base=15
571
+ todo_rpc_seconds_per_id=3
572
+ todo_rpc_seconds_only=90
573
+ # The daemon is handed a budget this many seconds shorter than the watchdog, so
574
+ # it always stops itself and prints its summary and exit marker before the
575
+ # watchdog can discard them.
576
+ todo_rpc_grace_seconds=10
577
+
578
+ todo_rpc_seconds() {
579
+ local id_count="$1" only="$2" seconds
580
+
581
+ # Only a usable override wins. Everywhere else an unset, zero, or malformed
582
+ # value falls back to the shared 10s default; here that default is the bug, so
583
+ # fall back to work-proportional sizing instead.
584
+ if [[ "${AIUR_CONTROL_RPC_TIMEOUT_SECONDS:-}" =~ ^[1-9][0-9]*$ ]]; then
585
+ printf '%s' "$AIUR_CONTROL_RPC_TIMEOUT_SECONDS"
586
+ return 0
587
+ fi
588
+
589
+ seconds=$((todo_rpc_seconds_base + todo_rpc_seconds_per_id * id_count))
590
+ [ "$only" -eq 1 ] && seconds=$((seconds + todo_rpc_seconds_only))
591
+ printf '%s' "$seconds"
592
+ }
593
+
594
+ # Never hand the daemon a non-positive budget: an operator who sets the override
595
+ # below the grace window should still get a bounded run rather than an unlimited
596
+ # one.
597
+ todo_daemon_budget_ms() {
598
+ local seconds=$(($1 - todo_rpc_grace_seconds))
599
+ [ "$seconds" -ge 1 ] || seconds=1
600
+ printf '%s' $((seconds * 1000))
601
+ }
602
+
563
603
  run_todo() {
564
604
  if ! parse_todo_args "$@"; then
565
605
  echo "aiur: --todo expects one or more numeric issue IDs, optionally followed by --only" >&2
@@ -568,7 +608,13 @@ run_todo() {
568
608
 
569
609
  local only_arg="false"
570
610
  [ "$parsed_todo_only" -eq 1 ] && only_arg="true"
571
- run_control_rpc "Aiur.AgentControlCLI.todo($(elixir_list_literal "${parsed_targets[@]}"), only: $only_arg, emit_exit_marker: true)"
611
+
612
+ local seconds budget_ms
613
+ seconds="$(todo_rpc_seconds "${#parsed_targets[@]}" "$parsed_todo_only")"
614
+ budget_ms="$(todo_daemon_budget_ms "$seconds")"
615
+
616
+ AIUR_CONTROL_RPC_TIMEOUT_SECONDS="$seconds" \
617
+ run_control_rpc "Aiur.AgentControlCLI.todo($(elixir_list_literal "${parsed_targets[@]}"), only: $only_arg, budget_ms: $budget_ms, emit_exit_marker: true)"
572
618
  }
573
619
 
574
620
  # --- one-shot: findings (distribution-free, no daemon/tmux) -------------------
@@ -834,9 +880,10 @@ run_session() {
834
880
  # supplied. `aiur --bg --interactive` opts back into the full terminal stack
835
881
  # for an attachable background session.
836
882
  build_run_argv "$mode" "$@"
837
- local no_dashboard=0
883
+ local no_dashboard=0 surface_mode=interactive
838
884
  for run_arg in "${run_argv[@]}"; do
839
885
  [ "$run_arg" = "--no-dashboard" ] && no_dashboard=1
886
+ [ "$run_arg" = "--headless" ] && surface_mode=headless
840
887
  done
841
888
  write_argv "${run_argv[@]}"
842
889
  export AIUR_ARGV_FILE="$argv_file"
@@ -1043,7 +1090,7 @@ run_session() {
1043
1090
  exit 1
1044
1091
  fi
1045
1092
 
1046
- write_aiur_instance_record "$session" "$socket"
1093
+ write_aiur_instance_record "$session" "$socket" replace "$surface_mode"
1047
1094
  release_aiur_launch_lock "$launch_lock"
1048
1095
  _session_launch_lock=""
1049
1096
  print_config_status "$startup_capture"
@@ -1549,7 +1596,7 @@ release_aiur_launch_lock() {
1549
1596
  }
1550
1597
 
1551
1598
  write_aiur_instance_record() {
1552
- local session="$1" socket="$2" write_mode="${3:-replace}" record_dir record tmp root
1599
+ local session="$1" socket="$2" write_mode="${3:-replace}" surface_mode="${4:-unknown}" record_dir record tmp root
1553
1600
  record_dir="$(aiur_instances_dir)"
1554
1601
  record="$(aiur_instance_record_path)"
1555
1602
  root="$(canonical_workspace_root "${AIUR_PROJECT_ROOT:-}")"
@@ -1561,6 +1608,7 @@ write_aiur_instance_record() {
1561
1608
  printf 'AIUR_RECORD_SESSION=%q\n' "$session"
1562
1609
  printf 'AIUR_RECORD_SOCKET=%q\n' "$socket"
1563
1610
  printf 'AIUR_RECORD_AGENT_TMPFILE=%q\n' "${AIUR_AGENT_TMPFILE:-}"
1611
+ printf 'AIUR_RECORD_SURFACE_MODE=%q\n' "$surface_mode"
1564
1612
  printf 'AIUR_RECORD_WORKSPACE_ROOT_FILE=%q\n' "${AIUR_WORKSPACE_ROOT_FILE:-}"
1565
1613
  printf 'AIUR_RECORD_PROJECT_ROOT=%q\n' "$root"
1566
1614
  printf 'AIUR_RECORD_PROJECT_ROOT_SOURCE=%q\n' "${AIUR_PROJECT_ROOT_SOURCE:-}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiur-cli",
3
- "version": "0.0.8",
3
+ "version": "0.0.9-nightly.5a0d430",
4
4
  "description": "AI Unit Runtime for Executors.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/aiur-team/aiur",
@@ -35,8 +35,8 @@
35
35
  ],
36
36
  "opencodeVersion": "1.17.10",
37
37
  "optionalDependencies": {
38
- "aiur-cli-linux-x64": "0.0.8",
39
- "aiur-cli-linux-arm64": "0.0.8",
40
- "aiur-cli-darwin-arm64": "0.0.8"
38
+ "aiur-cli-linux-x64": "0.0.9-nightly.5a0d430",
39
+ "aiur-cli-linux-arm64": "0.0.9-nightly.5a0d430",
40
+ "aiur-cli-darwin-arm64": "0.0.9-nightly.5a0d430"
41
41
  }
42
42
  }