config: warn on unknown toolSets typo instead of dropping silently

unknownToolSetNames() + startup notice (stderr headless, NoticeBus
interactive) flags gti vs git typos at boot, not as that set off.
This commit is contained in:
asepharyana
2026-09-09 13:28:24 +07:00
parent dcede3c10a
commit 5028ea6973
4 changed files with 24 additions and 3 deletions
+5
View File
@@ -82,6 +82,11 @@ export async function writeConfigFile(patch: Partial<Config>): Promise<string> {
}
/** File config, then env overrides. Env wins so `SHIRO_MODEL=x shiro` works. */
export function unknownToolSetNames(raw: unknown): string[] {
if (!Array.isArray(raw)) return [];
return (raw as unknown[]).filter((v): v is string => typeof v === 'string' && !isToolSetName(v));
}
export async function loadConfig(): Promise<Config> {
const file = await readConfigFile();