Remove context_info tool references from system prompts#297
Remove context_info tool references from system prompts#297BouquetAntoine wants to merge 1 commit intoOpencode-DCP:masterfrom
Conversation
The mentions of context_info tool were confusing LLMs into thinking they had access to this tool and attempting to call it. The information about prunable tools is now described as simply "provided by the environment" without mentioning the internal tool name.
|
This issue you're experiencing existed prior to the information about context_info being added to the prompt, which was just released last night from #283, I suspect you may not have been on latest version. LLMs were getting confused by context_info because of a synthetic tool that gets injected containing information about what is available for pruning, the tool looks like this, found in info: baseInfo,
parts: [
{
id: SYNTHETIC_PART_ID,
sessionID: userInfo.sessionID,
messageID: SYNTHETIC_MESSAGE_ID,
type: "tool",
callID: SYNTHETIC_CALL_ID,
tool: "context_info",
state: {
status: "completed",
input: {},
output: content,
title: "Context Info",
metadata: {},
time: { start: now, end: now },
},
...(toolPartMetadata && { metadata: toolPartMetadata }),
},
],So, regardless of whether your change removes the context_info information from the system prompt, the LLM will still see it from this tool. The exact changes you want to remove were designed to mitigate the issue you're experiencing. Let me know what you think |
|
Will retry that tomorrow and will double check the version + clear opencode cache |
|
yea thats an annoying issue, and was why I added the instructions in the system prompt for the LLM to specifically not use this tool. If thats not enough, there probably needs to be another solution, maybe the injected tool doesn't need a name, and can be just |
The mentions of context_info tool were confusing LLMs into thinking they had access to this tool and attempting to call it. The information about prunable tools is now described as simply "provided by the environment" without mentioning the internal tool name.
Even with smart models like Opus 4.5 Thinking or GPT 5.2 High agents were hallucinating that tool mulitple times per session