|
Fix profile switch: reload tools/schema after switch_profile tool call
switch_profile updates profile_id in DB, but run_stream() held a stale local session object — the final save would overwrite the change, and subsequent LLM calls in the same turn still used the old tool schemas. After each tool-call iteration, compare DB profile_id with the local session object. On mismatch: update session.profile_id, reload profile, tools, tool_schemas, and llm backend so the next LLM call gets the correct schema and the final save preserves the new profile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
|---|
|
|
| navi/core/agent.py |
|---|