fix(object): clarify tool-call generation error - #54
Draft
ibetitsmike wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The error
tool-based generation failedcan be mistaken for a primary chat-generation failure. It is emitted by the structured-output object path whenGenerateWithTooluses a forced tool call, including quick generation and title generation in coder/coder.Change
Clarify the wrapper so it identifies both the operation and strategy:
tool-based generation failedstructured output generation failed (tool-call strategy)I checked the neighboring object strategy wrappers. There is no JSON-mode wrapper message in this file. The existing text and streaming strategy messages are unchanged because this PR is limited to the ambiguous non-streaming tool-call path from the incident.
Fork sync note
This error string is inherited from upstream, not fork-added. It was introduced by upstream commit
cce6428(feat: support structured output (#66)), exists at the fork's merge base withupstream/main, and remains present on the current upstream default branch. This PR intentionally creates a small fork divergence that future upstream syncs should preserve or reconcile.In coder/coder, production code does not match this string. One quickgen test constructs the old wrapper text only to verify that
errors.Asstill reaches the underlying*fantasy.ProviderError.Tests
go test ./object -count=1go test ./... -count=1 -timeout=30mgo run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.9.0 runCI status
The build test matrix passes on Linux, macOS, and Windows. The remaining repository-wide failures are unrelated to this one-line copy change and also occur on current PR #53: golangci-lint v2.9 cannot read Go 1.27 export data, and govulncheck reports vulnerabilities in the base branch's Go and dependency versions.