fix: add full Gemini toolset support for UI rendering and permissions (#273)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-17 18:26:21 -08:00
committed by GitHub
parent 2b51b6d957
commit b202594b48
4 changed files with 128 additions and 22 deletions

View File

@@ -135,6 +135,7 @@ export const ToolCallMessage = memo(({ line }: { line: ToolCallLine }) => {
const parsedArgs = JSON.parse(line.argsText);
if (parsedArgs.todos && Array.isArray(parsedArgs.todos)) {
// Convert todos to safe format for TodoRenderer
// Note: Anthropic/Codex use "content", Gemini uses "description"
const safeTodos = parsedArgs.todos.map((t: unknown, i: number) => {
const rec = isRecord(t) ? t : {};
const status: "pending" | "in_progress" | "completed" =
@@ -144,8 +145,13 @@ export const ToolCallMessage = memo(({ line }: { line: ToolCallLine }) => {
? "in_progress"
: "pending";
const id = typeof rec.id === "string" ? rec.id : String(i);
// Handle both "content" (Anthropic/Codex) and "description" (Gemini) fields
const content =
typeof rec.content === "string" ? rec.content : JSON.stringify(t);
typeof rec.content === "string"
? rec.content
: typeof rec.description === "string"
? rec.description
: JSON.stringify(t);
const priority: "high" | "medium" | "low" | undefined =
rec.priority === "high"
? "high"