Skip to content

fix: log swallowed errors across scheduler, MCP, UI, and storage layers#154

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781644734-improve-error-handling
Open

fix: log swallowed errors across scheduler, MCP, UI, and storage layers#154
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781644734-improve-error-handling

Conversation

@devin-ai-integration

Copy link
Copy Markdown

What Changed

Replaces ~30 bare catch {} / catch { return fallback } / .catch(() => fallback) patterns with structured console.warn calls that surface the error message using the existing [tag] prefix convention. Every catch still returns the same fallback value — no behavioral change — but now the error is logged so operators can diagnose failures.

Files (15):

Area File What was silent
Scheduler service.ts fireJobCompleteCallbacks swallowed callback errors
Scheduler parse-with-sonnet.ts Sonnet judge failure returned generic 422 with no server-side log
Scheduler schedule.ts Invalid cron in computeNextRunAt returned null with no log
Onboarding profiler.ts Three Slack API calls (.catch(() => null)) with no trace
MCP tools-swe.ts recallEpisodes/recallFacts failures in codebase_query and repo_info
MCP tools-universal.ts recallEpisodes/recallFacts/findProcedure in searchMemoryCore
MCP resources.ts healthCheck, recallEpisodes, recallFacts in resource handlers
UI pages.ts extractTitle empty catch
UI identity.ts readMetaSync, tmp-file cleanup, old avatar pruning, delete
UI evolution.ts listPoisonPile, statSync/readFileSync in readFilePreview
Secrets crypto.ts Encryption key file read fallback to generation
Persona llm-caller.ts JSON envelope parse failure
Skills storage.ts Previous-content read on upsert/delete
Subagents storage.ts Previous-content read on upsert/delete
Plugins curated.ts Overlay stat failure

Why

Bare catch {} blocks silently swallow errors, making it impossible to diagnose why graceful degradation kicked in. When memory, Slack, scheduling, or file I/O silently fails, the operator has no log trail. These warnings surface the root cause without changing any runtime behavior.

How I Tested

bun test          # 2640 pass, 0 fail
bun run lint      # clean
bun run typecheck # clean

All 2640 tests pass unchanged — every fix is additive logging, no behavior change.

Checklist

  • Tests pass (bun test)
  • Lint passes (bun run lint)
  • Typecheck passes (bun run typecheck)
  • No secrets or .env files included
  • Files stay under 300 lines
  • No Cardinal Rule violations (TypeScript does plumbing only, the Agent SDK does reasoning)
  • No default exports or barrel files added

Link to Devin session: https://app.devin.ai/sessions/fcaafb7496fb40bb95440bc7c00d240b
Requested by: @mcheemaa

Replace bare catch blocks and silent .catch(() => fallback) patterns
with structured console.warn/console.error calls using the existing
[tag] prefix convention. Every catch now surfaces the error message
for operator debugging while preserving the existing graceful-degradation
behavior (return fallback values, continue without crashing).

Files changed:
- scheduler/service.ts: fireJobCompleteCallbacks
- scheduler/parse-with-sonnet.ts: Sonnet judge call
- scheduler/schedule.ts: cron parse in computeNextRunAt
- onboarding/profiler.ts: Slack API calls
- mcp/tools-swe.ts: memory recall in codebase_query, repo_info
- mcp/tools-universal.ts: memory recall in searchMemoryCore
- mcp/resources.ts: health check, memory recall in resources
- ui/api/pages.ts: title extraction
- ui/api/identity.ts: avatar meta read, tmp cleanup, prune/delete
- ui/api/evolution.ts: poison pile, file stat/read preview
- secrets/crypto.ts: encryption key file read
- persona/llm-caller.ts: JSON envelope parse
- skills/storage.ts: previous content read on upsert/delete
- subagents/storage.ts: previous content read on upsert/delete
- plugins/curated.ts: overlay stat

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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