fix: add model=opus to run-planner formula and wire through action-agent

TOML declares model = "opus". planner-poll.sh includes model: opus in
the issue YAML front matter. action-agent.sh extracts it and exports
CLAUDE_MODEL. create_agent_session passes --model to claude if set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-20 09:08:17 +00:00
parent 20dc185a28
commit 898f958196
4 changed files with 15 additions and 1 deletions

View file

@ -76,6 +76,14 @@ fi
log "Issue: ${ISSUE_TITLE}"
# --- Extract model from YAML front matter (if present) ---
YAML_MODEL=$(printf '%s' "$ISSUE_BODY" | \
sed -n '/^---$/,/^---$/p' | grep '^model:' | awk '{print $2}' | tr -d '"' || true)
if [ -n "$YAML_MODEL" ]; then
export CLAUDE_MODEL="$YAML_MODEL"
log "model from front matter: ${YAML_MODEL}"
fi
# --- Fetch existing comments (resume context) ---
COMMENTS_JSON=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
"${CODEBERG_API}/issues/${ISSUE}/comments?limit=50") || true

View file

@ -8,6 +8,7 @@
name = "run-planner"
description = "Strategic planning: update docs, triage predictions, resource+leverage gap analysis"
version = 1
model = "opus"
[context]
files = ["VISION.md", "AGENTS.md", "RESOURCES.md"]

View file

@ -245,8 +245,12 @@ create_agent_session() {
fi
rm -f "$idle_marker"
local model_flag=""
if [ -n "${CLAUDE_MODEL:-}" ]; then
model_flag="--model ${CLAUDE_MODEL}"
fi
tmux new-session -d -s "$session" -c "$workdir" \
"claude --dangerously-skip-permissions" 2>/dev/null
"claude --dangerously-skip-permissions ${model_flag}" 2>/dev/null
sleep 1
tmux has-session -t "$session" 2>/dev/null || return 1
agent_wait_for_claude_ready "$session" 120 || return 1

View file

@ -64,6 +64,7 @@ fi
# ── File action issue ─────────────────────────────────────────────────────
ISSUE_BODY="---
formula: run-planner
model: opus
---
Periodic strategic planning run. The action-agent reads \`formulas/run-planner.toml\`