Context
runtime/restored_sessions.rs still parses restored provider strings with unwrap() in two places:
restored_session_to_handle
prepare_restored_session_for_direct_resume
That means a malformed provider value in the database can panic session restoration instead of degrading gracefully.
Task
Harden restored provider parsing in runtime/restored_sessions.rs.
Please:
- extract a small helper so the parsing logic only lives in one place
- preserve normal behavior for valid provider values, including mixed-case input
- replace the
unwrap() calls with a safe fallback
- log a warning when fallback is used so the bad stored value is visible
- add focused unit tests for valid and invalid provider strings
Use Provider::Claude as the fallback so restored read paths stay aligned with the other mission/provider hardening work.
Acceptance Criteria
- Restored session helpers no longer panic on invalid provider strings.
- Valid provider strings still restore correctly.
- Invalid provider strings fall back predictably and are logged.
- The new helper has direct unit test coverage.
Files
orbitdock-server/crates/server/src/runtime/restored_sessions.rs
Context
runtime/restored_sessions.rsstill parses restored provider strings withunwrap()in two places:restored_session_to_handleprepare_restored_session_for_direct_resumeThat means a malformed provider value in the database can panic session restoration instead of degrading gracefully.
Task
Harden restored provider parsing in
runtime/restored_sessions.rs.Please:
unwrap()calls with a safe fallbackUse
Provider::Claudeas the fallback so restored read paths stay aligned with the other mission/provider hardening work.Acceptance Criteria
Files
orbitdock-server/crates/server/src/runtime/restored_sessions.rs