cloudwego / cloudwego/eino-ext
components/model/openai: build fails on Go 1.26 with sonic v1.14.1 (undefined: GoMapIterator)
- Dominant language
- Go
- Stars
- 811
- Forks
- 368
- Avg merge
- 16h 22m
- Merged PRs (30d)
- 13
Description
A clean install of the OpenAI model component fails to build on **go1.26.7 windows/amd64**:
```console
$ go mod init example && go get github.com/cloudwego/eino-ext/components/model/openai
$ go build ./...
# github.com/bytedance/sonic/internal/rt
…/sonic@v1.14.1/internal/rt/stubs.go:33:22: undefined: GoMapIterator
…/sonic@v1.14.1/internal/rt/stubs.go:36:54: undefined: GoMapIterator
```
`go get` resolves `github.com/bytedance/sonic v1.14.1`, and `GoMapIterator` is a runtime-internal symbol that is no longer available to it on Go 1.26. Nothing in Eino's own code is involved.
## Workaround
```bash
go get github.com/bytedance/sonic@latest # v1.14.1 → v1.15.4
```
After that the build succeeds and the component works — I ran a `NewChatModel` + `Generate` against an OpenAI-compatible endpoint with no further changes.
## Why it might be worth a version floor
The compiler error names `sonic`, not Eino, so someone whose first contact with the project is `go get …/components/model/openai` on a current toolchain hits a wall that reads as unrelated to what they just installed. Bumping the minimum `sonic` version in `go.mod` would turn a confusing build failure into a resolved dependency.
Happy to open a PR for the `go.mod` bump if that is useful — I have not sent one because I do not know whether a newer `sonic` breaks anything else you support.
Contributor guide
Research direction
Start with the OpenAI model component's go.mod and inspect the sonic requirement, then reproduce the clean-install build on go1.26.7 windows/amd64. Confirm that the dependency floor resolves the reported GoMapIterator failure and that NewChatModel plus Generate still works against an OpenAI-compatible endpoint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100