-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: introduce registry for tool handlers and schemas #779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I have read the CLA Document and I hereby sign the CLA |
All contributors have signed the CLA ✍️ ✅ |
Please make it possible to disable the built-in shell tool. Codex is often very inefficient with generic shell commands + it's difficult to make them unavailable otherwise (ex: by removing them from $PATH). |
Thanks, that’s a great point. I’ll follow up with a separate PR to make the default tool registration optional — possibly via an env var or config hook. |
What
This PR refactors tool dispatch to use a centralized, registry-based system.
registerTool
,getToolHandler
)FunctionTool
)container.exec
)shell
tool definition and handler into standalone modulesregisterDefaultTools()
to cleanly register built-in toolsAgentLoop
with dynamic lookupWhy
Previously, tool execution was hardcoded inside
agent-loop.ts
, limiting extensibility. This change lays the foundation for modular and plugin-based tooling, while preserving existing behavior.How
tool-registry.ts
to track tool schemas and handlersshell
is now first-class tool registered by defaultAgentLoop
to callgetToolHandler()
instead of matching on tool nameThis prepares Codex CLI for easier tool extension while preserving existing functionality.