Skip to content

chore: centralize BUG panic for invalid model in domain computation#30310

Merged
pelikhan merged 2 commits intomainfrom
copilot/chorededuplicate-panic-message
May 5, 2026
Merged

chore: centralize BUG panic for invalid model in domain computation#30310
pelikhan merged 2 commits intomainfrom
copilot/chorededuplicate-panic-message

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

Three engine files (pi_engine.go, crush_engine.go, opencode_engine.go) each duplicated the same inline panic guard for the invariant that an invalid model must never reach domain computation.

Changes

  • pkg/workflow/domains.go — adds mustGetAllowedDomainsForEngineWithModel, a wrapper around GetAllowedDomainsForEngineWithModel that panics with the canonical BUG message on error:
    func mustGetAllowedDomainsForEngineWithModel(engine constants.EngineName, model string, ...) string {
        result, err := GetAllowedDomainsForEngineWithModel(engine, model, ...)
        if err != nil {
            panic(fmt.Sprintf("BUG: invalid model %q reached domain computation (should have been caught by validation): %v", model, err))
        }
        return result
    }
  • pi_engine.go, crush_engine.go, opencode_engine.go — replace the three identical var err error / call / if err != nil { panic(...) } blocks with a single call to the helper.

Future engines calling mustGetAllowedDomainsForEngineWithModel inherit the guard automatically; a wording change now has one touch-point.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name k ignore-path ../.git util (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw vice_ports.go vice_ports_test.go _issue_type.go sRem�� SvuWvV_iU red_workflow_test.go h ll_backslash_intgit ll_test.go e_repo_maintenan--show-toplevel e_repo_maintenance_integration_test.go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name */*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore --local x_amd64/vet (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 x_amd64/vet sv 806277697/001 ../../../**/*.jsrev-parse 1/x64/bin/node git rev-�� --show-toplevel 1/x64/bin/node /usr/bin/git runs/20260505-08gh (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv WorkflowFiles_WithImports2248821281/001 myorg /usr/bin/git source-field-vargh 0526717/b107/vetapi n-dir/sh git rev-�� --show-toplevel ache/go/1.25.8/xTest User /usr/bin/git .js' --ignore-pagit **/*.cjs x_amd64/vet /usr/bin/git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv g_.a --write e/git **/*.ts util_test --ignore-path e/git /opt�� /v2.0.0 format:pkg-json sv tierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/link /usr/bin/git list --json /usr/bin/git git rev-�� --show-toplevel yR/oyb6-3up6e8cfn9-7UFo/TdLqpYNcCT5ifnUOLQyd /usr/bin/git ithub-script/gitgit x_amd64/vet 48be057ab7fb9795--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/infocmp --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git infocmp -1 xterm-color git /usr/bin/infocmp --show-toplevel sh /usr/bin/infocmp--show-toplevel infocmp (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 3032-16034/test-2953072686 show 8502461/b456=> (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv image:v1.0.0 x_amd64/vet /usr/bin/gh w/js/**/*.json' git --local x_amd64/vet gh api /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git get --local 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260505-083032-16034/test-2407697867/custom/workflows remote om/org1/repo1.git json' --ignore-pgit .cfg 64/pkg/tool/linu--show-toplevel git conf�� --get (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv /repos/actions/setup-node/git/ref/tags/v4 --jq /usr/bin/git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv ./cmd/gh-aw (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv o actions/setup-cli/install.sh..-errorsas (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9.0.0
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv ." g/workflow/opencode_engine.go /node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv json .go x_amd64/vet (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel sh /usr/bin/gh 2953072686 -tests /home/REDACTED/.co/repos/actions/github-script/git/ref/tags/v9 gh api /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git '/tmp/TestParseDgit '/tmp/TestParseDrev-parse /home/REDACTED/wor--show-toplevel git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv xterm-color ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url /usr/bin/infocmp 3032-16034/test-gh -tests e/git infocmp -1 xterm-color e/git /usr/bin/git 618n/6K3JL8ddMPogit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 git bject.type] | @tsv ithub-script/gitgit remote bject.type] | @t--show-toplevel git rev-�� /ref/tags/v9 git sv s/test.md remote _id":222}] gh (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv runs/20260505-083032-16034/test-2351103480/.github/workflows -buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv k/gh-aw/gh-aw/.github/workflows/agent-persona-explorer.md eIF_E5paMIS4 /usr/bin/infocmp w/js/**/*.json' git --local x_amd64/vet infocmp -1 xterm-color x_amd64/vet /usr/bin/git get --local 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260505-083032-16034/test-2407697867 l /usr/bin/git json' --ignore-pgit pull.rebase 64/pkg/tool/linu--show-toplevel git init�� (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv 3032-16034/test-2416619140 64/pkg/tool/linugit-receive-pack '/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitbranch_with_rev-parse /usr/bin/infocmp on' --ignore-patgit core.hooksPath 64/pkg/tool/linu--show-toplevel infocmp -1 xterm-color 64/pkg/tool/linu-test.v=true /usr/bin/git ub/workflows .cfg .cfg git (http block)
  • https://api.github.com/repos/aws-actions/configure-aws-credentials/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/node/24.14.1/x64/bin/node /usr/bin/git /tmp/go-build384git -trimpath /usr/bin/infocmp--show-toplevel git rev-�� --show-toplevel infocmp /usr/bin/gh xterm-color -goversion logs/runs.json"}status gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/node/24.14.1/x64/bin/node /usr/bin/git /tmp/TestHashCongh x_amd64/vet /opt/hostedtoolc/repos/actions/github-script/git/ref/tags/v9 git rev-�� /ref/tags/v9 node sv /tmp/TestHashStagit 64/pkg/tool/linurev-parse /usr/bin/git gh (http block)
  • https://api.github.com/repos/azure/login/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/azure/login/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/node/24.14.1/x64/bin/node /usr/bin/git /ref/tags/v9.0.0git -trimpath sv git rev-�� --show-toplevel git /usr/bin/infocmp -ZJ1c7b8qkFQ0vAYinfocmp -dwarf=false kflow.test infocmp (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv --show-toplevel yR/oyb6-3up6e8cfn9-7UFo/TdLqpYNcCT5ifnUOLQyd /usr/bin/git ithub-script/gitgit x_amd64/vet 48be057ab7fb9795--show-toplevel git rev-�� --show-toplevel node /usr/bin/git git git 64/pkg/tool/linuxterm-color git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcremote.origin.url /usr/bin/git vaScript67114297git -tests e/git-receive-pa--show-toplevel git rev-�� --show-toplevel (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-04-28 chr/testify/requremote (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-04-05 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-02-04 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name ../../../**/*.json ache/node/24.14.1/x64/bin/npx --ignore-path ../../../.prettiremote (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name -pack son ignore (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 pkg/workflow/skip_if_match_test.go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1234567890
    • Triggering command: /usr/bin/gh gh api repos/{owner}/{repo}/actions/runs/1234567890 --jq {databaseId: .id, number: .run_number, url: .html_url, status: .status, conclusion: .conclusion, workflowName: .name, workflowPath: .path, createdAt: .created_at, startedAt: .run_started_at, updatedAt: .updated_at, event: .event, headBranch: .head_branch, 4896346/001' 4896346/001' modules/@npmcli/run-script/lib/node-gyp-bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 pkg/mod/github.com/stretchr/testify@v1.11.1/require/forward_requirements.go util.test ignore (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name ../../../**/*.json x_amd64/compile --ignore-path ../../../.prettiremote (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 ../../../**/*.json k/gh-aw/gh-aw/node_modules/.bin/sh nore ../../../.prettirev-parse (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet --ignore-path ../../../.prettirun (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 ../../../**/*.json k/node_modules/.bin/sh nore ../../../.prettirev-parse (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name ../../../**/*.json k/gh-aw/gh-aw/actions/setup/js/n-lang=go1.25 --ignore-path ../../../.pretticonfig (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 ../../../**/*.json k/gh-aw/gh-aw/actions/setup/js/node_modules/.bin-lang=go1.25 nore ../../../.pretticonfig (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name ../../../**/*.json k/gh-aw/gh-aw/actions/node_modul-buildmode=exe --ignore-path ../../../.pretti-1 (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 ../../../**/*.json k/gh-aw/node_modules/.bin/sh nore ../../../.prettirev-parse (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path */*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore --local x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build3848502461/b404/cli.test /tmp/go-build3848502461/b404/cli.test -test.testlogfile=/tmp/go-build3848502461/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel e/git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv SvuWvV_iU red_workflow_test.go h ll_backslash_intgit ll_test.go e_repo_maintenan--show-toplevel e_repo_maintenance_integration_test.go ortc�� 3032-16034/test-2243417684/.github/workflows stmain.go ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -errorsas -ifaceassert -nilfunc ache/go/1.25.8/x64/pkg/tool/linuorigin (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv 323625257/.github/workflows commit.gpgsign es/.bin/node (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv 323625257 commit.gpgsign 64/pkg/tool/linux_amd64/vet ata/action_pins.git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -c=4 -nolocalimports -importcfg /tmp/go-build3848502461/b456/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/timeutil/format.go HjoE8hqd2SJr rev-�� rite '../../../*remote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -c=4 -nolocalimports -importcfg /tmp/go-build3848502461/b459/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/timeutil/spec_test.go 64/pkg/tool/linu/tmp/go-build3848502461/b436/_testmain.go rev-�� om/aymanbagabas/go-udiff@v0.4.1/-errorsas .cfg x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv on' --ignore-path ../../../.prettierignore .cfg 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/google-github-actions/auth/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/google-github-actions/auth/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git ons-test36459006git x_amd64/vet /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu--repo /usr/bin/git /tmp/go-build384git l /usr/bin/git git (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv sRemoteWithRealGitmaster_branch3790495741/001 sRemoteWithRealGitmaster_branch3790495741/002/work g_.a ath ../../../.prinfocmp (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion ignore-path ../.git (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state e_modules/.bin/sh (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name */*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore --local x_amd64/vet (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch 2407697867 /tmp/go-build4040526717/b098/vet.cfg .yml (http block)

If you need me to access, download, or install something from one of these locations, you can either:

…del helper

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/75edf0c0-57d7-41a9-9498-92f724611861

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Chore: Deduplicate panic message for invalid model domain computation chore: centralize BUG panic for invalid model in domain computation May 5, 2026
Copilot AI requested a review from gh-aw-bot May 5, 2026 08:33
@pelikhan pelikhan marked this pull request as ready for review May 5, 2026 12:30
Copilot AI review requested due to automatic review settings May 5, 2026 12:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes the “BUG: invalid model reached domain computation” invariant guard by introducing a single helper in domains.go and updating engines to use it, removing duplicated panic-on-error blocks.

Changes:

  • Added mustGetAllowedDomainsForEngineWithModel(...) wrapper around GetAllowedDomainsForEngineWithModel(...) that panics with the canonical BUG message on error.
  • Updated Pi, Crush, and OpenCode engines to call the new helper instead of repeating the same inline error handling/panic guard.
Show a summary per file
File Description
pkg/workflow/domains.go Adds a mustGet... helper that panics with a canonical BUG message when domain computation receives an invalid/malformed model.
pkg/workflow/pi_engine.go Replaces duplicated err + panic guard with a single call to the new helper.
pkg/workflow/crush_engine.go Replaces duplicated err + panic guard with a single call to the new helper.
pkg/workflow/opencode_engine.go Replaces duplicated err + panic guard with a single call to the new helper.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

@pelikhan pelikhan merged commit e8eec7c into main May 5, 2026
4 checks passed
@pelikhan pelikhan deleted the copilot/chorededuplicate-panic-message branch May 5, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: deduplicate BUG panic pattern for invalid-model domain computation across engine files

4 participants