Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ sudo baudbot env set ANTHROPIC_API_KEY
# or: sudo baudbot env set OPENAI_API_KEY sk-... --restart
```

Migrating droplets and want to keep memory/todos/custom runtime state?

```bash
# old host
sudo baudbot state backup /tmp/baudbot-state.zip

# new host
sudo baudbot stop
sudo baudbot state restore /tmp/baudbot-state.zip
sudo baudbot start
```

State archives intentionally exclude secrets (`~/.config/.env`, `~/.pi/agent/auth.json`), so reconfigure secrets on the new host.

See [CONFIGURATION.md](CONFIGURATION.md) for required environment variables and secret setup.

## The Slack broker (optional)
Expand Down
2 changes: 2 additions & 0 deletions bin/baudbot
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ usage() {
echo " test Run test suite"
echo " update Build/test in temp checkout, publish git-free release, deploy"
echo " rollback Re-deploy previous (or specified) git-free release snapshot"
echo " state Backup/restore agent state (memory, todos, customizations)"
echo " uninstall Remove everything"
echo ""
echo -e "${BOLD}Options:${RESET}"
Expand Down Expand Up @@ -422,6 +423,7 @@ register_command "audit" "exec" "$BAUDBOT_ROOT/bin/security-audit.sh" "0" "0" ""
register_command "test" "exec" "$BAUDBOT_ROOT/bin/test.sh" "0" "0" ""
register_command "update" "exec" "$BAUDBOT_ROOT/bin/update-release.sh" "1" "0" ""
register_command "rollback" "exec" "$BAUDBOT_ROOT/bin/rollback-release.sh" "1" "0" ""
register_command "state" "exec" "$BAUDBOT_ROOT/bin/state.sh" "1" "0" ""
register_command "uninstall" "exec" "$BAUDBOT_ROOT/bin/uninstall.sh" "1" "0" ""
register_command "doctor" "exec" "$BAUDBOT_ROOT/bin/doctor.sh" "0" "0" ""
register_command "subagents" "exec" "$BAUDBOT_ROOT/bin/subagents.sh" "0" "0" ""
Expand Down
41 changes: 35 additions & 6 deletions bin/baudbot.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ fi
EOF
chmod +x "$fakebin/id"

if PATH="$fakebin:$PATH" BAUDBOT_ROOT="$REPO_ROOT" bash "$CLI" debug >/tmp/baudbot-debug.out 2>&1; then
if PATH="$fakebin:$PATH" BAUDBOT_ROOT="$REPO_ROOT" bash "$CLI" debug >"$tmp/debug.out" 2>&1; then
return 1
fi

out="$(cat /tmp/baudbot-debug.out)"
rm -f /tmp/baudbot-debug.out
out="$(cat "$tmp/debug.out")"
printf '%s\n' "$out" | grep -q "requires root"
)
}
Expand All @@ -120,12 +119,41 @@ fi
EOF
chmod +x "$fakebin/id"

if PATH="$fakebin:$PATH" BAUDBOT_ROOT="$REPO_ROOT" bash "$CLI" broker register >/tmp/baudbot-broker.out 2>&1; then
if PATH="$fakebin:$PATH" BAUDBOT_ROOT="$REPO_ROOT" bash "$CLI" broker register >"$tmp/broker.out" 2>&1; then
return 1
fi

out="$(cat /tmp/baudbot-broker.out)"
rm -f /tmp/baudbot-broker.out
out="$(cat "$tmp/broker.out")"
printf '%s\n' "$out" | grep -q "requires root"
)
}

test_state_requires_root() {
(
set -euo pipefail
local tmp fakebin out
tmp="$(mktemp -d /tmp/baudbot-cli-test.XXXXXX)"
trap 'rm -rf "$tmp"' EXIT

mkdir -p "$tmp/fakebin"
fakebin="$tmp/fakebin"
cat > "$fakebin/id" <<'EOF'
#!/bin/bash
if [ "${1:-}" = "-u" ]; then
echo 1000
elif [ "${1:-}" = "-un" ]; then
echo tester
else
/usr/bin/id "$@"
fi
EOF
chmod +x "$fakebin/id"

if PATH="$fakebin:$PATH" BAUDBOT_ROOT="$REPO_ROOT" bash "$CLI" state backup >"$tmp/state.out" 2>&1; then
return 1
fi

out="$(cat "$tmp/state.out")"
printf '%s\n' "$out" | grep -q "requires root"
)
}
Expand Down Expand Up @@ -191,6 +219,7 @@ run_test "version reads package.json" test_version_uses_package_json
run_test "status dispatches via runtime module" test_status_dispatches_via_runtime_module
run_test "debug requires root" test_debug_requires_root
run_test "broker register requires root" test_broker_register_requires_root
run_test "state command requires root" test_state_requires_root
run_test "restart restarts systemd" test_restart_restarts_systemd

echo ""
Expand Down
2 changes: 1 addition & 1 deletion bin/ci/smoke-agent-inference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ finally:
PY
}

readonly CI_MODEL="anthropic/claude-haiku"
readonly CI_MODEL="anthropic/claude-haiku-4-5"

inject_ci_config() {
if [[ -z "${CI_ANTHROPIC_API_KEY:-}" ]]; then
Expand Down
Loading
Loading