From b8d650bd94056abfaa806c235ee702b005ba9398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Flor=C3=AAncio?= Date: Sun, 23 Aug 2026 11:58:39 +0100 Subject: [PATCH] fix: pass walkthrough reasoning variant separately (#2949) --- .../pr-walkthrough-workflow-contract_test.py | 6 +++++- .github/workflows/pr-walkthrough.yml | 6 ++++-- docs/plans/pr-walkthrough/plan.md | 11 +++++------ .../task-03-workflow-artifact-generation.md | 17 +++++++++-------- .../task-05-dedicated-workflow-pr-link.md | 13 ++++++------- docs/specs/pr-walkthrough/spec.md | 7 +++---- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/scripts/pr-walkthrough-workflow-contract_test.py b/.github/scripts/pr-walkthrough-workflow-contract_test.py index d30fb1e015..ec3602fa69 100644 --- a/.github/scripts/pr-walkthrough-workflow-contract_test.py +++ b/.github/scripts/pr-walkthrough-workflow-contract_test.py @@ -75,10 +75,14 @@ class PRWalkthroughWorkflowContractTest(unittest.TestCase): self.assertIn("arbitrary Git or shell commands", self.skill) def test_generation_uses_requested_model_native_high_reasoning_variant(self) -> None: - model = "opencode-go/muse-spark-1.2-contributor#high" + model = "opencode-go/muse-spark-1.2-contributor" + variant = "high" self.assertIn(f"PR_WALKTHROUGH_MODEL: {model}", self.workflow) + self.assertIn(f"PR_WALKTHROUGH_VARIANT: {variant}", self.workflow) self.assertIn(f'model: "{model}"', self.generation) self.assertIn('--model "$PR_WALKTHROUGH_MODEL"', self.generation) + self.assertIn('--variant "$PR_WALKTHROUGH_VARIANT"', self.generation) + self.assertNotIn("#high", self.workflow) self.assertNotIn("reasoningEffort", self.generation) def test_generation_keeps_untrusted_head_out_of_secret_bearing_workspace(self) -> None: diff --git a/.github/workflows/pr-walkthrough.yml b/.github/workflows/pr-walkthrough.yml index f250aa9153..5751abfb04 100644 --- a/.github/workflows/pr-walkthrough.yml +++ b/.github/workflows/pr-walkthrough.yml @@ -8,7 +8,8 @@ on: types: [opened, ready_for_review, reopened, synchronize, labeled] env: - PR_WALKTHROUGH_MODEL: opencode-go/muse-spark-1.2-contributor#high + PR_WALKTHROUGH_MODEL: opencode-go/muse-spark-1.2-contributor + PR_WALKTHROUGH_VARIANT: high concurrency: group: pr-walkthrough-${{ github.event.pull_request.number }} @@ -135,7 +136,7 @@ jobs: --- description: Generate and render a visual pull request walkthrough. mode: primary - model: "opencode-go/muse-spark-1.2-contributor#high" + model: "opencode-go/muse-spark-1.2-contributor" temperature: 0.1 permission: "*": deny @@ -183,6 +184,7 @@ jobs: "$HOME/.opencode/bin/opencode" run \ --agent github-pr-walkthrough \ --model "$PR_WALKTHROUGH_MODEL" \ + --variant "$PR_WALKTHROUGH_VARIANT" \ --title "PR #${PR_NUMBER} walkthrough" \ --file .pr-walkthrough/guidelines.md \ --file .pr-walkthrough/walkthrough.patch \ diff --git a/docs/plans/pr-walkthrough/plan.md b/docs/plans/pr-walkthrough/plan.md index cb1ef66ae8..fe2259c954 100644 --- a/docs/plans/pr-walkthrough/plan.md +++ b/docs/plans/pr-walkthrough/plan.md @@ -56,14 +56,13 @@ Add `.github/workflows/pr-walkthrough.yml` as a dedicated workflow using the `pull_request_target` event family. Gate it with the independent `PR_WALKTHROUGH_ENABLED` variable, not `OPENCODE_REVIEW_ENABLED`, and keep it decoupled from the code-review App token. The job runs for `opened`, -`reopened`, and `ready_for_review`, plus a label-triggered rerun only when the -label is `generate-pr-walkthrough`. The workflow does not subscribe to -`synchronize` in this increment. +`reopened`, `ready_for_review`, and `synchronize`. A label-triggered rerun also +runs when the label is `generate-pr-walkthrough`. Use the shared base-controlled setup action for OpenCode. Select -`opencode-go/muse-spark-1.2-contributor#high`. The pinned OpenCode 1.17.7 model -catalog declares reasoning support and built-in `high` and `xhigh` variants for -this model, so no custom provider override is needed. +`opencode-go/muse-spark-1.2-contributor` with `--model`. Select its built-in +`high` reasoning variant with `--variant`. The pinned OpenCode 1.17.7 model +catalog declares this variant, so no custom provider override is necessary. The job will: diff --git a/docs/plans/pr-walkthrough/task-03-workflow-artifact-generation.md b/docs/plans/pr-walkthrough/task-03-workflow-artifact-generation.md index a2efa3e2ad..f60b7bffa1 100644 --- a/docs/plans/pr-walkthrough/task-03-workflow-artifact-generation.md +++ b/docs/plans/pr-walkthrough/task-03-workflow-artifact-generation.md @@ -19,8 +19,8 @@ the separate R2 publication job. - **Acceptance:** A non-draft authorized pull request event invokes OpenCode, creates distinct `docs/pr-walkthrough/pr-.json` and `.html` files, and uploads them as an artifact. The generation job runs on `opened`, - `reopened`, `ready_for_review`, and the `generate-pr-walkthrough` label, but - not on `synchronize`. + `reopened`, `ready_for_review`, `synchronize`, and the + `generate-pr-walkthrough` label. - **Acceptance:** The job cannot execute PR-owned scripts through OpenCode or modify source. OpenCode may invoke only the base-controlled rendering adapter, which writes the fixed walkthrough outputs. The job does not request @@ -31,9 +31,10 @@ the separate R2 publication job. boundary. The artifact handoff is explicit for the dependent R2 publication job. - **Acceptance:** The workflow uses `PR_WALKTHROUGH_ENABLED`, the - `opencode-go/muse-spark-1.2-contributor#high` model reference and the model's - native high-reasoning variant. The normal review workflow remains - independently gated by `OPENCODE_REVIEW_ENABLED`. + `opencode-go/muse-spark-1.2-contributor` model reference, and the model's + native `high` reasoning variant. The workflow passes the variant through + `--variant`. The normal review workflow remains independently gated by + `OPENCODE_REVIEW_ENABLED`. - **Verification:** ```text @@ -77,9 +78,9 @@ per-PR concurrency serializes generation, publication, and linking, and the walkthrough label no longer runs the normal code-review job. The walkthrough has its own enable variable and uses the Muse Spark contributor -model with its native high-reasoning variant. The pinned OpenCode 1.17.7 CLI -catalog reports reasoning support plus built-in `high` and `xhigh` variants, -and the CLI resolved the default-deny agent permissions. +model with its native high-reasoning variant. The workflow passes the model and +variant through separate OpenCode 1.17.7 CLI options. Live validation on PR +`#2936` found and removed the invalid `#high` model suffix. Verification: workflow contract tests passed; action pinning tests and linter passed; `actionlint` passed; `git diff --check` passed. The targeted `zizmor` diff --git a/docs/plans/pr-walkthrough/task-05-dedicated-workflow-pr-link.md b/docs/plans/pr-walkthrough/task-05-dedicated-workflow-pr-link.md index 1a77150adc..4b1723295c 100644 --- a/docs/plans/pr-walkthrough/task-05-dedicated-workflow-pr-link.md +++ b/docs/plans/pr-walkthrough/task-05-dedicated-workflow-pr-link.md @@ -21,8 +21,8 @@ taking ownership of contributor-authored PR content. - **Acceptance:** `PR_WALKTHROUGH_ENABLED` controls the walkthrough workflow independently of `OPENCODE_REVIEW_ENABLED`. - **Acceptance:** The walkthrough runner selects - `opencode-go/muse-spark-1.2-contributor#high`, which selects the model's - native high-reasoning variant in pinned OpenCode 1.17.7. + `opencode-go/muse-spark-1.2-contributor` and passes `high` through the + OpenCode 1.17.7 `--variant` option. - **Acceptance:** Only the final job receives `pull-requests: write`. It runs after public R2 validation, uses the trusted base-commit helper, and receives no OpenCode or R2 credential. @@ -47,8 +47,7 @@ taking ownership of contributor-authored PR content. ## Results -Created the dedicated workflow and independent gate. Selected Muse Spark's -native high-reasoning variant and validated it in the pinned 1.17.7 model -catalog. Added the marker-owned PR-body helper and a -minimum-permission link job after R2 public validation. Contract and helper -tests pass. +Created the dedicated workflow and independent gate. The workflow passes the +Muse Spark model and its native `high` variant through separate OpenCode 1.17.7 +CLI options. Added the marker-owned PR-body helper and a minimum-permission link +job after R2 public validation. Contract and helper tests pass. diff --git a/docs/specs/pr-walkthrough/spec.md b/docs/specs/pr-walkthrough/spec.md index 4d0fb5004e..65b9103c06 100644 --- a/docs/specs/pr-walkthrough/spec.md +++ b/docs/specs/pr-walkthrough/spec.md @@ -58,10 +58,9 @@ lifecycle policy. - Walkthrough automation lives in `.github/workflows/pr-walkthrough.yml` and is enabled independently with the `PR_WALKTHROUGH_ENABLED` repository variable. It does not share the `OPENCODE_REVIEW_ENABLED` code-review gate. -- The initial runner uses - `opencode-go/muse-spark-1.2-contributor#high`. OpenCode 1.17.7 reports native - reasoning support for the model and resolves `#high` to its built-in high - reasoning variant. +- The initial runner uses `opencode-go/muse-spark-1.2-contributor` and its + built-in `high` reasoning variant. The workflow passes these values with the + OpenCode 1.17.7 `--model` and `--variant` options. - The workflow preserves the generated JSON and HTML as CI artifacts and uploads only the HTML to the `kandev-pr-walkthroughs` R2 bucket. - Each published object uses the key