From e9ad6e59f1a06ff11efeb3b59a25ffdaf085d45a Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 1 Jul 2026 05:25:48 +0000
Subject: [PATCH 1/3] Initial plan


From b6cb68cfcabda93479d9b91c697a31d404cf89ba Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 1 Jul 2026 05:38:37 +0000
Subject: [PATCH 2/3] Plan minimal lint-gap fix

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
---
 gh-aw-wasm | Bin 25586307 -> 26230983 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gh-aw-wasm b/gh-aw-wasm
index 439768d58f645b0dfc8b08fd9d086cb4bd015169..26f63fc095007c6439f12b2d8d75817a9b47d41d 100755
GIT binary patch

From 7e0f82a91a792d9e2222fd7d9c90d7e275dd939e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 1 Jul 2026 05:42:59 +0000
Subject: [PATCH 3/3] Fix wasm custom lint coverage

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
---
 .github/workflows/cgo.yml       |  3 +++
 Makefile                        |  7 +++++--
 pkg/console/console_wasm.go     |  3 ++-
 pkg/workflow/github_cli_wasm.go | 13 ++++++++++---
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/cgo.yml b/.github/workflows/cgo.yml
index e472cb9fc26..da14d043b8a 100644
--- a/.github/workflows/cgo.yml
+++ b/.github/workflows/cgo.yml
@@ -1207,6 +1207,9 @@ jobs:
     - name: Run custom linters
       run: make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -test=false"
 
+    - name: Run custom linters (wasm)
+      run: GOOS=js GOARCH=wasm make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -test=false" LINTER_PACKAGES="./pkg/console ./pkg/parser ./pkg/styles ./pkg/tty ./pkg/workflow"
+
       # Ensure no action shell scripts invoke python or python3
     - name: Lint action shell scripts
       run: make lint-action-sh
diff --git a/Makefile b/Makefile
index 53b3c6d7a1c..f26c5a25166 100644
--- a/Makefile
+++ b/Makefile
@@ -715,14 +715,17 @@ golint:
 # Builds and runs linters defined in cmd/linters against the full repository.
 # Override the large-function line limit with: make golint-custom MAX_LINES=80
 # Limit the analyzer set with: make golint-custom LINTER_FLAGS="-errstringmatch -test=false"
+# Limit analyzed packages with: make golint-custom LINTER_PACKAGES="./pkg/console ./pkg/workflow"
+# Prefix with GOOS/GOARCH to analyze alternate build targets without cross-compiling the linter runner itself.
 MAX_LINES ?= 60
 LINTER_FLAGS ?=
+LINTER_PACKAGES ?= ./cmd/... ./pkg/...
 .PHONY: golint-custom
 golint-custom:
 	@echo "Building custom linters..."
-	@go build -o /tmp/gh-aw-linters ./cmd/linters
+	@env -u GOOS -u GOARCH go build -o /tmp/gh-aw-linters ./cmd/linters
 	@echo "Running custom linters (largefunc max-lines=$(MAX_LINES))..."
-	@/tmp/gh-aw-linters $(LINTER_FLAGS) -largefunc.max-lines=$(MAX_LINES) ./cmd/... ./pkg/...
+	@/tmp/gh-aw-linters $(LINTER_FLAGS) -largefunc.max-lines=$(MAX_LINES) $(LINTER_PACKAGES)
 
 # Run incremental linter (only changed files since BASE_REF)
 # This provides 50-75% faster linting on PRs by only checking changed files
diff --git a/pkg/console/console_wasm.go b/pkg/console/console_wasm.go
index ac7fb5543dc..49b18f034de 100644
--- a/pkg/console/console_wasm.go
+++ b/pkg/console/console_wasm.go
@@ -5,6 +5,7 @@ package console
 import (
 	"fmt"
 	"os"
+	"strconv"
 	"strings"
 )
 
@@ -38,7 +39,7 @@ func FormatError(err CompilerError) string {
 
 	if len(err.Context) > 0 && err.Position.Line > 0 {
 		maxLineNum := err.Position.Line + len(err.Context)/2
-		lineNumWidth := len(fmt.Sprintf("%d", maxLineNum))
+		lineNumWidth := len(strconv.Itoa(maxLineNum))
 		for i, line := range err.Context {
 			lineNum := err.Position.Line - len(err.Context)/2 + i
 			if lineNum < 1 {
diff --git a/pkg/workflow/github_cli_wasm.go b/pkg/workflow/github_cli_wasm.go
index f943f72e968..315eeaa10db 100644
--- a/pkg/workflow/github_cli_wasm.go
+++ b/pkg/workflow/github_cli_wasm.go
@@ -16,15 +16,15 @@ import (
 // tool validation (WithSkipValidation(true)).
 
 func setupGHCommand(ctx context.Context, args ...string) *exec.Cmd {
-	return exec.Command("echo", "gh CLI not available in Wasm")
+	return ghUnavailableCommand(ctx)
 }
 
 func ExecGH(args ...string) *exec.Cmd {
-	return exec.Command("echo", "gh CLI not available in Wasm")
+	return ghUnavailableCommand(context.Background())
 }
 
 func ExecGHContext(ctx context.Context, args ...string) *exec.Cmd {
-	return exec.Command("echo", "gh CLI not available in Wasm")
+	return ghUnavailableCommand(ctx)
 }
 
 func ExecGHWithOutput(args ...string) (stdout, stderr bytes.Buffer, err error) {
@@ -43,6 +43,13 @@ func RunGHCombined(spinnerMessage string, args ...string) ([]byte, error) {
 	return nil, errors.New("gh CLI not available in Wasm")
 }
 
+func ghUnavailableCommand(ctx context.Context) *exec.Cmd {
+	if ctx == nil {
+		ctx = context.Background()
+	}
+	return exec.CommandContext(ctx, "echo", "gh CLI not available in Wasm")
+}
+
 func ForceGHHostEnv(cmd *exec.Cmd, host string) {
 	// no-op in Wasm: gh CLI subprocesses are not run
 }
