Show lowercase profile names in posted comments
This commit is contained in:
@@ -8,8 +8,20 @@ export interface BotProfile extends ProfileIdentity {
|
||||
token?: string;
|
||||
}
|
||||
|
||||
// The lowercase name a profile type reads as in posted comments.
|
||||
function profileName(type: ProfileIdentity["type"]): string {
|
||||
switch (type) {
|
||||
case "CLAUDE":
|
||||
return "claude";
|
||||
case "CODEX":
|
||||
return "codex";
|
||||
case "OPENCODE":
|
||||
return "opencode";
|
||||
}
|
||||
}
|
||||
|
||||
export function profileFooter(profile: ProfileIdentity): string {
|
||||
return `> Profile: \`${profile.type}\` · \`${profile.model}\``;
|
||||
return `> Profile: \`${profileName(profile.type)}\` · \`${profile.model}\``;
|
||||
}
|
||||
|
||||
export function withProfile(body: string, profile: ProfileIdentity): string {
|
||||
@@ -66,7 +78,9 @@ export function failureFooter(failures: ProfileFailure[]): string {
|
||||
return "> Profile: none";
|
||||
}
|
||||
return `> Tried: ${failures
|
||||
.map(({ type, model, reason }) => `\`${type}\` · \`${model}\` (${toMessage(reason)})`)
|
||||
.map(
|
||||
({ type, model, reason }) => `\`${profileName(type)}\` · \`${model}\` (${toMessage(reason)})`,
|
||||
)
|
||||
.join(", ")}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user