Skip to content

[V1.3.0] bug: save_state() silently swallows write errors — onboarding state loss goes unnoticed #197

@AlanAAG

Description

@AlanAAG

save_state() (aliased from agent_core.save_onboarding_state) catches all exceptions internally and returns False on failure. The caller mark_hard_complete() in OnboardingManager never checks that return value, so any write failure — disk full, permissions error, path issue — is swallowed silently. The user sees no error, the state never persists, and the onboarding re-triggers on next launch with no indication of why.

Affected files

  • agent_core/core/impl/onboarding.py — save_onboarding_state() / save_state()

  • agent_core — OnboardingManager.mark_hard_complete()

Steps to reproduce

  1. Simulate a write failure (e.g. make .credentials/ or the config path read-only)

  2. Complete hard onboarding

  3. Relaunch the app — hard onboarding re-runs with no error shown

Expected behavior
Save failures should be surfaced ,either raise an exception, log a visible warning, or return a result that the caller explicitly handles and communicates to the user.

Proposed fix

*In save_onboarding_state(): re-raise the exception after logging, or return a typed result that forces the caller to handle it

*In mark_hard_complete(): check the return value of save_state() and handle failure explicitly — at minimum log a warning, ideally surface it to the user

Notes
This is part of a broader silent failure pattern in the codebase (same pattern exists in credentials.py). This issue tracks only the onboarding case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions