How to reproduce:
1. Create a new Unity project and install the AI Assistant package
2. Set a third-party agent (Claude Code) in the AI Assistant without configuring an API key
2. Send a prompt (e.g. "test")
3. Observe the "Authentication failed. Please check your API key in Gateway preferences." error with a 401 "invalid x-api-key" response
4. Send the prompt again a few times, and switch to a previous conversation
5. Observe the result
Expected results: The agent consistently fails with a clear authentication error until a valid API key is configured
Actual results: After retrying and switching to a previous conversation, the agent starts responding successfully as claude-sonnet-5 despite no API key ever being configured in Gateway preferences, with no indication of what authentication path was actually used
Reproducible with: 2.20.0-pre.1 (6000.7.0b3)
Reproducible on: macOS Tahoe 26 (M1)
Not reproducible on: No other environment tested
Note: Claude Code is installed and was previously logged in on this machine outside of Unity