Skip to content

Commit 1fbc09b

Browse files
committed
remove weird unused thoughtsignature fields
1 parent 1faff3e commit 1fbc09b

5 files changed

Lines changed: 30 additions & 47 deletions

File tree

pkg/aiusechat/gemini/gemini-backend.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,10 @@ func processGeminiStream(
487487
for _, fcPart := range functionCalls {
488488
if fcPart.FunctionCall != nil && fcPart.ToolUseData != nil {
489489
waveToolCalls = append(waveToolCalls, uctypes.WaveToolCall{
490-
ID: fcPart.ToolUseData.ToolCallId,
491-
Name: fcPart.FunctionCall.Name,
492-
Input: fcPart.FunctionCall.Args,
493-
ToolUseData: fcPart.ToolUseData,
494-
GoogleThoughtSignature: fcPart.FunctionCall.ThoughtSignature,
490+
ID: fcPart.ToolUseData.ToolCallId,
491+
Name: fcPart.FunctionCall.Name,
492+
Input: fcPart.FunctionCall.Args,
493+
ToolUseData: fcPart.ToolUseData,
495494
})
496495
}
497496
}

pkg/aiusechat/gemini/gemini-types.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,14 @@ type GeminiFileData struct {
9191

9292
// GeminiFunctionCall represents a function call from the model
9393
type GeminiFunctionCall struct {
94-
Name string `json:"name"`
95-
Args map[string]any `json:"args,omitempty"`
96-
ThoughtSignature string `json:"thoughtSignature,omitempty"`
94+
Name string `json:"name"`
95+
Args map[string]any `json:"args,omitempty"`
9796
}
9897

9998
// GeminiFunctionResponse represents a function execution result
10099
type GeminiFunctionResponse struct {
101-
Name string `json:"name"`
102-
Response map[string]any `json:"response"`
103-
ThoughtSignature string `json:"thoughtSignature,omitempty"`
100+
Name string `json:"name"`
101+
Response map[string]any `json:"response"`
104102
}
105103

106104
// GeminiUsageMetadata represents token usage

pkg/aiusechat/uctypes/uctypes.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,10 @@ const (
247247
)
248248

249249
type WaveToolCall struct {
250-
ID string `json:"id"` // Anthropic tool_use.id
251-
Name string `json:"name,omitempty"` // tool name (if provided)
252-
Input any `json:"input,omitempty"` // accumulated input JSON
253-
ToolUseData *UIMessageDataToolUse `json:"toolusedata,omitempty"` // UI tool use data
254-
GoogleThoughtSignature string `json:"googlethoughtsignature,omitempty"` // Gemini-specific thought signature
250+
ID string `json:"id"` // Anthropic tool_use.id
251+
Name string `json:"name,omitempty"` // tool name (if provided)
252+
Input any `json:"input,omitempty"` // accumulated input JSON
253+
ToolUseData *UIMessageDataToolUse `json:"toolusedata,omitempty"` // UI tool use data
255254
}
256255

257256
type WaveStopReason struct {
@@ -380,11 +379,10 @@ type AIMessagePart struct {
380379
}
381380

382381
type AIToolResult struct {
383-
ToolName string `json:"toolname"`
384-
ToolUseID string `json:"tooluseid"`
385-
ErrorText string `json:"errortext,omitempty"`
386-
Text string `json:"text,omitempty"`
387-
GoogleThoughtSignature string `json:"googlethoughtsignature,omitempty"`
382+
ToolName string `json:"toolname"`
383+
ToolUseID string `json:"tooluseid"`
384+
ErrorText string `json:"errortext,omitempty"`
385+
Text string `json:"text,omitempty"`
388386
}
389387

390388
func (m *AIMessage) GetMessageId() string {

pkg/aiusechat/usechat-prompts.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ package aiusechat
55

66
import "strings"
77

8-
var SystemPromptText = strings.Join([]string{
9-
`You are Wave AI, an intelligent assistant embedded within Wave Terminal, a modern terminal application with graphical widgets.`,
10-
`You appear as a pull-out panel on the left side of a tab, with the tab's widgets laid out on the right.`,
11-
`Widget context is provided as informational only.`,
12-
`Do NOT assume any API access or ability to interact with the widgets except via tools provided (note that some widgets may expose NO tools, so their context is informational only).`,
13-
}, " ")
14-
158
var SystemPromptText_OpenAI = strings.Join([]string{
169
`You are Wave AI, an assistant embedded in Wave Terminal (a terminal with graphical widgets).`,
1710
`You appear as a pull-out panel on the left; widgets are on the right.`,

pkg/aiusechat/usechat.go

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,9 @@ func updateToolUseDataInChat(backend UseChatBackend, chatOpts uctypes.WaveChatOp
200200
func processToolCallInternal(backend UseChatBackend, toolCall uctypes.WaveToolCall, chatOpts uctypes.WaveChatOpts, toolDef *uctypes.ToolDefinition, sseHandler *sse.SSEHandlerCh) uctypes.AIToolResult {
201201
if toolCall.ToolUseData == nil {
202202
return uctypes.AIToolResult{
203-
ToolName: toolCall.Name,
204-
ToolUseID: toolCall.ID,
205-
ErrorText: "Invalid Tool Call",
206-
GoogleThoughtSignature: toolCall.GoogleThoughtSignature,
203+
ToolName: toolCall.Name,
204+
ToolUseID: toolCall.ID,
205+
ErrorText: "Invalid Tool Call",
207206
}
208207
}
209208

@@ -213,10 +212,9 @@ func processToolCallInternal(backend UseChatBackend, toolCall uctypes.WaveToolCa
213212
errorMsg = "Unspecified Tool Error"
214213
}
215214
return uctypes.AIToolResult{
216-
ToolName: toolCall.Name,
217-
ToolUseID: toolCall.ID,
218-
ErrorText: errorMsg,
219-
GoogleThoughtSignature: toolCall.GoogleThoughtSignature,
215+
ToolName: toolCall.Name,
216+
ToolUseID: toolCall.ID,
217+
ErrorText: errorMsg,
220218
}
221219
}
222220

@@ -226,10 +224,9 @@ func processToolCallInternal(backend UseChatBackend, toolCall uctypes.WaveToolCa
226224
toolCall.ToolUseData.Status = uctypes.ToolUseStatusError
227225
toolCall.ToolUseData.ErrorMessage = errorMsg
228226
return uctypes.AIToolResult{
229-
ToolName: toolCall.Name,
230-
ToolUseID: toolCall.ID,
231-
ErrorText: errorMsg,
232-
GoogleThoughtSignature: toolCall.GoogleThoughtSignature,
227+
ToolName: toolCall.Name,
228+
ToolUseID: toolCall.ID,
229+
ErrorText: errorMsg,
233230
}
234231
}
235232
// ToolVerifyInput can modify the toolusedata. re-send it here.
@@ -255,10 +252,9 @@ func processToolCallInternal(backend UseChatBackend, toolCall uctypes.WaveToolCa
255252
toolCall.ToolUseData.Status = uctypes.ToolUseStatusError
256253
toolCall.ToolUseData.ErrorMessage = errorMsg
257254
return uctypes.AIToolResult{
258-
ToolName: toolCall.Name,
259-
ToolUseID: toolCall.ID,
260-
ErrorText: errorMsg,
261-
GoogleThoughtSignature: toolCall.GoogleThoughtSignature,
255+
ToolName: toolCall.Name,
256+
ToolUseID: toolCall.ID,
257+
ErrorText: errorMsg,
262258
}
263259
}
264260

@@ -446,9 +442,8 @@ func RunAIChat(ctx context.Context, sseHandler *sse.SSEHandlerCh, backend UseCha
446442

447443
func ResolveToolCall(toolDef *uctypes.ToolDefinition, toolCall uctypes.WaveToolCall, chatOpts uctypes.WaveChatOpts) (result uctypes.AIToolResult) {
448444
result = uctypes.AIToolResult{
449-
ToolName: toolCall.Name,
450-
ToolUseID: toolCall.ID,
451-
GoogleThoughtSignature: toolCall.GoogleThoughtSignature,
445+
ToolName: toolCall.Name,
446+
ToolUseID: toolCall.ID,
452447
}
453448

454449
defer func() {

0 commit comments

Comments
 (0)