mm scripts: default to MiniMax-M3.1-Flash-Preview with per-script effort

Flash is the default model; --m3 falls back to M3, --effort overrides.
Defaults: max (review-minimax, review-loop, mm-worktree-task), medium
(explore), low (ci-triage). ask-minimax-run applies MINIMAX_EFFORT to
Flash models when --effort is not passed. Bump stale fixture date.
This commit is contained in:
Paul O'Reilly
2026-10-13 10:23:53 +13:00
parent d6e0220bf5
commit 840d7509e1
16 changed files with 134 additions and 30 deletions

View File

@@ -26,4 +26,15 @@ export CLAUDE_CONFIG_DIR="$MINIMAX_DIR"
export CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1
export COLORTERM=truecolor
# MINIMAX_EFFORT (provider.env) applies to Flash models only, unless the caller passed --effort.
model="${ANTHROPIC_MODEL:-}"; has_effort=0; prev=""
for a in "$@"; do
[[ "$prev" == "--model" ]] && model="$a"
[[ "$a" == "--effort" ]] && has_effort=1
prev="$a"
done
if [[ -n "${MINIMAX_EFFORT:-}" && $has_effort -eq 0 && "$model" == *Flash* ]]; then
set -- --effort "$MINIMAX_EFFORT" "$@"
fi
exec claude "$@"

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Triage a failing Gitea Actions run in a MiniMax M3 sub-session.
# Triage a failing Gitea Actions run in a MiniMax sub-session.
# Fetches logs via gitea-agent-companion (token stays inside gac), redacts
# credential-shaped content, and has MiniMax write a structured triage file.
# Spec: specs/ci-triage-minimax-run.spec.md. Used by /ci-triage-minimax.
@@ -7,7 +7,7 @@
# Usage:
# ci-triage-minimax-run --repo <owner/repo> --run <N> [--job <name|id>]
# [--out <triage-file>] [--tail N] [--max-turns N] [--timeout SECS]
# [--dryrun|-n]
# [--dryrun|-n] [--m3] [--effort low|medium|high|xhigh|max]
#
# Exit codes:
# 0 triage file written
@@ -25,6 +25,8 @@ OUT_FILE=""
TAIL_LINES=2000
MAX_TURNS=25
TIMEOUT_SECS=300
USE_M3=0
EFFORT_ARG=""
DRYRUN=0
CRED_PATTERN='ghp_[A-Za-z0-9]|glpat-|x-access-token:|Authorization:|BEGIN [A-Z ]*PRIVATE KEY|AKIA[0-9A-Z]{16}'
@@ -37,11 +39,15 @@ while [[ $# -gt 0 ]]; do
--tail) TAIL_LINES="$2"; shift 2 ;;
--max-turns) MAX_TURNS="$2"; shift 2 ;;
--timeout) TIMEOUT_SECS="$2"; shift 2 ;;
--m3) USE_M3=1; shift ;;
--effort) EFFORT_ARG="$2"; shift 2 ;;
--dryrun|-n) DRYRUN=1; shift ;;
-h|--help) usage; exit 0 ;;
*) echo "error: unknown argument '$1'" >&2; usage >&2; exit 1 ;;
esac
done
if [[ $USE_M3 -eq 1 ]]; then MODEL="MiniMax-M3[1m]"; EFFORT="$EFFORT_ARG"; else MODEL="MiniMax-M3.1-Flash-Preview"; EFFORT="${EFFORT_ARG:-low}"; fi
[[ -z "$EFFORT" || "$EFFORT" =~ ^(low|medium|high|xhigh|max)$ ]] || { echo "error: --effort must be low|medium|high|xhigh|max" >&2; exit 1; }
# --- CT-1 preflight -----------------------------------------------------------
[[ "$REPO" =~ ^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$ ]] || { echo "error: --repo must be owner/repo" >&2; exit 1; }
@@ -82,7 +88,7 @@ if [[ "$DRYRUN" -eq 1 ]]; then
echo "-- failing step --"
echo "<run-logs not fetched in dryrun>"
echo "-- sub-session command --"
echo "cd <workdir> && timeout $TIMEOUT_SECS ask-minimax-run --model 'MiniMax-M3[1m]'" \
echo "cd <workdir> && timeout $TIMEOUT_SECS ask-minimax-run --model '$MODEL'${EFFORT:+ --effort $EFFORT}" \
"--permission-mode default --allowedTools 'Read,Glob,Grep,Write'" \
"--disallowedTools 'Edit,MultiEdit,NotebookEdit,Bash,WebFetch,WebSearch'" \
"--max-turns $MAX_TURNS --output-format json --add-dir $OUT_DIR -p < prompt.txt"
@@ -163,7 +169,7 @@ run_once() {
return 0
fi
( cd "$WORK_DIR" && timeout "$TIMEOUT_SECS" ask-minimax-run \
--model "MiniMax-M3[1m]" \
--model "$MODEL" ${EFFORT:+--effort "$EFFORT"} \
--permission-mode default \
--allowedTools "Read,Glob,Grep,Write" \
--disallowedTools "Edit,MultiEdit,NotebookEdit,Bash,WebFetch,WebSearch" \

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Run a read-only codebase exploration sweep in a MiniMax M3 sub-session.
# Run a read-only codebase exploration sweep in a MiniMax sub-session.
# Wraps ask-minimax-run with the hardening the exploration case needs:
# - --add-dir per search root (paths outside cwd are otherwise denied)
# - secrets-root refusal + skip-list in the prompt preamble
@@ -11,7 +11,8 @@
# Usage:
# explore-minimax-run --root <path> [--root <path> ...] \
# --prompt-file <question-file> --out <result-file> \
# [--breadth medium|very-thorough] [--max-turns N] [--timeout SECS]
# [--breadth medium|very-thorough] [--max-turns N] [--timeout SECS] \
# [--m3] [--effort low|medium|high|xhigh|max]
#
# Exit codes:
# 0 answer written to --out
@@ -20,7 +21,7 @@
# 3 ran but answer is empty or carries no file:line citations — fall back to an Explore agent
set -euo pipefail
usage() { grep '^#' "$0" | sed 's/^# \{0,1\}//' | sed -n '2,20p'; }
usage() { grep '^#' "$0" | sed 's/^# \{0,1\}//' | sed -n '2,21p'; }
ROOTS=()
PROMPT_FILE=""
@@ -28,6 +29,8 @@ OUT_FILE=""
BREADTH="medium"
MAX_TURNS=40
TIMEOUT_SECS=540
USE_M3=0
EFFORT_ARG=""
while [[ $# -gt 0 ]]; do
case "$1" in
@@ -37,10 +40,14 @@ while [[ $# -gt 0 ]]; do
--breadth) BREADTH="$2"; shift 2 ;;
--max-turns) MAX_TURNS="$2"; shift 2 ;;
--timeout) TIMEOUT_SECS="$2"; shift 2 ;;
--m3) USE_M3=1; shift ;;
--effort) EFFORT_ARG="$2"; shift 2 ;;
-h|--help) usage; exit 0 ;;
*) echo "error: unknown argument '$1'" >&2; usage >&2; exit 1 ;;
esac
done
if [[ $USE_M3 -eq 1 ]]; then MODEL="MiniMax-M3"; EFFORT="$EFFORT_ARG"; else MODEL="MiniMax-M3.1-Flash-Preview"; EFFORT="${EFFORT_ARG:-medium}"; fi
[[ -z "$EFFORT" || "$EFFORT" =~ ^(low|medium|high|xhigh|max)$ ]] || { echo "error: --effort must be low|medium|high|xhigh|max" >&2; exit 1; }
[[ ${#ROOTS[@]} -gt 0 ]] || { echo "error: at least one --root required" >&2; exit 1; }
[[ -n "$PROMPT_FILE" && -f "$PROMPT_FILE" ]] || { echo "error: --prompt-file missing or not a file" >&2; exit 1; }
@@ -109,7 +116,7 @@ run_once() {
# --disallowedTools: the minimax profile defaults to acceptEdits and allows
# Edit(/tmp/**)/WebFetch at user level; deny beats allow.
timeout "$TIMEOUT_SECS" ask-minimax-run \
--model MiniMax-M3 \
--model "$MODEL" ${EFFORT:+--effort "$EFFORT"} \
--permission-mode default \
--allowedTools "Read,Glob,Grep" \
--disallowedTools "Write,Edit,MultiEdit,NotebookEdit,Bash,WebFetch,WebSearch" \

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Launch a MiniMax M3 implementation sub-session in an isolated git worktree,
# Launch a MiniMax implementation sub-session in an isolated git worktree,
# with the prompt assembled from a planner work item. See specs/mm-worktree-task.spec.md.
set -euo pipefail
@@ -15,7 +15,7 @@ usage() {
cat <<'EOF'
Usage: mm-worktree-task <item-uuid> [OPTIONS]
Launch a MiniMax M3 implementation sub-session (via ask-minimax-run) in an
Launch a MiniMax implementation sub-session (via ask-minimax-run) in an
isolated git worktree of the current repo, with the prompt assembled from a
planner work item.
@@ -33,6 +33,9 @@ Options:
--docs all|recent|none Which item documents to bundle (default: recent)
--tools "<list>" Extra --allowedTools entries (comma-separated)
--timeout <secs> Sub-session timeout (default: 1800)
--m3 Use MiniMax-M3[1m] instead of the default MiniMax-M3.1-Flash-Preview
--effort <level> Thinking depth low|medium|high|xhigh|max (default: max;
not sent with --m3 unless given)
--gate "<command>" Re-run this command in the worktree yourself, after
the sub-session exits, against its LAST commit.
Appended as a "Supervisor gate" section in the
@@ -68,6 +71,8 @@ BASE="main"
DOCS="recent"
EXTRA_TOOLS=""
TIMEOUT=1800
USE_M3=0
EFFORT_ARG=""
GATE=""
GATE_TIMEOUT=900
UPLOAD=0
@@ -87,6 +92,8 @@ while [[ $# -gt 0 ]]; do
--gate) GATE="$2"; shift 2 ;;
--gate-timeout) GATE_TIMEOUT="$2"; shift 2 ;;
--context) CP_CONTEXT="$2"; shift 2 ;;
--m3) USE_M3=1; shift ;;
--effort) EFFORT_ARG="$2"; shift 2 ;;
--upload) UPLOAD=1; shift ;;
--collect) COLLECT=1; shift ;;
--dryrun|-n) DRYRUN=1; shift ;;
@@ -98,6 +105,9 @@ while [[ $# -gt 0 ]]; do
esac
done
if [[ $USE_M3 -eq 1 ]]; then MODEL="MiniMax-M3[1m]"; EFFORT="$EFFORT_ARG"; else MODEL="MiniMax-M3.1-Flash-Preview"; EFFORT="${EFFORT_ARG:-max}"; fi
[[ -z "$EFFORT" || "$EFFORT" =~ ^(low|medium|high|xhigh|max)$ ]] || { err "--effort must be low|medium|high|xhigh|max"; exit 1; }
case "$DOCS" in all|recent|none) ;; *) err "--docs must be all|recent|none"; exit 1 ;; esac
if [[ -z "$UUID" ]]; then
@@ -374,7 +384,7 @@ EOF
PROMPT_CONTENT="$(build_prompt)"
CMD="cd ${WORKTREE} && setsid nohup timeout ${TIMEOUT} ask-minimax-run --model \"MiniMax-M3[1m]\" --allowedTools \"${ALLOWLIST}\" --permission-mode acceptEdits --add-dir ${REPORT_DIR} -p \"\$(cat ${PROMPT_FILE})\" > ${STDOUT_FILE} 2>&1"
CMD="cd ${WORKTREE} && setsid nohup timeout ${TIMEOUT} ask-minimax-run --model \"${MODEL}\"${EFFORT:+ --effort ${EFFORT}} --allowedTools \"${ALLOWLIST}\" --permission-mode acceptEdits --add-dir ${REPORT_DIR} -p \"\$(cat ${PROMPT_FILE})\" > ${STDOUT_FILE} 2>&1"
if [[ $DRYRUN -eq 1 ]]; then
echo "[dryrun] mm-worktree-task — no changes will be made"
@@ -510,7 +520,7 @@ info "launching ask-minimax-run (detached, timeout ${TIMEOUT}s)"
cd "$WORKTREE"
start=$(date +%s)
set +e
setsid nohup timeout "$TIMEOUT" ask-minimax-run --model "MiniMax-M3[1m]" \
setsid nohup timeout "$TIMEOUT" ask-minimax-run --model "$MODEL" ${EFFORT:+--effort "$EFFORT"} \
--allowedTools "$ALLOWLIST" --permission-mode acceptEdits \
--add-dir "$REPORT_DIR" -p "$(cat "$PROMPT_FILE")" \
> "$STDOUT_FILE" 2>&1

View File

@@ -17,6 +17,7 @@ Usage:
review-loop-run launch --kind <plan|spec|tests|code|verify> --name <tag> [--round N]
--file <path> [--file <path> ...] [--context "<text>"]
[--prev <result.md>] [--tools "<extra>"] [--timeout <secs>]
[--m3] [--effort low|medium|high|xhigh|max]
[--project <repo>] [--dryrun|-n]
review-loop-run status [--name <tag>] [--round N] [--project <repo>]
review-loop-run counts <result.md>
@@ -238,7 +239,7 @@ kind_tools() {
}
cmd_launch() {
local kind="" name="" round=1 context="" prev="" tools="" timeout=1500 project="" dryrun=0
local kind="" name="" round=1 context="" prev="" tools="" timeout=1500 project="" dryrun=0 use_m3=0 effort_arg=""
local -a files=()
while [[ $# -gt 0 ]]; do
case "$1" in
@@ -251,11 +252,15 @@ cmd_launch() {
--tools) tools="$2"; shift 2 ;;
--timeout) timeout="$2"; shift 2 ;;
--project) project="$2"; shift 2 ;;
--m3) use_m3=1; shift ;;
--effort) effort_arg="$2"; shift 2 ;;
--dryrun|-n) dryrun=1; shift ;;
-h|--help) usage; exit 0 ;;
*) die "unknown option: $1" 2 ;;
esac
done
if [[ $use_m3 -eq 1 ]]; then model="MiniMax-M3"; effort="$effort_arg"; else model="MiniMax-M3.1-Flash-Preview"; effort="${effort_arg:-max}"; fi
[[ -z "$effort" || "$effort" =~ ^(low|medium|high|xhigh|max)$ ]] || die "--effort must be low|medium|high|xhigh|max" 2
[[ " $KINDS " == *" $kind "* ]] || die "--kind must be one of: $KINDS" 2
[[ "$name" =~ ^[A-Za-z0-9._-]+$ ]] || die "--name must match ^[A-Za-z0-9._-]+\$" 2
[[ "$round" =~ ^[0-9]+$ ]] || die "--round must be an integer" 2
@@ -323,7 +328,7 @@ EOF
launch_body=$(cat <<EOF
#!/usr/bin/env bash
cd "$repo" || exit 1
timeout ${timeout} ask-minimax-run --model MiniMax-M3 --allowedTools "$allow" --permission-mode acceptEdits -p "\$(cat "$prompt")" > "$stdout" 2>&1
timeout ${timeout} ask-minimax-run --model ${model}${effort:+ --effort ${effort}} --allowedTools "$allow" --permission-mode acceptEdits -p "\$(cat "$prompt")" > "$stdout" 2>&1
echo "exit=\$?" >> "$stdout"
EOF
)

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# First-pass code review of a git branch in a MiniMax M3 sub-session.
# First-pass code review of a git branch in a MiniMax sub-session.
# The wrapper materialises the diff/log itself (the sub-session gets no Bash),
# runs MiniMax read-only except for one findings file, and gates the result.
# Spec: specs/review-minimax-run.spec.md. Used by /review-minimax; safe directly.
@@ -7,7 +7,7 @@
# Usage:
# review-minimax-run --worktree <path> [--base <ref>] [--out <findings-file>]
# [--profile agent-runtimes] [--max-diff-lines N] [--max-turns N]
# [--timeout SECS] [--dryrun|-n]
# [--timeout SECS] [--dryrun|-n] [--m3] [--effort low|medium|high|xhigh|max]
#
# Exit codes:
# 0 findings file written (may contain "NO FINDINGS")
@@ -25,6 +25,8 @@ PROFILE=""
MAX_DIFF_LINES=6000
MAX_TURNS=40
TIMEOUT_SECS=540
USE_M3=0
EFFORT_ARG=""
DRYRUN=0
# RM-3: credential-shaped content in the diff aborts the review outright.
CRED_PATTERN='ghp_[A-Za-z0-9]|glpat-|x-access-token:|Authorization:|BEGIN [A-Z ]*PRIVATE KEY|AKIA[0-9A-Z]{16}'
@@ -38,11 +40,15 @@ while [[ $# -gt 0 ]]; do
--max-diff-lines) MAX_DIFF_LINES="$2"; shift 2 ;;
--max-turns) MAX_TURNS="$2"; shift 2 ;;
--timeout) TIMEOUT_SECS="$2"; shift 2 ;;
--m3) USE_M3=1; shift ;;
--effort) EFFORT_ARG="$2"; shift 2 ;;
--dryrun|-n) DRYRUN=1; shift ;;
-h|--help) usage; exit 0 ;;
*) echo "error: unknown argument '$1'" >&2; usage >&2; exit 1 ;;
esac
done
if [[ $USE_M3 -eq 1 ]]; then MODEL="MiniMax-M3[1m]"; EFFORT="$EFFORT_ARG"; else MODEL="MiniMax-M3.1-Flash-Preview"; EFFORT="${EFFORT_ARG:-max}"; fi
[[ -z "$EFFORT" || "$EFFORT" =~ ^(low|medium|high|xhigh|max)$ ]] || { echo "error: --effort must be low|medium|high|xhigh|max" >&2; exit 1; }
# --- RM-1 preflight -----------------------------------------------------------
[[ -n "$WORKTREE" ]] || { echo "error: --worktree required" >&2; exit 1; }
@@ -172,7 +178,7 @@ if [[ "$DRYRUN" -eq 1 ]]; then
echo "-- prompt --"
cat "$FULL_PROMPT"
echo "-- command --"
echo "cd $WORK_DIR && timeout $TIMEOUT_SECS ask-minimax-run --model 'MiniMax-M3[1m]'" \
echo "cd $WORK_DIR && timeout $TIMEOUT_SECS ask-minimax-run --model '$MODEL'${EFFORT:+ --effort $EFFORT}" \
"--permission-mode default --allowedTools 'Read,Glob,Grep,Write'" \
"--disallowedTools 'Edit,MultiEdit,NotebookEdit,Bash,WebFetch,WebSearch'" \
"--max-turns $MAX_TURNS --output-format json --add-dir $WORKTREE --add-dir $OUT_DIR -p < prompt.txt"
@@ -189,7 +195,7 @@ run_once() {
return 0
fi
( cd "$WORK_DIR" && timeout "$TIMEOUT_SECS" ask-minimax-run \
--model "MiniMax-M3[1m]" \
--model "$MODEL" ${EFFORT:+--effort "$EFFORT"} \
--permission-mode default \
--allowedTools "Read,Glob,Grep,Write" \
--disallowedTools "Edit,MultiEdit,NotebookEdit,Bash,WebFetch,WebSearch" \