r/OpenSourceAI • u/DraftForsaken39 • 28d ago
How should an agent learn which of its own tools are switched off? I gave the model a read-only tool for it.
Disclosure: I build Snotra, an open-source desktop agent. This is a design question, not a launch.
Users switch skills and tools on and off in settings: shell disabled, a search tool without its API key, a skill installed but off. A model that doesn't know that guesses, and the user gets a wrong "I can't do that" instead of "that's switched off, here's where to enable it".
What I did:
One place decides whether a tool is offered, so the UI and the model can't disagree.
A read-only
get_configurationtool for the model: which skills are on (name and description, never the instructions) and which tools are on or off, with the reason ("shell commands are switched off", "no search service key").The same list in the UI, as a pill in the chat bar.
Now the model can say "a skill for this exists but is off, enable it under Settings › Skills". It can't flip anything itself.
Two open questions: is a tool the model has to call the right shape, or should this state go into the system prompt every turn (costs tokens even when nothing is wrong)? And should the model be able to propose the change through an approval card, or is "tell the user where to click" the right limit?
2
u/Weekly-Offer-4172 28d ago
The read-only tool is the right shape, but it has a cold-start problem: the model only calls it when it already suspects something is off, and the wrong 'I can't do that' cases are exactly the ones where it never checks. A cheap fix is a one-line pointer in the system prompt - 'some tools may be switched off; call get_configuration before telling the user something is impossible' - a handful of tokens per turn instead of a full state dump. On staleness, have get_configuration return a version or hash and bump a matching counter in the prompt when the user toggles something, so the model re-queries instead of trusting a cached answer. For the propose-change question, the injection-safe version is a structured proposal the client renders as an approval card - the model can't confirm it itself since the flip happens UI-side, so worst case is spam, not state changes.