When restoring a session, prefer the permissions and model values saved
in session metadata (persisted at spawn time) over the current project
config. This ensures restored sessions use the same configuration they
were originally spawned with, even if the project config has changed.
The fallback to project.agentConfig covers older sessions that were
spawned before metadata persistence was added.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>