fix(agents): getAllAdapters returns correct agent types

Fixed getAllAdapters() to return the correct agent type from the
record keys instead of relying on adapter.type property, which
was returning 'universal' for all UniversalAdapter instances.

This fixes the E2E test that checks for all 32 agents in init --list
output (cline, codebuddy, commandcode, etc. were showing as 'universal').
This commit is contained in:
Rohit Ghumare
2026-01-29 19:19:35 +00:00
parent 2d094fdd71
commit 6eb06f647d
+10 -2
View File
@@ -81,8 +81,16 @@ export function getAdapter(type: AgentType): AgentAdapter {
return adapters[type];
}
export function getAllAdapters(): AgentAdapter[] {
return Object.values(adapters);
export interface AgentAdapterWithType extends AgentAdapter {
readonly agentType: AgentType;
}
export function getAllAdapters(): AgentAdapterWithType[] {
return Object.entries(adapters).map(([type, adapter]) => ({
...adapter,
type: type as AgentType,
agentType: type as AgentType,
}));
}
export async function detectAgent(): Promise<AgentType> {