switch_profile: deliver profile_switched, report the new toolset
The tool took its sink as `ctx.event_sink if ctx else current_event_sink.get()`,
but the agent loop builds tool_ctx with event_sink=None — the ContextVar is the
real channel — so the branch always picked None, the event was silently
dropped, and the profile badge in the header never moved. plan.py already had
the fall-through (`if ctx and ctx.event_sink else current_event_sink.get()`);
this is the same fix.

The result also said nothing about what the switch changed, so the model kept
calling tools the target profile does not have (reload_tools after leaving
tool_developer). It now names the gained and lost tools, and the timing claim
is corrected: the new prompt and tools are in force from the next step of the
same turn, not "from the next message".
1 parent bbd5248 commit 46672f206bd812c76ff233ca37c57c785d691cb1
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 9 hours ago
Showing 3 changed files
View
navi/core/registry.py
View
navi/tools/switch_profile.py
View
tests/unit/tools/test_switch_profile.py