JSON.stringify is sensitive to property insertion order, so two semantically identical ProviderModelOptions objects constructed with keys in different orders would serialize to different strings. This caused sameModelOptions to return false incorrectly, triggering unnecessary Claude session restarts that cleared the resume cursor and lost conversation context. Replace with a recursive structural equality check that compares objects by their defined (non-undefined) keys and values regardless of key ordering. Co-authored-by: Julius Marminge <[email protected]>