fix: resolve make check failures and race conditions

This commit is contained in:
stevef 2026-04-19 10:33:19 +02:00
parent 6126ede963
commit d5ee35c97b
3 changed files with 9 additions and 7 deletions

View file

@ -306,7 +306,7 @@ test: generate
## fmt: Format Go code ## fmt: Format Go code
fmt: fmt:
@$(GOLANGCI_LINT) fmt @go fmt ./...
## lint-docs: Check common documentation layout and naming conventions ## lint-docs: Check common documentation layout and naming conventions
lint-docs: lint-docs:

View file

@ -600,10 +600,10 @@ turnLoop:
reasoningContent = response.ReasoningContent reasoningContent = response.ReasoningContent
} }
if ts.channel == "pico" { if ts.channel == "pico" {
go al.publishPicoReasoning(turnCtx, reasoningContent, ts.chatID) go al.publishPicoReasoning(ctx, reasoningContent, ts.chatID)
} else { } else {
go al.handleReasoning( go al.handleReasoning(
turnCtx, ctx,
reasoningContent, reasoningContent,
ts.channel, ts.channel,
al.targetReasoningChannelID(ts.channel), al.targetReasoningChannelID(ts.channel),

View file

@ -1,5 +1,5 @@
.PHONY: dev dev-frontend dev-backend build build-frontend build-dev-picoclaw test lint clean \ .PHONY: dev dev-frontend dev-backend build build-frontend build-dev-picoclaw test lint clean \
build-android-arm64 build-android-bundle build-android-arm64 build-android-bundle frontend-install
# Go variables # Go variables
GO?=CGO_ENABLED=0 go GO?=CGO_ENABLED=0 go
@ -105,7 +105,7 @@ build-android-bundle: build-frontend
GOOS=android GOARCH=arm64 $(GO) build -tags stdjson -ldflags "$(LDFLAGS)" -o "$(BUILD_DIR)/picoclaw-launcher-android-arm64" ./$(BACKEND_DIR)/ GOOS=android GOARCH=arm64 $(GO) build -tags stdjson -ldflags "$(LDFLAGS)" -o "$(BUILD_DIR)/picoclaw-launcher-android-arm64" ./$(BACKEND_DIR)/
@echo "All Android launcher builds complete" @echo "All Android launcher builds complete"
build-frontend: frontend-install:
@expected_stamp="$$(cat $(FRONTEND_DIR)/package.json $(FRONTEND_DIR)/pnpm-lock.yaml | cksum | awk '{print $$1 ":" $$2}')"; \ @expected_stamp="$$(cat $(FRONTEND_DIR)/package.json $(FRONTEND_DIR)/pnpm-lock.yaml | cksum | awk '{print $$1 ":" $$2}')"; \
if [ ! -d $(FRONTEND_DIR)/node_modules ] || \ if [ ! -d $(FRONTEND_DIR)/node_modules ] || \
[ ! -x $(FRONTEND_DIR)/node_modules/.bin/tsc ] || \ [ ! -x $(FRONTEND_DIR)/node_modules/.bin/tsc ] || \
@ -115,6 +115,8 @@ build-frontend:
(cd $(FRONTEND_DIR) && CI=true pnpm install --frozen-lockfile) && \ (cd $(FRONTEND_DIR) && CI=true pnpm install --frozen-lockfile) && \
printf '%s\n' "$$expected_stamp" > $(FRONTEND_INSTALL_STAMP); \ printf '%s\n' "$$expected_stamp" > $(FRONTEND_INSTALL_STAMP); \
fi fi
build-frontend: frontend-install
@echo "Building frontend..." @echo "Building frontend..."
@cd $(FRONTEND_DIR) && pnpm build:backend @cd $(FRONTEND_DIR) && pnpm build:backend
@ -124,12 +126,12 @@ build-dev-picoclaw:
@$(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o "$(PICOCLAW_BINARY)" ../cmd/picoclaw @$(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o "$(PICOCLAW_BINARY)" ../cmd/picoclaw
# Run all tests # Run all tests
test: test: frontend-install
cd $(BACKEND_DIR) && ${WEB_GO} test ./... cd $(BACKEND_DIR) && ${WEB_GO} test ./...
cd $(FRONTEND_DIR) && pnpm lint cd $(FRONTEND_DIR) && pnpm lint
# Lint and format # Lint and format
lint: lint: frontend-install
cd $(BACKEND_DIR) && ${WEB_GO} vet ./... cd $(BACKEND_DIR) && ${WEB_GO} vet ./...
cd $(FRONTEND_DIR) && pnpm check cd $(FRONTEND_DIR) && pnpm check