TL;DR
LLMs recommend deprecated APIs from their training data and hallucinate package names. Outdated knowledge is both a correctness and a supply-chain problem in the code a coding agent writes.
A documentation server helps only when the model knows when to call it, so a server whose instructions just list its tools needs a rule in the harness’s own instructions.
Model roles put strong models on planning and reviews and less capable ones on exploration and chores. Modern harnesses use decision models to pick the right reasoning effort for each request.
Every documentation snippet, search result and fetched page is third-party input for the agent’s context. Search query can leak code to third-party services. Choose external tooling consciously.
Coding agents choose APIs, versions and packages from what their model saw in training. That knowledge ends at the training cutoff, and in practice it’s even older, because much of the public code in the training data still used older APIs. In a study presented at ICSE 2025, 7 models completed 28,125 prompts that called 145 deprecated APIs or their replacements in 8 Python libraries, and 25% to 38% of their plausible completions used the deprecated version. The authors trace this to deprecated usages in the training data and to the missing knowledge about deprecations when the model generates code.
Package names are even worse. A paper at USENIX Security 2025 generated 576,000 code samples with 16 models, and 19.7% of the 2.23 million packages the models recommended didn’t exist, with at least 5.2% for commercial models. An attacker can register such a name on PyPI or npm, which the authors describe as a form of package confusion attack. Both studies tested models that are a few generations old, and current models likely do better, but the cause, a fixed training cutoff, did not vanish.
So what a model lacks is up-to-date or proprietary knowledge. The current part is something that dedicated services can bring into the harnesses: documentation servers like Context7, questions about public repositories via DeepWiki and proper agentic web search via Exa AI or Brave Search. The other lever is which model does which work. I use Oh-My-Pi (OMP) as my local coding agent harness, and the examples below come from my configuration. MCP servers and web search work similarly also in other harnesses.
Documentation Servers Over MCP: Context7 and DeepWiki #
Context7 from Upstash indexes the documentation of libraries, frameworks and CLI tools and returns the snippets that match a question. DeepWiki from Cognition answers questions about public GitHub repositories from a generated wiki, which helps with projects whose own documentation is thin. Both run as remote MCP servers, and OMP loads the servers in my user-level mcp.json in every project:
{
"mcpServers": {
"context7": {
"type": "http",
"url": "https://mcp.context7.com/mcp",
"headers": { "Authorization": "Bearer <my Context7 API key>" }
},
"deepwiki": {
"type": "http",
"url": "https://mcp.deepwiki.com/mcp"
}
}
}DeepWiki is free and needs no account. Context7 also works without a key, but an API key gives higher rate limits.
Context7 answers in two steps: the agent resolves a library name to a Context7 ID, then asks a question about that library. Here is a sample lookup from one of my sessions, in which the agent checked how actions/upload-artifact treats hidden files:
mcp__context7_query_docs /actions/upload-artifact 'v4 hidden files excluded include-hidden-files true artifact paths hidden directories'### Uploading Hidden Files with include-hidden-files
Source: https://github.com/actions/upload-artifact/blob/main/README.md
Shows how to enable hidden file uploads and exclude specific sensitive files using the path input.
```yaml
- uses: actions/upload-artifact@v7
with:
name: my-artifact
include-hidden-files: true
path: |
path/output/
!path/output/.production.env
```
--------------------------------
### Uploading Hidden Files
Source: https://github.com/actions/upload-artifact/blob/main/README.md
By default, hidden files are ignored by this action to avoid unintentionally uploading sensitive information.The response quotes the action’s README, enriches my agents context with the most up-to-date information and helps a model that potentially learned an older version of the action to verify its behavior. Each snippet names its source, so the agent can open the original when the excerpt isn’t enough.
Of course there can be cases where Context7 has no answer. As usual, having fallbacks in form of alternative tooling or dedicated web search capabilities available can improve coverage, but requires additional caretaking.
Telling the Agent When to Use Each Server #
A connected tool only helps when the model knows when to call it. OMP lists every MCP command in a section of the system prompt and also adds each server’s own instructions in a dediated section. Context7’s instructions say when to use the server:
Use this server to fetch current documentation whenever the user asks about a library, framework, SDK, API, CLI tool, or cloud service … Prefer this over web search for library docs.
DeepWiki’s instructions on the other hand, list its tools but they never say which questions should go to DeepWiki. With multiple documentation tools connected, some guidance on which tool answers which question can steer the model into the right direction. In OMP, such rules belong in ~/.omp/agent/RULES.md: task subagents drop every AGENTS.md file but still receive RULES.md, and OMP hands them the parent’s MCP connections.
## Choosing documentation tools
- Use Context7 for public APIs, configuration, and version-specific usage.
- Use DeepWiki (`ask_wiki_question`) for architecture or implementation questions about an unfamiliar, indexed GitHub repository when the source isn't already available locally. Use `read_wiki_structure` for a broad overview.
- For the current checkout, inspect local code first. Treat DeepWiki answers as leads, and verify details that matter against the relevant source revision.The first two rules split the work: Context7 for how to use a library, DeepWiki for how an unfamiliar repository is built. The third keeps the agent’s own checkout as the primary source, because a generated wiki can describe another revision than the one the agent works on. The same file would also fit a rule for the package problem from the opening, such as checking that a new dependency exists before the agent adds it.
Web Search With Exa and Brave as a Fallback #
For what no documentation index covers, such as error messages, issue threads, release notes and security advisories, OMP has a built-in web_search tool. The web model role selects its engine, and retry.fallbackChains.web lists the engines OMP tries when the first one fails:
modelRoles:
web: web/exa
retry:
fallbackChains:
web:
- web/braveweb/exa is Exa. I’m logged in to Exa in OMP, so my queries go to Exa’s search API under my account. Without a credential, OMP would fall back to Exa’s public MCP endpoint, which needs no account. Brave takes over when Exa fails and reads its key from BRAVE_API_KEY. My explicit chain also replaces OMP’s built-in fallback list.
Picking a Model for Each Role #
Last but not least, I am a model roles poweruser OMP’s model roles map each kind of work to a model and, after the colon, a thinking level. Mine currently look like this:
modelRoles:
default: openrouter/openai/gpt-6.2-sol
plan: openrouter/anthropic/claude-opus-5.5:high
slow: openrouter/openai/gpt-6.2-astra:medium
task: openrouter/openai/gpt-6.2-sol:auto
smol: openrouter/deepseek/deepseek-v4.1-flash-1017:auto
tiny: openrouter/z-ai/glm-5.3-flash:auto
advisor: openrouter/anthropic/claude-opus-5.5:medium
security: openrouter/deepseek/deepseek-v4.1-flash-1017:xhigh
defaultThinkingLevel: autodefaultis the model I talk to, so it gets the strongest model I can afford for everyday turns, GPT-6.2 Sol for me.plandrives OMP’s plan mode, andslowruns the bundledreviewersubagent. Both decide what the code should look like, so they get a strong reasoning model, GPT-6 Astra in my case.taskruns delegated subagents that edit code with full tool access. It can make sense to keep them on the main model, as my config does.smolruns the bundledscout, which explores a codebase, andsonic, which does mechanical updates and data collection. That work usually doesn’t need a frontier model, so a fast and cheap model like DeepSeek V4.1 Flash fits.tinyhandles background chores such as session titles and the labels of subagent tasks, where the smallest usable model is enough.advisoris the model of OMP’s default advisor. I run several advisors with their own models, which I describe in the article on my advisors.
The judge role runs small typed decisions, such as ranking files for OMP’s find tool and the difficulty classifier behind the auto thinking level. I use TypeSafe’s Jev 1.14 decision model through OpenRouter for it. Other decision models, such as Liquid AI’s d1 or OpenAI’s Decisions models, can take the role too.
The auto level is why many of my roles carry no fixed effort. Before a request, OMP asks the judge how open-ended the problem is: a rename with the target given gets low, a failing test with a few candidate causes medium, a choice between several designs high, and flaky, concurrent behaviour xhigh. For a subagent, the judge reads the delegating agent’s description of the problem instead of the prompt. OMP clamps the answer to the levels the model supports, and providers.autoThinkingMaxEffort caps it at xhigh by default, so only an explicit ultrathink reaches max. The beauty of this is that a rename doesn’t pay for the reasoning of a race condition. I keep fixed levels where the work is predictable: planning always gets high, reviews and advisors get medium, and the security role xhigh.
Custom Roles Such as a Security Model #
OMP accepts role names of its own in modelRoles, and security is one of mine. A custom role becomes more useful when agents use it on their own. OMP bundles a read-only security-reviewer subagent that names no model, so it would run on the task role. But of course you can customize almost anything and an explicit task.agentModelOverrides assigns a model to a subagent by its name, and with this entry every security review my agent delegates goes to the security model I configured:
task:
agentModelOverrides:
security-reviewer: "@security"The same pattern fits any work that a specialized model does better, while the built-in vision and commit roles already cover screenshots and commit messages.
Prompt Injection & Exfiltration Risks #
Every Context7 snippet, search result and fetched page enters the agent’s context as text that someone else wrote, and the agent acts on it with the tools it has available. A README written for prompt injection reaches the model through the same path as a correct migration guide. That is one more reason why the agent itself needs a sandbox that limits which files and hosts its commands can reach.
Search queries that my agents sends to any of the connected thirdparty tools, can leak the code and proprietary knowledge as well. Make sure to add thirdparty tooling consciously and avoid quiet fallbacks to services you don’t want to engage with. In context of OMP, I suggest to set providers.webKeyless: false, so it skips public search services.