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
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,44 @@ export function fromPersistedEffort(
);
return DEFAULT_SENTINEL;
}

/**
* Resolve a DB-persisted model/effort value to the human-readable label
* the picker shows. Used by read-only views (session detail, schedule
* list) so the label matches what the user originally selected.
*
* null/undefined → "デフォルト" (matches the sentinel's label).
* Unknown values (persisted from an older build with a wider allowed set)
* surface the raw string so detail views don't silently lie about what is
* actually configured — we fall back to `fromPersisted*` only for the
* `DEFAULT_SENTINEL` case.
*/
export function getClaudeModelLabel(
persisted: string | null | undefined,
): string {
if (persisted == null) {
return (
CLAUDE_MODEL_SELECT_OPTIONS.find((o) => o.value === DEFAULT_SENTINEL)
?.label ?? "デフォルト"
);
}
return (
CLAUDE_MODEL_SELECT_OPTIONS.find((o) => o.value === persisted)?.label ??
persisted
);
}

export function getClaudeEffortLabel(
persisted: string | null | undefined,
): string {
if (persisted == null) {
return (
CLAUDE_EFFORT_SELECT_OPTIONS.find((o) => o.value === DEFAULT_SENTINEL)
?.label ?? "デフォルト"
);
}
return (
CLAUDE_EFFORT_SELECT_OPTIONS.find((o) => o.value === persisted)?.label ??
persisted
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export {
DEFAULT_SENTINEL,
fromPersistedEffort,
fromPersistedModel,
getClaudeEffortLabel,
getClaudeModelLabel,
toPersistedEffort,
toPersistedModel,
} from "./claudeRuntimeOptions";
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import {
HiMiniPencil,
HiMiniTrash,
} from "react-icons/hi2";
import {
getClaudeEffortLabel,
getClaudeModelLabel,
} from "renderer/features/todo-agent/ClaudeRuntimePicker";
import { electronTrpc } from "renderer/lib/electron-trpc";
import { describeSchedule } from "../../utils/describeSchedule";
import { formatNextRun } from "../../utils/formatNextRun";
Expand Down Expand Up @@ -87,6 +91,10 @@ export function ScheduleListRow({
{workspaceName ? ` / ${workspaceName}` : " / main"}
</span>
</div>
<div className="text-[10px] text-muted-foreground mt-0.5 flex flex-wrap gap-x-2">
<span>モデル: {getClaudeModelLabel(schedule.claudeModel)}</span>
<span>effort: {getClaudeEffortLabel(schedule.claudeEffort)}</span>
</div>
{schedule.lastRunAt && (
<div className="text-[10px] text-muted-foreground mt-0.5">
最終: {new Date(schedule.lastRunAt).toLocaleString("ja-JP")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ import {
DEFAULT_SENTINEL,
fromPersistedEffort,
fromPersistedModel,
getClaudeEffortLabel,
getClaudeModelLabel,
toPersistedEffort,
toPersistedModel,
} from "../ClaudeRuntimePicker";
Expand Down Expand Up @@ -1523,6 +1525,19 @@ function SessionDetail({ session, onDeleted }: SessionDetailProps) {
</DetailBlock>
</div>

<div className="grid grid-cols-2 gap-4">
<DetailBlock label="Claude モデル">
<div className="text-xs">
{getClaudeModelLabel(session.claudeModel)}
</div>
</DetailBlock>
<DetailBlock label="思考 effort">
<div className="text-xs">
{getClaudeEffortLabel(session.claudeEffort)}
</div>
</DetailBlock>
</div>

{(session.totalCostUsd != null ||
session.totalNumTurns != null) && (
<DetailBlock label="消費">
Expand Down
Loading