Skip to content

Improve error handling: log previously silenced failures in recovery and stream paths#2

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

Improve error handling: log previously silenced failures in recovery and stream paths#2
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782257264-improve-error-handling

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Error recovery/rollback operations and background stream handlers were silently discarding failures via bare let _ = or missing error branches. When these paths fail, the system loses its ability to restore consistent state—and there's no observable signal that something went wrong.

This PR adds diagnostic log entries (append_diagnostic_log) to all critical silent-failure sites without changing control flow or error propagation semantics. The pattern used:

if let Err(err) = fallible_recovery_op() {
    let _ = crate::diagnostic_log::append_diagnostic_log(
        "module.event_name",
        serde_json::json!({ "error": err.to_string(), ... }),
    );
}

Key changes:

  • relay_switch.rs — Log when store.save() fails during rollback after a failed apply_selected_relay_profile, and when settings load falls back to defaults
  • relay_config.rs — Log failed restore_optional_file calls for both auth and config paths during write-error rollback
  • launcher.rs — Log stream chunk read errors (previously break with no trace), helper connection errors (fire-and-forget task), and failure-status persistence errors
  • watcher.rs — Log command.spawn() failure when relaunching on Windows
  • provider_sync.rs — Log restore_session_changes failure during apply-error rollback

Link to Devin session: https://app.devin.ai/sessions/00a57b2e950a4c45b346a605e295aad6
Requested by: @ManhND226677

…and stream paths

- relay_switch.rs: Log rollback save failure and settings load fallback
- relay_config.rs: Log failed file restoration during config write rollback
- launcher.rs: Log stream chunk errors, helper connection failures, and
  failure status persistence errors
- watcher.rs: Log spawn_launcher failures
- provider_sync.rs: Log restore_session_changes failure during rollback

All error recovery and rollback operations now emit diagnostic log entries
when they fail, making silent failures observable without changing the
control flow or error propagation semantics.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ManhND226677 ManhND226677 self-assigned this Jun 23, 2026
@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