Skip to content

fix(openai): support Go 1.26 builds and tests - #1028

Open
via2004 wants to merge 1 commit into
cloudwego:mainfrom
via2004:fix/openai-sonic-go126
Open

via2004 wants to merge 1 commit into
cloudwego:mainfrom
via2004:fix/openai-sonic-go126

Conversation

@via2004

@via2004 via2004 commented Oct 3, 2026

Copy link
Copy Markdown

What type of PR is this?

fix

Check the PR title.

  • The title follows <type>(scope): <description>.
  • The title describes the user-visible behavior.
  • No separate user documentation update is needed for this dependency compatibility fix.

More detailed description

Importing the OpenAI model component in a standalone Go 1.26 application selects Sonic v1.14.1 and fails to compile with undefined: GoMapIterator. Raise the component's Sonic dependency to v1.15.0, which adds Go 1.26 support, and update its loader dependency to v0.5.0.

Also raise Mockey to v1.4.5, which supports Go 1.26, so the component's existing tests can run on that toolchain instead of failing to link references to runtime.duffcopy and runtime.duffzero. Changes are limited to this component's go.mod and go.sum.

The current ACL source already requires Sonic v1.15.0, but this component depends on the released ACL v0.1.17. Testing as a standalone consumer with GOWORK=off verifies the dependency selection users actually get.

Validation

In components/model/openai, with GOWORK=off, on both Go 1.25.6 and Go 1.26.7 (Linux/amd64):

  • go test -race -gcflags='all=-N -l' -count=1 ./...
  • go vet ./...

Additional validation:

  • A fresh consumer module replacing only the OpenAI component with this checkout automatically selects the updated dependencies. HTTP fixture tests for Generate, Stream, and message concatenation pass on both Go versions.
  • Go 1.26.7 Windows/amd64 cross-compilation of the consumer succeeds (CGO_ENABLED=0). The original dependency set fails with the reported error on both Linux and Windows build targets. No native Windows execution was performed.
  • golangci-lint v2.5.0 reports no issues using a temporary migration of the repository's v1 configuration, under Go 1.25.6.
  • git diff --check passes.

Validation covers the OpenAI component and its standalone consumer, not all modules in eino-ext. No tests were disabled or rewritten.

Which issue(s) this PR fixes

Fixes #997.

@CLAassistant

CLAassistant commented Oct 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

components/model/openai: build fails on Go 1.26 with sonic v1.14.1 (undefined: GoMapIterator)

2 participants