no-mistakes(document): update crew-dispatch check description in readme

This commit is contained in:
Lap Tran committed 2026-11-15 23:05:29 -05:00
1 parent 0aa25b27f0
commit 055c2eed91
2 files changed
+43 -3

No files matched your search

+42 -2
View File
@@ -6,8 +6,10 @@
# effective dispatch profile.
#
# Firstmate matches the natural-language `when` text with its own judgment, so
# this check pins the declared routing and the schema, not a model call.
# It skips when firstmate is not installed.
# this check pins the declared routing and the schema, not a model call. It then
# confirms every OpenCode-harness model ID against OpenCode's own catalog, so a
# mistyped ID fails here instead of when a crew spawns.
# It skips the parts that need firstmate or OpenCode when they are not installed.
set -euo pipefail
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)
@@ -75,6 +77,44 @@ case "$ui" in
*) fail "the UI rule no longer resolves to DeepSeek v4.1 Flash" ;;
esac
# The model IDs above come from the same file the routing check reads, so a
# typo would still pass them. OpenCode's own catalog is the independent oracle:
# a model it does not list fails only when a crew spawns. Confirm each
# OpenCode-harness model against that catalog.
OPENCODE_JSON=${OPENCODE_CONFIG:-$HOME/.config/opencode2/opencode.json}
if ! command -v opencode >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then
echo "SKIP: opencode or python3 not on PATH, cannot confirm the model IDs"
elif [ ! -e "$OPENCODE_JSON" ]; then
echo "SKIP: no isolated OpenCode config at $OPENCODE_JSON, cannot confirm the model IDs"
else
catalog=$(OPENCODE_CONFIG="$OPENCODE_JSON" timeout 120 opencode models 2>/dev/null || true)
if [ -z "$catalog" ]; then
echo "SKIP: opencode models printed nothing, cannot confirm the model IDs"
else
models=$(python3 - "$CONFIG" <<'PY'
import json, sys
config = json.load(open(sys.argv[1]))
uses = list(config.get("default") or [])
for rule in config.get("rules") or []:
use = rule.get("use")
uses.extend(use if isinstance(use, list) else [use])
for use in uses:
if isinstance(use, dict) and use.get("harness") == "opencode" and use.get("model"):
print(use["model"])
PY
)
# Deduplicate so a model named by two profiles is confirmed once.
models=$(printf '%s\n' "$models" | awk 'NF && !seen[$0]++')
while IFS= read -r model; do
[ -n "$model" ] || continue
printf '%s\n' "$catalog" | grep -qxF "$model" \
|| fail "$model is not in the OpenCode catalog (opencode models)"
echo "PASS: $model exists in the OpenCode catalog"
done <<< "$models"
fi
fi
echo "PASS: default workers -> opencode/opencode-go/deepseek-v4.1-flash"
echo "PASS: documentation -> opencode/opencode-go/beam-free"
echo "PASS: design exception preserved -> pi/openai-codex/gpt-6.1-sol/xhigh"