Skip to content

fix(capture): removeCaptureHooks throws on missing hooks array entry in settings.json #302

Description

@dean0x

Problem

The removeCaptureHooks() function in src/cli/commands/capture.ts:93 can throw if a settings.json hook entry is missing its hooks array. This throws during the init settings pass, aborting the entire init command.

Current Status

Expected Behavior

  • removeCaptureHooks() should gracefully handle missing/malformed hook entries
  • Should return a Result type or log a warning instead of throwing
  • Init should continue even if hook cleanup encounters a missing array

Acceptance Criteria

  • removeCaptureHooks() returns Result type instead of throwing
  • Graceful handling of missing hooks array in settings.json entries
  • Init completes successfully even if a hook entry is malformed
  • Error logged with clear guidance if cleanup is needed
  • Test added for malformed hook entry scenario

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt items to address

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions