Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
import type { SessionListItem } from "./types";
/** Keep transcript selection valid as running or empty rows enter and leave. */
export function resolveSelectedSessionId(
sessions: SessionListItem[],
currentId: string | null,
): string | null {
if (currentId !== null && sessions.some((session) => session.id === currentId)) {
return currentId;
}
const newestFinished = sessions.find((session) => session.ended_ms !== null);
return (newestFinished ?? sessions[0])?.id ?? null;
}