|
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". |
|---|
|
|
| navi/core/registry.py |
|---|
| navi/tools/switch_profile.py |
|---|
| tests/unit/tools/test_switch_profile.py |
|---|