@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user