From 5528e98077f5f8a209edd33815878814ee1e75ca Mon Sep 17 00:00:00 2001 From: joelazar Date: Wed, 1 Jul 2026 11:14:07 +0200 Subject: [PATCH] :sparkles: add model fallback and update to claude opus 4.8 --- dot_pi/agent/extensions/pr-create/index.ts | 6 +++--- private_dot_local/bin/executable_pr-create | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/dot_pi/agent/extensions/pr-create/index.ts b/dot_pi/agent/extensions/pr-create/index.ts index df944530..8109591d 100644 --- a/dot_pi/agent/extensions/pr-create/index.ts +++ b/dot_pi/agent/extensions/pr-create/index.ts @@ -218,8 +218,8 @@ async function collectLinearLinks( // Models to try, in order, when generating a PR description. const DESCRIPTION_MODELS: string[] = [ - "anthropic/claude-sonnet-4-6", - "openai-codex/gpt-5.5", + "anthropic-extra/claude-opus-4-8", + "anthropic/claude-opus-4-8", ]; /** @@ -354,7 +354,7 @@ async function generatePrBody( try { const result = await pi.exec( "pi", - ["-p", "--no-session", "--model", model, "--thinking", "low", prompt], + ["-p", "--no-session", "--model", model, "--thinking", "off", prompt], { signal: ctx.signal, timeout: 120_000 }, ); if (result.code === 0) { diff --git a/private_dot_local/bin/executable_pr-create b/private_dot_local/bin/executable_pr-create index 3a51f684..c8c22a4f 100644 --- a/private_dot_local/bin/executable_pr-create +++ b/private_dot_local/bin/executable_pr-create @@ -173,12 +173,20 @@ Requirements: - Output only the PR description body. EOF - if command -v gum >/dev/null 2>&1 && [[ $assume_yes -eq 0 ]]; then - gum spin --title "Generating PR description with pi..." -- pi -p --no-session --model openai-codex/gpt-5.5 --thinking low "$(cat "$prompt_file")" >"$body_file" - else - echo "Generating PR description with pi..." >&2 - pi -p --no-session --model openai-codex/gpt-5.5 --thinking low "$(cat "$prompt_file")" >"$body_file" - fi + local prompt + prompt=$(cat "$prompt_file") + local models=(anthropic-extra/claude-opus-4-8 anthropic/claude-opus-4-8) + local model + for model in "${models[@]}"; do + if command -v gum >/dev/null 2>&1 && [[ $assume_yes -eq 0 ]]; then + gum spin --title "Generating PR description with pi ($model)..." -- pi -p --no-session --model "$model" --thinking off "$prompt" >"$body_file" + else + echo "Generating PR description with pi ($model)..." >&2 + pi -p --no-session --model "$model" --thinking off "$prompt" >"$body_file" + fi + [[ -s $body_file ]] && return 0 + done + return 1 } edit_pr_description() { -- 2.51.2