Skip to content

Conversation

@BouquetAntoine
Copy link

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

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.
@Tarquinen
Copy link
Collaborator

Tarquinen commented Jan 20, 2026

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 lib/messages/utils.ts:

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

@BouquetAntoine
Copy link
Author

Will retry that tomorrow and will double check the version + clear opencode cache
It makes my agents crazy as they don't understand why they are calling a tool that doesn't exists 😅

@Tarquinen
Copy link
Collaborator

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 tool: "", not sure yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants