Skip to content

fix: replace silent catch blocks with warn messages#77

Open
vystartasv wants to merge 2 commits intoopen-gitagent:mainfrom
vystartasv:fix/silent-catch-blocks
Open

fix: replace silent catch blocks with warn messages#77
vystartasv wants to merge 2 commits intoopen-gitagent:mainfrom
vystartasv:fix/silent-catch-blocks

Conversation

@vystartasv
Copy link
Copy Markdown

What

Replaces 5 silent catch {} blocks with proper error logging. These catch blocks were swallowing real failures — skill parse errors, hook config issues, and discovery problems — with zero visibility for the user.

The CONTRIBUTING.md standard says: "Error messages should help the user fix the problem. 'Failed to load agent.yaml: file not found at /path' is great. A bare 'Error' isn't helpful." These catch blocks didn't even give a bare error — they were completely silent.

Changes

File What Before After
skill-loader.ts parseSkillMd failure Silent skip warn() with path + error message
skill-loader.ts loadSkillMetadata failure Silent skip warn() with path + error message
skill-discovery.ts Discovery parse failure Silent skip warn() with path + error message
skill-discovery.ts Skill load failure Silent skip warn() with path + error message
gemini.ts Hook config parse failure Silent return null console.warn() then return null
openai.ts Tool stub TODO Generic # TODO Names the specific tool that needs implementation

Why

Debugging silent skill or hook failures is currently impossible without adding temporary console.log calls. Users see "0 skills loaded" with no indication WHY their skills didn't parse.

Tested

  • npm run build passes (pre-existing js-yaml type issue unchanged)
  • All files compile to dist/
  • Warning messages follow existing warn() pattern from format.ts

vystartasv added 2 commits May 6, 2026 18:29
Implements the identity layer proposed in open-gitagent#70:
- New identy.yaml optional file convention for agent repos
- JSON Schema (spec/schemas/identity.schema.json)
- SPECIFICATION.md section 3a with field spec, example, semantics
- Directory structure updated

Schema maps 1:1 to Works With Agents Identity Protocol (L2, CC BY 4.0):
https://workswithagents.dev/specs/identity.md

Fully optional. Agents without identity.yaml continue working.
Production/regulated deployments get Ed25519 key binding with
signing, verification, delegation, and revocation semantics.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant