fix(ui): add ProviderIcon to agents page CLI tools + maxDuration for transcription

- Agents page: use ProviderIcon with 21-entry AGENT_ICON_MAP for CLI tool
  icons (claude→anthropic, codex→openai, gemini-cli→google, etc.)
- Transcription route: add maxDuration=300 for large audio/video uploads
- Combos: verified all 4 templates + 9 strategies present in UI
This commit is contained in:
diegosouzapw
2026-03-24 17:21:25 -03:00
parent 703591d76a
commit b82af2b849
2 changed files with 40 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
import { useState, useEffect, useCallback } from "react";
import Link from "next/link";
import { Card, Button, Input } from "@/shared/components";
import ProviderIcon from "@/shared/components/ProviderIcon";
import { useTranslations } from "next-intl";
import { AI_PROVIDERS } from "@/shared/constants/config";
import { CLI_COMPAT_PROVIDER_IDS } from "@/shared/constants/cliCompatProviders";
@@ -25,6 +26,35 @@ interface AgentSummary {
custom: number;
}
// Map agent binary IDs to provider icon IDs for ProviderIcon component
const AGENT_ICON_MAP: Record<string, string> = {
claude: "anthropic",
"claude-code": "anthropic",
codex: "openai",
"gemini-cli": "google",
gemini: "google",
opencode: "opencode",
openclaw: "openclaw",
cline: "cline",
kilocode: "kilocode",
kilo: "kilocode",
cursor: "cursor",
antigravity: "antigravity",
droid: "droid",
goose: "goose",
aider: "aider",
iflow: "iflow",
kiro: "kiro",
nanobot: "nanobot",
picoclaw: "picoclaw",
zeroclaw: "zeroclaw",
ironclaw: "ironclaw",
};
function getAgentIconId(agentId: string): string | null {
return AGENT_ICON_MAP[agentId] || null;
}
export default function AgentsPage() {
const [agents, setAgents] = useState<AgentInfo[]>([]);
const [summary, setSummary] = useState<AgentSummary | null>(null);
@@ -304,9 +334,13 @@ export default function AgentsPage() {
: "bg-zinc-500/10 text-zinc-400"
}`}
>
<span className="material-symbols-outlined text-[20px]">
{agent.installed ? "smart_toy" : "block"}
</span>
{getAgentIconId(agent.id) ? (
<ProviderIcon providerId={getAgentIconId(agent.id)!} size={20} type="color" />
) : (
<span className="material-symbols-outlined text-[20px]">
{agent.installed ? "smart_toy" : "block"}
</span>
)}
</div>
<div>
<div className="font-semibold text-sm flex items-center gap-1.5">

View File

@@ -1,4 +1,7 @@
import { CORS_ORIGIN } from "@/shared/utils/cors";
// Allow large audio/video file uploads — 5min for processing large files (up to 2GB)
export const maxDuration = 300;
import { handleAudioTranscription } from "@omniroute/open-sse/handlers/audioTranscription.ts";
import {
getProviderCredentials,