close
Skip to content

fix(object): clarify tool-call generation error - #54

Draft
ibetitsmike wants to merge 1 commit into
mainfrom
mike/object-toolcall-error-copy
Draft

fix(object): clarify tool-call generation error#54
ibetitsmike wants to merge 1 commit into
mainfrom
mike/object-toolcall-error-copy

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 20, 2026

Copy link
Copy Markdown

Problem

The error tool-based generation failed can be mistaken for a primary chat-generation failure. It is emitted by the structured-output object path when GenerateWithTool uses 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:

  • Before: tool-based generation failed
  • After: structured 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 with upstream/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.As still reaches the underlying *fantasy.ProviderError.

Tests

  • go test ./object -count=1
  • go test ./... -count=1 -timeout=30m
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.9.0 run

CI 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.

🤖 Mux authored this PR on Mike's behalf.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant