From 5ab30f3a36621e3802fd015e1d1febc512aea2f6 Mon Sep 17 00:00:00 2001 From: Vilius Vystartas Date: Wed, 6 May 2026 18:47:41 +0100 Subject: [PATCH 1/2] fix: replace silent catch blocks with warn messages 5 silent catch {} blocks across skill-loader, skill-discovery, and gemini adapter now log the actual error. This matches the CONTRIBUTING.md standard: 'Error messages should help the user fix the problem.' Also improved the OpenAI tool stub comment to identify which tool needs implementation. Changed: - skill-loader.ts: parseSkillMd/loadSkillMetadata failures now warn - skill-discovery.ts: skill discovery/load failures now warn - gemini.ts: hook config parse failure now warns via console.warn - openai.ts: tool stub comment names the specific tool --- src/adapters/gemini.ts | 3 ++- src/adapters/openai.ts | 2 +- src/utils/skill-discovery.ts | 9 +++++---- src/utils/skill-loader.ts | 9 +++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/adapters/gemini.ts b/src/adapters/gemini.ts index 71c07ae..1c0d838 100644 --- a/src/adapters/gemini.ts +++ b/src/adapters/gemini.ts @@ -373,7 +373,8 @@ function buildHooksConfig(agentDir: string): Record | null { } return Object.keys(geminiHooks).length > 0 ? geminiHooks : null; - } catch { + } catch (err) { + console.warn(`Hook config parse failed: ${(err as Error).message}`); return null; } } diff --git a/src/adapters/openai.ts b/src/adapters/openai.ts index c98f67d..08c5bb7 100644 --- a/src/adapters/openai.ts +++ b/src/adapters/openai.ts @@ -31,7 +31,7 @@ export function exportToOpenAI(dir: string): string { const funcName = tool.name.replace(/-/g, '_'); lines.push(`def ${funcName}(${tool.params}):`); lines.push(` """${tool.description}"""`); - lines.push(` # TODO: Implement tool logic`); + lines.push(` # Tool stub — replace with actual ${tool.name} implementation`); lines.push(` pass\n`); } } diff --git a/src/utils/skill-discovery.ts b/src/utils/skill-discovery.ts index 087ffe7..27bf731 100644 --- a/src/utils/skill-discovery.ts +++ b/src/utils/skill-discovery.ts @@ -2,6 +2,7 @@ import { existsSync, readdirSync } from 'node:fs'; import { join, resolve } from 'node:path'; import { homedir } from 'node:os'; import { loadSkillMetadata, loadSkillFull, type SkillMetadata, type ParsedSkill } from './skill-loader.js'; +import { warn } from './format.js'; export interface DiscoveredSkill { name: string; @@ -76,8 +77,8 @@ export function discoverSkills(options: DiscoveryOptions): DiscoveredSkill[] { directory: meta.directory, source, }); - } catch { - // Skip unparseable skills + } catch (err) { + warn(`Skill discovery failed: ${skillMdPath} — ${(err as Error).message}`); } } } @@ -96,8 +97,8 @@ export function discoverAndLoadSkills(options: DiscoveryOptions): ParsedSkill[] const skillMdPath = join(disc.directory, 'SKILL.md'); try { skills.push(loadSkillFull(skillMdPath)); - } catch { - // Skip skills that fail to load + } catch (err) { + warn(`Skill load failed: ${skillMdPath} — ${(err as Error).message}`); } } diff --git a/src/utils/skill-loader.ts b/src/utils/skill-loader.ts index b949e27..2b2e27f 100644 --- a/src/utils/skill-loader.ts +++ b/src/utils/skill-loader.ts @@ -1,6 +1,7 @@ import { readFileSync, existsSync, readdirSync } from 'node:fs'; import { join } from 'node:path'; import yaml from 'js-yaml'; +import { warn } from './format.js'; /** * Agent Skills standard frontmatter — matches agentskills.io spec exactly. @@ -125,8 +126,8 @@ export function loadAllSkills(skillsDir: string): ParsedSkill[] { try { skills.push(parseSkillMd(skillMdPath)); - } catch { - // Skip skills that fail to parse + } catch (err) { + warn(`Skill parse failed: ${skillMdPath} — ${(err as Error).message}`); } } @@ -150,8 +151,8 @@ export function loadAllSkillMetadata(skillsDir: string): SkillMetadata[] { try { skills.push(loadSkillMetadata(skillMdPath)); - } catch { - // Skip skills that fail to parse + } catch (err) { + warn(`Skill metadata load failed: ${skillMdPath} — ${(err as Error).message}`); } } From 1817b4b4f4238d5c7ac601e3f79ed6f50adb391d Mon Sep 17 00:00:00 2001 From: Vilius Vystartas Date: Sun, 24 May 2026 17:14:44 +0100 Subject: [PATCH 2/2] fix: add financial_governance type to ComplianceConfig interface Property was used in shared.ts and validate.ts but the TypeScript interface was missing the type definition, causing CI to fail. --- src/utils/loader.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/utils/loader.ts b/src/utils/loader.ts index fda3c09..b5c7e1c 100644 --- a/src/utils/loader.ts +++ b/src/utils/loader.ts @@ -141,6 +141,22 @@ export interface ComplianceConfig { }>; enforcement?: string; }; + financial_governance?: { + enabled: boolean; + firewall?: string; + spending?: { + max_per_transaction_cents: number; + max_monthly_cents?: number; + currency?: string; + allowed_categories?: string[]; + blocked_categories?: string[]; + }; + approval?: { + require_above_cents: number; + timeout_minutes: number; + auto_deny_on_timeout: boolean; + }; + }; } export function loadAgentManifest(dir: string): AgentManifest {