* @brief Builds the history tool_use block, folding provider extras (underscore-prefixed * passthrough fields such as Gemini thought signatures) into it. */
| 455 | * passthrough fields such as Gemini thought signatures) into it. |
| 456 | */ |
| 457 | static QJsonObject makeToolUseBlock(const QString& callId, |
| 458 | const QString& name, |
| 459 | const QJsonObject& arguments, |
| 460 | const QJsonObject& extras) |
| 461 | { |
| 462 | QJsonObject block; |
| 463 | block[QStringLiteral("type")] = QStringLiteral("tool_use"); |
| 464 | block[QStringLiteral("id")] = callId; |
| 465 | block[QStringLiteral("name")] = name; |
| 466 | block[QStringLiteral("input")] = arguments; |
| 467 | for (auto it = extras.constBegin(); it != extras.constEnd(); ++it) |
| 468 | if (it.key().startsWith(QLatin1Char('_'))) |
| 469 | block[it.key()] = it.value(); |
| 470 | |
| 471 | return block; |
| 472 | } |
| 473 | |
| 474 | /** |
| 475 | * @brief Records a tool-use request and dispatches per safety tag. |
no test coverage detected