Show lowercase profile names in posted comments

This commit is contained in:
Danny Kim
2026-10-20 01:53:32 +09:00
parent 41a9c6258a
commit 13efaccb17
3 changed files with 27 additions and 13 deletions
+16 -2
View File
@@ -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(", ")}`;
}