Summary
pkg/ai functionally passes its targeted tests after the #291 fix, but package-level coverage runs still show shutdown/coverage-export instability.
Evidence
go test -cover ./pkg/ai reported httptest.Server blocked in Close after 5 seconds.
- The same run then failed with
error generating coverage report ... gocoverdir ... no such file or directory.
- The behavior is separate from the original invalid-URL timeout issue, which is now fixed by fail-fast URL validation.
Why this matters
- It makes the package look unhealthy even when the functional regression is fixed.
- It undermines confidence in coverage-based gates and developer feedback loops.
Proposed work
- Audit
pkg/ai tests for response bodies or idle connections that are not drained/closed under all paths.
- Reproduce the coverage-export failure under the current Go toolchain and isolate whether it is test behavior or toolchain interaction.
- Add a targeted regression test for the timeout path that is compatible with coverage runs.
- Document any required harness changes if the issue is Go-version-specific.
Acceptance criteria
go test -cover ./pkg/ai passes reliably.
- No
httptest.Server blocked in Close warning appears in the package test run.
- Coverage artifacts are produced consistently for
pkg/ai.
Summary
pkg/aifunctionally passes its targeted tests after the #291 fix, but package-level coverage runs still show shutdown/coverage-export instability.Evidence
go test -cover ./pkg/aireportedhttptest.Server blocked in Close after 5 seconds.error generating coverage report ... gocoverdir ... no such file or directory.Why this matters
Proposed work
pkg/aitests for response bodies or idle connections that are not drained/closed under all paths.Acceptance criteria
go test -cover ./pkg/aipasses reliably.httptest.Server blocked in Closewarning appears in the package test run.pkg/ai.