Skip to content

Commit ecf1fa1

Browse files
author
Aleksei Tikhomirov
committed
fix: harden agent verification on macOS
1 parent f8dc60d commit ecf1fa1

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

bootstrap.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,19 @@ calc_sha256() {
426426
fi
427427
}
428428

429+
output_contains() {
430+
HAYSTACK=$1
431+
NEEDLE=$2
432+
case "$HAYSTACK" in
433+
*"$NEEDLE"*)
434+
return 0
435+
;;
436+
*)
437+
return 1
438+
;;
439+
esac
440+
}
441+
429442
verify_bundle_checksums() {
430443
CHECKSUM_FILE="$BUNDLE_DIR/checksums.txt"
431444
[ -f "$CHECKSUM_FILE" ] || die "Bundle is missing checksums.txt"
@@ -453,14 +466,14 @@ verify_install() {
453466
resolve_opencode_bin || die "Verification requires an existing opencode installation"
454467

455468
AGENTS_OUTPUT=$(cd "$VERIFY_DIR" && OPENCODE_CONFIG="$VERIFY_DIR/opencode.json" OPENCODE_CONFIG_DIR="$VERIFY_DIR" $OPENCODE_BIN agent list 2>/dev/null || true)
456-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^fast ' || die "Agent list does not include fast"
457-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^build ' || die "Agent list does not include build"
458-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^plan ' || die "Agent list does not include plan"
459-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^deep ' || die "Agent list does not include deep"
460-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^project-bootstrapper ' || die "Agent list does not include project-bootstrapper"
461-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^grounded-researcher ' || die "Agent list does not include grounded-researcher"
462-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^loop-orchestrator ' || die "Agent list does not include loop-orchestrator"
463-
printf '%s\n' "$AGENTS_OUTPUT" | grep -q '^project-evolver ' || die "Agent list does not include project-evolver"
469+
output_contains "$AGENTS_OUTPUT" 'fast (primary)' || die "Agent list does not include fast"
470+
output_contains "$AGENTS_OUTPUT" 'build (primary)' || die "Agent list does not include build"
471+
output_contains "$AGENTS_OUTPUT" 'plan (primary)' || die "Agent list does not include plan"
472+
output_contains "$AGENTS_OUTPUT" 'deep (primary)' || die "Agent list does not include deep"
473+
output_contains "$AGENTS_OUTPUT" 'project-bootstrapper (subagent)' || die "Agent list does not include project-bootstrapper"
474+
output_contains "$AGENTS_OUTPUT" 'grounded-researcher (subagent)' || die "Agent list does not include grounded-researcher"
475+
output_contains "$AGENTS_OUTPUT" 'loop-orchestrator (subagent)' || die "Agent list does not include loop-orchestrator"
476+
output_contains "$AGENTS_OUTPUT" 'project-evolver (subagent)' || die "Agent list does not include project-evolver"
464477

465478
MCP_OUTPUT=$(cd "$VERIFY_DIR" && OPENCODE_CONFIG="$VERIFY_DIR/opencode.json" OPENCODE_CONFIG_DIR="$VERIFY_DIR" $OPENCODE_BIN mcp list 2>/dev/null || true)
466479
printf '%s\n' "$MCP_OUTPUT" | grep -q 'playwright' || die "MCP list does not include playwright"

0 commit comments

Comments
 (0)