tools: list_tools defaults to the profile the run executes as
Asking "what tools do I have?" required the agent to know its own profile id
— and to be right about it after a switch_profile had moved the session. The
run knows: run_stream now publishes the active profile id (re-published when
switch_profile reloads the run) alongside the model, SubAgentRunner publishes
its own rather than inheriting the parent's, and ToolContext carries it into
every execute() call.

list_tools reads that when profile_id is omitted, so the bare call answers the
question, and it says which profile it assumed ("current profile") so the
answer cannot be mistaken for another profile's.

scope='agent'|'subagent' selects which of the profile's two toolsets to list —
the set spawn_agent would hand a sub-agent running that profile, which is a
different list and until now had no way to be inspected.

Item D of the list_tools plan, kept separate from the accuracy/compactness work.
1 parent 0fdc888 commit c7a62a4b476b0d7566b92e0d0aee35bfa3457682
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 5 hours ago
Showing 10 changed files
View
docs/agent.md
View
docs/architecture.md
View
docs/mechanics.md
View
docs/tools.md
View
navi/core/agent.py
View
navi/core/subagent_runner.py
View
navi/core/tasks.py
View
navi/tools/_internal/base.py
View
navi/tools/list_tools.py
View
tests/unit/tools/test_list_tools.py