Anxcye / Anxcye/anx-reader

Bug: ApiException(400) missing thought_signature when using Gemini tools (current_reading_metadata) in v1.14.0[Bug]:

未關閉
#977 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Dart
星號
8.8k
分支
626
平均合併
9 天 22 小時
30 天內合併 PR
1

描述

### Prerequisites|前提条件

- [x] I have checked the [troubleshooting](https://github.com/Anxcye/anx-reader/blob/develop/docs/troubleshooting.md)|我已经查看过[故障排除](https://github.com/Anxcye/anx-reader/blob/develop/docs/troubleshooting.md)
- [x] I have searched for similar issues and did not find any|我已经搜索过没有相同的问题

### Describe the bug|描述问题

Hello! I'm experiencing an API crash with the new AI integration in v1.14.0 when using Gemini to ask questions about the book (which triggers the `current_reading_metadata` tool).
The Google API now requires a `thought_signature` for function calls to work correctly, which seems to be missing in the app's request.

### To reproduce|重现步骤

1. Open a book in Anx Reader v1.14.0.
2. Open the AI Chat and select a Gemini model (e.g., gemini-3.5-flash).
3. Ask a question that requires reading metadata (like: "cuantas páginas tiene este libro?").
4. See the ApiException(400) error appear immediately instead of the AI's answer.

### Expected behavior|预期行为

The Gemini model should successfully process the `current_reading_metadata` function call and return the requested information about the book, rather than throwing an API Exception.

### Screenshots|截图

Image

### Platform (please complete the following information)|平台(请填写以下信息)

- Platform: Android
- OS: Android 15
- AnxReader Version: 1.14.0
- Device: Tecno Pova 6

### Additional context|其他信息

Full error string shown in UI: "Error: ApiException(400): Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly... Additional data, function call default_api:current_reading_metadata, position 2."

貢獻指南

開啟貢獻指南

研究方向

Reproduce the crash in Anx Reader v1.14.0 on Android by asking the Gemini model a question that invokes current_reading_metadata. Start by tracing the Gemini function-call request and its thought_signature handling. Done means the tool call returns the requested book metadata without the ApiException(400).

由索引模型根據 Issue 內容生成。

評估

技術堆疊
dart, flutter
領域
ai, mobile
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
活躍
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。