fix: improve UI (#403)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-27 01:55:13 -08:00
committed by GitHub
parent aa4071c721
commit 424e4980ac
8 changed files with 124 additions and 73 deletions

View File

@@ -24,6 +24,7 @@ import { getClient } from "../agent/client";
import { getCurrentAgentId, setCurrentAgentId } from "../agent/context";
import { type AgentProvenance, createAgent } from "../agent/create";
import { sendMessageStream } from "../agent/message";
import { getModelDisplayName, getModelInfo } from "../agent/model";
import { SessionStats } from "../agent/stats";
import type { ApprovalContext } from "../permissions/analyzer";
import { type PermissionMode, permissionMode } from "../permissions/mode";
@@ -527,7 +528,10 @@ export default function App({
llmConfig?.model_endpoint_type && llmConfig?.model
? `${llmConfig.model_endpoint_type}/${llmConfig.model}`
: (llmConfig?.model ?? null);
const currentModelDisplay = currentModelLabel?.split("/").pop() ?? null;
const currentModelDisplay = currentModelLabel
? (getModelDisplayName(currentModelLabel) ??
currentModelLabel.split("/").pop())
: null;
const currentModelProvider = llmConfig?.provider_name ?? null;
// Token streaming preference (can be toggled at runtime)
@@ -885,6 +889,18 @@ export default function App({
.last_run_completion;
setAgentLastRunAt(lastRunCompletion ?? null);
// Derive model ID from llm_config for ModelSelector
const agentModelHandle =
agent.llm_config.model_endpoint_type && agent.llm_config.model
? `${agent.llm_config.model_endpoint_type}/${agent.llm_config.model}`
: agent.llm_config.model;
const modelInfo = getModelInfo(agentModelHandle || "");
if (modelInfo) {
setCurrentModelId(modelInfo.id);
} else {
setCurrentModelId(agentModelHandle || null);
}
// Detect current toolset from attached tools
const { detectToolsetFromAgent } = await import("../tools/toolset");
const detected = await detectToolsetFromAgent(client, agentId);