Skip to content
This repository was archived by the owner on Jul 3, 2026. It is now read-only.
This repository was archived by the owner on Jul 3, 2026. It is now read-only.

Logging: ~50 silent catch blocks need debug logging #257

Description

@LaloLalo1999

Summary

The Codex GPT 5.4 audit (PR #253) found approximately 50 empty or silent catch blocks across the codebase. These swallow errors without any logging, making debugging extremely difficult in production.

Pattern

// ❌ Current — error silently swallowed
try {
  await fetchProviderModels(provider);
} catch {
  // nothing — failure is invisible
}

// ✅ Goal — structured debug logging
try {
  await fetchProviderModels(provider);
} catch (error) {
  logger.debug('Failed to fetch models for provider', { provider, error });
  // or at minimum:
  console.debug('[fetchProviderModels]', provider, error);
}

Scope

Silent catches are spread across all three packages:

  • packages/cli/ — command execution, config parsing
  • packages/runtime/ — channel adapters, daemon lifecycle
  • packages/core/ — utility functions, type coercions

How to Contribute

  1. Search for empty catch blocks: catch {, catch (e) {}, catch (_)
  2. Add appropriate logging at debug or warn level
  3. Preserve the original error-swallowing behavior where intentional (add a comment explaining why)
  4. Run pnpm test to verify no behavior changes
  5. Submit a scoped PR

Guidelines

  • Use console.debug for now (structured logging migration is tracked separately)
  • Include context: function name, relevant parameters, the error itself
  • Don't convert intentional no-ops (like optional feature detection) — just add a comment

Acceptance Criteria

  • All empty catch blocks either have logging or an explanatory comment
  • pnpm test passes
  • No runtime behavior changes

Context

Found during the multi-model audit in PR #253.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions