Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion web/src/components/CronJobList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ function formatRelativeTime(timestamp) {

function formatModel(model) {
if (!model) return null;
const modelPart = model.includes('/') ? model.split('/').pop() : model;
const modelValue =
typeof model === 'string' ? model : model?.id || model?.model || model?.name || null;
if (!modelValue || typeof modelValue !== 'string') return null;
const modelPart = modelValue.includes('/') ? modelValue.split('/').pop() : modelValue;
const lower = modelPart.toLowerCase();
if (lower.includes('kimi-k2')) return 'Kimi K2.5';
if (lower.includes('opus-4')) return 'Opus 4';
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/CronRunHistoryPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ function formatCost(cost) {

function formatModel(model) {
if (!model) return null;
const part = model.includes('/') ? model.split('/').pop() : model;
const modelValue =
typeof model === 'string' ? model : model?.id || model?.model || model?.name || null;
if (!modelValue || typeof modelValue !== 'string') return null;
const part = modelValue.includes('/') ? modelValue.split('/').pop() : modelValue;
const l = part.toLowerCase();
if (l.includes('kimi-k2')) return 'Kimi K2.5';
if (l.includes('opus-4')) return 'Opus 4';
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/SessionDetailPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,10 @@ export default function SessionDetailPanel({ isOpen, onClose, session, latestRun

const formatModelName = (model) => {
if (!model) return null;
const modelPart = model.includes('/') ? model.split('/').pop() : model;
const modelValue =
typeof model === 'string' ? model : model?.id || model?.model || model?.name || null;
if (!modelValue || typeof modelValue !== 'string') return null;
const modelPart = modelValue.includes('/') ? modelValue.split('/').pop() : modelValue;
const lower = modelPart.toLowerCase();
if (lower.includes('kimi-k2')) return 'Kimi K2.5';
if (lower.includes('opus-4-6') || lower.includes('opus-4')) return 'Opus 4';
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/SessionRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ export default function SessionRow({ session, onClick, statusDisplay }) {

const formatModelName = (model) => {
if (!model) return null;
const modelValue =
typeof model === 'string' ? model : model?.id || model?.model || model?.name || null;
if (!modelValue || typeof modelValue !== 'string') return null;
// Handle provider/model format (e.g., "moonshotai/kimi-k2.5")
const modelPart = model.includes('/') ? model.split('/').pop() : model;
const modelPart = modelValue.includes('/') ? modelValue.split('/').pop() : modelValue;
// Simplify known model names
const lower = modelPart.toLowerCase();
if (lower.includes('kimi-k2')) return 'Kimi K2.5';
Expand Down
5 changes: 4 additions & 1 deletion web/src/pages/CronJobs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ function isWithinJustNowWindow(timestamp) {
*/
function formatModel(model) {
if (!model) return null;
const modelPart = model.includes('/') ? model.split('/').pop() : model;
const modelValue =
typeof model === 'string' ? model : model?.id || model?.model || model?.name || null;
if (!modelValue || typeof modelValue !== 'string') return null;
const modelPart = modelValue.includes('/') ? modelValue.split('/').pop() : modelValue;
const lower = modelPart.toLowerCase();
if (lower.includes('kimi-k2')) return 'Kimi K2.5';
if (lower.includes('opus-4')) return 'Opus 4';
Expand Down
5 changes: 4 additions & 1 deletion web/src/pages/Log.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ const groupByDay = (logs) => {

function formatModel(model) {
if (!model) return null;
const modelPart = model.includes('/') ? model.split('/').pop() : model;
const modelValue =
typeof model === 'string' ? model : model?.id || model?.model || model?.name || null;
if (!modelValue || typeof modelValue !== 'string') return null;
const modelPart = modelValue.includes('/') ? modelValue.split('/').pop() : modelValue;
const lower = modelPart.toLowerCase();
if (lower.includes('kimi-k2')) return 'Kimi K2.5';
if (lower.includes('opus-4')) return 'Opus 4';
Expand Down
Loading