Repository navigation
Description
Summary
The CLI ships a built-in Github tool (internal/agent/tools/github.go, registered in internal/agent/tools/registry.go when tools.github.enabled, which defaults to true). It overlaps the gh CLI but is worse in practice, and should be removed in favor of standardizing on gh via the Bash tool:
- Models misuse its schema. It multiplexes 8 operations behind a single
resourceparameter, each with its own required fields, so models routinely omit them. From the@inferrun on theinference-gateway/inference-gatewayrepo, PR 317:(cf. [BUG] DeepSeek calls the Github tool repo parameter just with the org name #274, [FEATURE] Make it simple to fetch github issues deterministically #280 - prior reports of the model calling this tool incorrectly.)Github: issue_number parameter is required for fetching a specific issue Github: head parameter is required for creating a pull request - Separate, fragile auth. It authenticates from a configured
%GITHUB_TOKEN%rather than theghcredential chain, producingGithub: GitHub API error (403): Resource not accessible by integrationwheregh- already on PATH and authenticated in CI - just works. - Redundant.
ghcovers the same surface (issues, PRs, comments, raw API) with better ergonomics and far clearer error messages.
Acceptance Criteria
- Remove the built-in
Githubtool: deleteinternal/agent/tools/github.goand its registration ininternal/agent/tools/registry.go; droptools.github.*from the default config (config/config.go). If a deprecation window is preferred, stage as default-off then removal. - The default system prompt instructs the model to use the
ghCLI (via Bash) for all GitHub operations - issues, PRs, comments, API - and no longer references a built-in Github tool. Add this inaddSystemPrompt()/ the prompt assembly (internal/agent/agent_utils.go,config/prompts.go). - The default Bash whitelist allows the non-destructive
ghoperations the agent now needs out of the box: read-onlygh,gh issue create|edit|comment,gh pr create, andgh api(GET). TodayIsBashCommandWhitelisted(config/config.go) contains noghat all, so removing the tool without this leaves the agent unable to touch GitHub. Keep destructive operations (gh pr merge,gh repo delete, ...) out of the default. - Also whitelist the common, non-risky introspection commands the agent reaches for and that are denied today:
env,printenv. - Docs and changelog updated. Note this is a breaking change (the
tools.githubconfig block is removed); a matching[DOCS]ticket againstinference-gateway/docsshould accompany the implementing PR.
Activity
feat!: remove built-in Github tool in favor of the gh CLI
refactor: remove built-in Github tool in favor of the gh CLI (#572)
inference-gateway-releaser commentedon Jun 1, 2026
🎉 This issue has been resolved in version 0.117.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀