Skip to content
Open
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
20 changes: 17 additions & 3 deletions src/agent/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ export async function getAvailableAgents(): Promise<AgentInfo[]> {
}

// Filter out hidden agents and subagents (only show primary and all)
const filtered = agents.filter(
(agent) => !agent.hidden && (agent.mode === "primary" || agent.mode === "all"),
);
const filtered = agents
.filter((agent) => !agent.hidden && (agent.mode === "primary" || agent.mode === "all"))
.map((agent) => ({
name: agent.name,
description: agent.description,
color: agent.color,
mode: agent.mode,
hidden: agent.hidden,
steps: agent.steps,
model: agent.model ? { modelID: agent.model.modelID, providerID: agent.model.providerID } : undefined,
}));

logger.debug(`[AgentManager] Fetched ${filtered.length} available agents`);
return filtered;
Expand Down Expand Up @@ -138,6 +146,12 @@ export function selectAgent(agentName: string): void {
setCurrentAgent(agentName);
}

export async function getModelForAgent(agentName: string): Promise<{ modelID: string; providerID: string } | null> {
const agents = await getAvailableAgents();
const agent = agents.find((a) => a.name === agentName);
return agent?.model ?? null;
}

/**
* Get stored agent from settings (synchronous)
* @returns Current agent name or default "build"
Expand Down
4 changes: 4 additions & 0 deletions src/agent/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export interface AgentInfo {
mode: "subagent" | "primary" | "all";
hidden?: boolean;
steps?: number;
model?: {
modelID: string;
providerID: string;
};
}

/**
Expand Down
14 changes: 14 additions & 0 deletions src/background-session/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ class BackgroundSessionTracker {
case "session.idle":
this.handleSessionIdle(event.properties as SessionIdleEventProperties, currentSessionId);
break;
case "session.deleted": {
const props = event.properties as SessionInfoEventProperties;
const deletedId = props.info?.id;
if (deletedId) {
this.sessionTitles.delete(deletedId);
this.childSessionIds.delete(deletedId);
this.completedAssistantMessageIds.delete(deletedId);
this.pendingAssistantResponsesBySessionId.delete(deletedId);
this.questionRequestIds.delete(deletedId);
this.permissionRequestIds.delete(deletedId);
logger.debug(`[BackgroundSessionTracker] Cleaned up deleted session: id=${deletedId}`);
}
break;
}
case "question.asked":
this.handleRequestEvent(
"question_asked",
Expand Down
1 change: 0 additions & 1 deletion src/bot/commands/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const COMMAND_DEFINITIONS: BotCommandI18nDefinition[] = [
{ command: "worktree", descriptionKey: "cmd.description.worktree" },
{ command: "task", descriptionKey: "cmd.description.task" },
{ command: "tasklist", descriptionKey: "cmd.description.tasklist" },
{ command: "rename", descriptionKey: "cmd.description.rename" },
{ command: "commands", descriptionKey: "cmd.description.commands" },
{ command: "skills", descriptionKey: "cmd.description.skills" },
{ command: "mcps", descriptionKey: "cmd.description.mcps" },
Expand Down
169 changes: 0 additions & 169 deletions src/bot/commands/rename.ts

This file was deleted.

Loading