Skip to content

feat(tools): allow registering custom tools in any language - #1372

Merged
edenreich merged 16 commits into
mainfrom
feat/custom-tools
Sep 28, 2026
Merged

edenreich merged 16 commits into
mainfrom
feat/custom-tools

Conversation

@edenreich

@edenreich edenreich commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #1366. Users add tools written in any language with one YAML manifest per tool. A custom tool works like a built-in: the model sees it, it runs through !!Name(arg="v") and infer tools execute, and it follows the same agent modes and approval flow.

  • Where tools load from:
    • User tools come from ~/.infer/tools/, or tools.custom_dir / INFER_TOOLS_CUSTOM_DIR.
    • Project tools come from the working directory's .infer/tools/ and .agents/tools/.
    • They merge. On a name clash the project tool wins, and .infer/tools/ wins over .agents/tools/.
    • Running infer from home, where .infer/tools is the user directory, keeps those tools trusted as user tools.
  • Manifest: the built-in tool manifest from refactor(tools): define built-in tools through embedded manifests #1369 plus command, timeout (default 30s) and enabled.
    • It is strictly decoded, so read_only: or a typo fails loudly. The file name must match name.
    • An omitted require_approval inherits tools.safety.require_approval.
    • An omitted modes hides the tool in plan and readonly, like an MCP tool.
  • Project tools always need approval: a repository supplies them, so require_approval: false in a project manifest is ignored. Every call asks, even in readonly mode (which otherwise runs its tools unapproved), except in auto mode.
    • This is implemented as a CallApprover that only asks in the tool's own modes, so plan mode still refuses an out-of-mode call with "tool not allowed" rather than an approval request.
  • The file tools never edit tool directories: Write, Edit, MultiEdit and Delete refuse any path inside ~/.infer/tools, tools.custom_dir, .infer/tools or .agents/tools, so the model cannot write itself a tool that skips approval.
    • The check resolves symlinks and ignores case, so a link or another spelling on a case-insensitive filesystem doesn't get around it.
    • It sits in Config.ValidatePathInSandboxWrite, so it applies regardless of tools.sandbox.protected_paths, including existing configs.
  • A call:
    • No shell.
    • The arguments are validated against parameters before the process starts, then written to stdin as one JSON object.
    • Exit 0 returns stdout as the result. A non-zero exit returns stderr (or stdout) as the error.
    • On timeout or turn cancel the whole process group is killed on Unix, so children of a script die too. Windows kills the direct child.
    • Capture is bounded, and tools.max_result_bytes caps what the model sees.
  • Names: a manifest is skipped with a logged warning when it takes the name of a built-in tool of any context (agent, a2a, browser, computer) or starts with MCP_.
    • Built-in names are checked even for tools config switches off, and compared case-insensitively.
    • Each context exposes ToolNames() for this.
  • Policy for free: the custom Tool implements ManifestTool, so per-mode tool lists, the ExecuteTool mode guard, !! autocomplete and StandardApprovalPolicy need no changes or name lists.
  • Registration: the container registers custom tools before Markdown subagents load, so .infer/agents/*.md may list them. tools.enabled: false turns them off with the other local tools.
  • Shared validation: the MCP argument checks move to agentdomain.ValidateArguments, used by MCP and custom tools. It also accepts required as []string, which a parsed manifest produces and the old MCP copy silently skipped.
  • Example: examples/tools runs offline against a tokenless mock model scripted in scenarios.yaml.
    • It has one tool of each kind: WordCount (Python user tool, read-only, no approval) and SaveNote (shell project tool in .agents/tools/).
    • A Taskfile runs each scenario: task word-count, task save-note (blocked in headless), task save-note:auto, task save-note:plan, task execute, task chat.
  • Package: custom tools live in internal/tools/custom (imported as customtools), the start of a tools bounded context that the agent consumes. Moving the built-in tools and the registry from internal/agent/tools into it is the follow-up [TASK] Refactor the tools into their own bounded context #1373.
  • Language stats: .gitattributes marks examples/** as vendored. The existing tests/mocks rule named a directory, which gitattributes never applies to the files inside it, so it becomes tests/mocks/**.

Commits

  1. refactor(tools): DecodeToolManifest (strict decode for a type embedding ToolManifest inline) and ValidateArguments in the shared kernel. MCP uses the latter.
  2. feat(tools): the custom tools package (loader, runner, process-group kill), tools.custom_dir, ToolNames() per context, mcpdomain.ToolNamePrefix, container wiring.
  3. docs: docs/custom-tools.md, plus links from the README, the tools and configuration references, the directory structure and AGENTS.md.
  4. style(tools): YAML arrays as block lists in docs and test manifests.
  5. Review suggestion: drop the trailing comment on ToolsConfig.CustomDir.
  6. docs(examples): the tokenless-driven example and an e2e test that runs its scenarios.
  7. chore: .gitattributes for examples and mocks.
  8. docs(examples): rename to examples/tools and add the Taskfile.
  9. feat(tools): refuse file-tool writes into custom tool directories.
  10. feat(tools): load project tools from .infer/tools and .agents/tools, which always need approval.
  11. docs(examples): ship SaveNote as a project tool.
  12. refactor(tools): move custom tools from internal/customtools to internal/tools/custom.

Testing

  • internal/tools/custom:
    • loading and every skip case: unknown field, invalid YAML, file name mismatch, built-in name in any case, a disabled built-in, MCP_, missing command, negative timeout, enabled: false, missing directory;
    • project/user merge and precedence, and the home directory staying trusted;
    • success via stdin/stdout, non-zero exit with stderr, the stdout fallback, invalid arguments never starting the process;
    • a timeout that also kills a child process the script started (the test fails with the group kill disabled);
    • cancel;
    • mode listing and plan-mode refusal, and approval inheriting or overriding the global setting, through the real registry, LLMToolService and StandardApprovalPolicy;
    • project tools needing approval in standard, readonly and plan mode despite require_approval: false, and not in auto.
  • config: the write block for .infer/tools, .agents/tools, tools.custom_dir, the directory itself, another spelling and a symlink, while sibling and project files stay writable. The symlink and case cases each fail with their guard removed.
  • agentdomain: ValidateArguments table, including required as []string and []any, and DecodeToolManifest with an inline extension. Built-in manifests still reject command. The existing MCP tests pass unchanged.
  • e2e: TestCustomToolsExample runs the example's scenarios against the built binary: WordCount runs, the project tool SaveNote is blocked headless, runs in auto and is refused in plan. The full e2e suite passes.
  • go test -race ./... and task precommit:run pass. The tool-definitions golden file is unchanged.
  • Smoke with the built binary:
    • every example task behaves as its README says;
    • infer tools execute Write into .agents/tools/ is refused even with --approved;
    • a custom Read.yaml and a manifest with read_only: are skipped with warnings while the built-in Read keeps working.

Not included

  • The rest of the tools bounded context: moving internal/agent/tools into internal/tools and cutting its dependency on the agent context is [TASK] Refactor the tools into their own bounded context #1373.
  • infer export builds its own tool registry without custom tools, so their results in exports use the default formatting.
  • The Bash tool is not covered by the write block. In auto mode it can run any command, as it already can for .env files.
  • A project's .infer/config.yaml is trusted like the user's own and can set tools.custom_dir, the Bash allow-list and the approval settings. The docs say to review it in repositories you don't trust.
  • From the issue's out-of-scope list: distribution via infer plugins, structured or streaming results, and a stdio MCP transport.
  • Docs follow-up: [DOCS] Document custom tools in the CLI docs#850 (a new cli-custom-tools.md, plus cli.md and mcp.md).

DecodeToolManifest lets a manifest type embed ToolManifest inline and add
fields of its own while keeping the strict decode, schema normalization and
validation. ValidateArguments moves the MCP argument checks into the shared
kernel and also accepts `required` as []string, which a parsed manifest
produces and the MCP copy silently skipped.
Each <Name>.yaml manifest in tools.custom_dir (default ~/.infer/tools,
env INFER_TOOLS_CUSTOM_DIR) becomes a tool: the built-in manifest schema
plus command, timeout and enabled. A call runs the command without a shell,
writes the arguments to stdin as JSON and returns stdout. A non-zero exit
returns stderr as the error, and a timeout or cancel kills the process group
on Unix.

Custom tools return their manifest, so modes, approval, !! autocomplete and
the plan-mode guard work as for built-ins. A manifest that is invalid, takes
a built-in name (even of a disabled tool, case-insensitively) or the MCP_
prefix is skipped with a warning. They register before Markdown subagents
load, so a subagent may list them.
Adds docs/custom-tools.md with a shell and a Rust example, and links it from
the README, the tools and configuration references, the directory structure
and AGENTS.md.
@edenreich
edenreich requested a review from a team as a code owner September 28, 2026 01:14
Comment thread config/config.go Resolved
examples/custom-tools ships WordCount (Python, read-only, no approval) and
SaveNote (shell, needs approval) with a scenarios.yaml that scripts the
embedded mock model, so it runs offline with no API key. The README walks
through a tool that runs, one blocked for approval in headless, auto mode and
plan mode. An e2e test runs the same scenarios so the example stays true.
Marks examples/** as vendored. The tests/mocks rule named the directory,
which gitattributes never applies to the files inside it, so it becomes
tests/mocks/** and the counterfeiter fakes finally count as generated.
… add a Taskfile

The Taskfile sets the mock model's environment and runs each scenario as one
task (word-count, save-note, save-note:auto, save-note:plan, execute, chat),
so trying the example is `task <scenario>`. INFER points it at a local build.
Write, Edit, MultiEdit and Delete now refuse any path inside a directory
custom tools load from: ~/.infer/tools (or tools.custom_dir), .infer/tools
and .agents/tools. The check resolves symlinks and ignores case, so the model
cannot write itself a tool that skips approval through a link or another
spelling of the path. It applies regardless of tools.sandbox.protected_paths.
…tools

Custom tools now also load from the working directory's .infer/tools and
.agents/tools and merge with the user's. On a name clash the project tool
wins, and .infer/tools wins over .agents/tools. A repository supplies project
tools, so every call needs approval whatever the manifest says, readonly mode
included, except in auto mode. A project directory that is the user's own
directory (infer run from home) stays trusted.
The example now has one tool of each kind: WordCount as a user tool in
user-tools/ (via INFER_TOOLS_CUSTOM_DIR) and SaveNote as a project tool in
.agents/tools/, which always needs approval. The e2e test copies the project
tools into each run's working directory.
internal/tools becomes the home of the tools bounded context, which the
agent consumes. Custom tools move there first. The built-in tools and the
registry in internal/agent/tools follow in a separate refactor.
@edenreich

Copy link
Copy Markdown
Contributor Author

@infer Can you review this PR? is it ready for merge? use /ponytail:ponytail-review /go /go-concurrency /domain-driven-design /clean-code /clean-architecture

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Model: ollama_cloud/glm-5.3-flash · View Job

Todos

  • Read full diff of PR feat(tools): allow registering custom tools in any language #1372 (git diff origin/main...HEAD)
  • Review internal/tools/custom package (loader, runner, process handling) for Go/concurrency issues
  • Review agentdomain changes (tool_manifest, ValidateArguments, DecodeToolManifest)
  • Review config/sandbox write-block and container wiring (DDD/clean-architecture)
  • Review mcp changes, docs, examples, e2e test
  • Over-engineering pass (ponytail-review)
  • Compose final review with verdict and findings JSON

Pull Request

#1372

✅ Infer Result: Success

All review steps are complete. Here is my final review.


Review: PR #1372 - feat(tools): allow registering custom tools in any language

Verdict: ready to merge. I read the full diff and cross-checked the wiring (registry, approval policy, tool contracts, container), and I ran the tests myself: go test on internal/tools/custom, internal/agent/domain, config and internal/mcp all pass, and go test -race ./internal/tools/custom/... passes. The 3 pending CI checks (postgres, e2e, test) were still running at review time. The findings below are minor hardening notes, none blocking.

What is done well

  • Security model is sound: no shell, arguments validated against the manifest schema before the process starts and passed as one JSON object on stdin, capture bounded by ring buffers, bounded WaitDelay, and the whole process group killed on timeout/cancel on Unix. Project tools always require approval (a CallApprover consulted ahead of the mode in StandardApprovalPolicy), so even readonly mode asks, while plan mode correctly refuses with "tool not allowed" instead of an approval prompt. The file tools are blocked from writing into any tool directory, resolving symlinks and ignoring case.
  • Policy for free (clean-architecture): implementing ManifestTool means per-mode listing, the ExecuteTool mode guard, !! autocomplete and StandardApprovalPolicy work with zero changes to the agent core. That is the right seam; the registry's RegisterTools needed nothing.
  • Shared kernel (DDD): moving the MCP argument checks into agentdomain.ValidateArguments is a genuine deletion of duplication, and it also fixes the old MCP copy silently skipping required as []string. DecodeToolManifest keeps the strict decode in the shared kernel with a minimal inline-extension API. mcpdomain.ToolNamePrefix removes the one hard-coded literal.
  • Boundaries: the internal/tools/custom context consumes only agentdomain contracts plus the same agentinfra.BaseFormatter that MCPTool already embeds; the temporary cross-context import is explicitly tracked in [TASK] Refactor the tools into their own bounded context #1373. Composition-root wiring in the container is minimal and registers custom tools before Markdown subagents load, as described.
  • Idiomatic Go / clean code: cmp.Or, slices.Backward/ContainsFunc/Collect, maps.Keys, errors.Is on the ctx error, table-driven tests everywhere, intent-revealing names (loadDir, resolveCommand, isReserved, killProcessGroupOnCancel, projectTool), no comment smell, and the deliberate 1 MiB capture ceiling is marked with a ponytail: comment naming its upgrade path, as the house style requires.
  • Concurrency (go-concurrency): no goroutine leaks - the exec pipe copiers are bounded by WaitDelay, the ring buffers are mutex-guarded with one writer goroutine each, and Cancel only ever runs after Start so cmd.Process is non-nil. The TestTool_ExecuteTimeoutKillsTheProcessGroup test genuinely verifies the child dies (it fails with the group kill disabled).
  • Docs and examples: docs/custom-tools.md matches the implementation on every claim I cross-checked (command resolution rules, stdin/stdout contract, group kill, max_result_bytes, approval matrix, name-collision rules, write-block, Bash caveat). The example's word-count math checks out and the e2e test drives every documented scenario offline.

ponytail-review (over-engineering scan)

Nothing worth cutting. The runtime code is ~350 lines including the formatter glue the Tool interface requires, process_other.go is the standard build-tag pattern for Windows, realPath in config has no stdlib equivalent (it resolves symlinks through a not-yet-existing final component), and the four 3-line ToolNames() wrappers are the cheapest way to expose reserved names per context. Lean already - net: -0 lines possible.

Minor notes (non-blocking)

  1. run() error precedence can mislabel a successful call as "timed out" (and, symmetrically, can mask a non-zero exit as success). If the command exits 0 but Wait returns after the deadline fires - for example a grandchild that kept the pipes open through the 1s pipeGrace, or the group kill landing after the direct child already exited 0 - the switch checks ctx.Err() first and reports "timed out after 30s", discarding the captured result. Conversely, Wait returns ErrWaitDelay in place of the exit status when a grandchild holds the pipes, so a command that exits non-zero in that situation is currently reported as success. Checking the actual exit status first fixes both directions; the inline suggestion shows the reorder.
  2. The user/project directory identity check is textual (manifest.go:38): a symlinked or case-differing alias of the user's tools dir would load the same manifests twice, with the project load winning and flipping the user's own no-approval tools to always-approval. The failure direction is safe (over-asking, never silently trusting), and the write-block already resolves symlinks and folds case, so the two checks simply disagree - normalizing both the same way (or riding the [TASK] Refactor the tools into their own bounded context #1373 refactor) would align them.
  3. loadDir ignores the filepath.Glob error (manifest.go:52): a tools directory whose absolute path contains glob metacharacters (an unmatched [, for instance) matches nothing and silently loads zero tools with no warning - the one skip path this PR leaves quiet while every other skip case warns loudly. Reading the directory (or logging the glob error) would keep the "fails loudly" promise for that case too.

Everything else - the strict manifest decode, name-collision guards, ValidatePathInSandboxWrite write-block (including the symlink and case tests that fail when their guard is removed), the MCP refactor, the shared validation tests, and the offline example/e2e - is solid and well tested.

Model: ollama_cloud/glm-5.3-flash · Exit Code: 0 · Duration: 9m 19s

Tokens: 1,582,017 in · 34,738 out · 1,616,755 total (19 requests)

Tool calls: 40 total · 100% success rate

Traces
Session: 1790561092-c75ed4e0

session (headless, success)                                                                        9m11s
├── chat ollama_cloud/glm-5.3-flash                                                                12.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       8.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     8.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             8.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 8.2s
├── execute_tool Read call_1w6gfwt7                                                                210µs
├── execute_tool Read call_q4zvosu4                                                                166µs
├── execute_tool Read call_spoyf4e9                                                                214µs
├── chat ollama_cloud/glm-5.3-flash                                                                 2.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.4s
├── execute_tool Read call_u02678bf                                                                254µs
├── execute_tool Read call_392wfvgg                                                                253µs
├── execute_tool Read call_r8s265z0                                                                243µs
├── chat ollama_cloud/glm-5.3-flash                                                                 5.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.4s
├── execute_tool TodoWrite call_9wpdsigp                                                            70µs
├── execute_tool Bash call_hn1ojn2q                                                                 10ms
├── chat ollama_cloud/glm-5.3-flash                                                                 4.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.8s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.8s
├── execute_tool Read call_xarcdgpi                                                                190µs
├── execute_tool Read call_vgjrjzuy                                                                208µs
├── execute_tool Read call_qd5j2iq1                                                                252µs
├── execute_tool Read call_cz228kaf                                                                317µs
├── chat ollama_cloud/glm-5.3-flash                                                                42.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      42.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    42.6s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            42.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                42.6s
├── execute_tool Bash call_80eh8g9e                                                                  6ms
├── chat ollama_cloud/glm-5.3-flash                                                                14.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      14.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    14.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            14.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                14.9s
├── execute_tool Bash call_vc1kudhx                                                                  6ms
├── execute_tool Read call_b8kay7nc                                                                205µs
├── chat ollama_cloud/glm-5.3-flash                                                                 4.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.0s
├── execute_tool Read call_3eryifwo                                                                266µs
├── execute_tool Read call_he1u6irw                                                                256µs
├── chat ollama_cloud/glm-5.3-flash                                                                 3.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.3s
├── execute_tool Read call_6e4z8o7n                                                                173µs
├── execute_tool Read call_tafpew96                                                                279µs
├── execute_tool Read call_5r6gz3bt                                                                207µs
├── chat ollama_cloud/glm-5.3-flash                                                                18.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      18.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    18.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            18.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                18.1s
├── execute_tool TodoWrite call_x90xqr29                                                            75µs
├── execute_tool Bash call_r8yyshuh                                                                  5ms
├── chat ollama_cloud/glm-5.3-flash                                                                12.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      12.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    12.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            12.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                12.2s
├── execute_tool Read call_pf9y47cy                                                                230µs
├── execute_tool Bash call_l08s78nm                                                                  4ms
├── chat ollama_cloud/glm-5.3-flash                                                                 6.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.0s
├── execute_tool Grep call_11amj2m9                                                                  2ms
├── execute_tool Grep call_q7b52fwh                                                                795µs
├── chat ollama_cloud/glm-5.3-flash                                                                 1m6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1m6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1m6s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1m6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1m6s
├── execute_tool Read call_28tqv86e                                                                319µs
├── execute_tool Read call_u2pkplxj                                                                371µs
├── execute_tool Read call_ibbi9ocr                                                                219µs
├── execute_tool Read call_5kf8hc5r                                                                376µs
├── execute_tool Read call_8kgylwb5                                                                107µs
├── execute_tool Read call_f15sbmoy                                                                137µs
├── chat ollama_cloud/glm-5.3-flash                                                                50.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      50.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    50.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            50.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                50.1s
├── execute_tool Grep call_6s4fhk4c                                                                775µs
├── execute_tool Read call_9ihl0xft                                                                220µs
├── chat ollama_cloud/glm-5.3-flash                                                                 5.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.7s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.7s
├── execute_tool Bash call_59qn4sya                                                                  7ms
├── execute_tool Bash call_xma3chk5                                                                59.0s
├── chat ollama_cloud/glm-5.3-flash                                                                 3.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.1s
├── execute_tool Bash call_yzngw081                                                                1m11s
├── execute_tool Grep call_ho02hk2f                                                                437µs
├── chat ollama_cloud/glm-5.3-flash                                                                42.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      42.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    42.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            42.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                42.3s
├── execute_tool Read call_bckulqk7                                                                237µs
├── chat ollama_cloud/glm-5.3-flash                                                                1m22s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      1m22s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    1m22s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            1m22s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                1m22s
├── chat ollama_cloud/glm-5.3-flash                                                                 5.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.8s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.8s
├── execute_tool TodoWrite call_hi2qxfo5                                                            74µs
╰── chat ollama_cloud/glm-5.3-flash                                                                34.5s
    ╰── POST /v1/chat/completions [inference-gateway, server]                                      34.4s
        ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    34.4s
            ╰── POST /proxy/:provider/*path [inference-gateway, server]                            34.4s
                ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                34.4s
Stats
Tool Calls

╭───────────┬───────┬───────┬─────────╮
│ Tool      │ Calls │ Fail% │ Avg     │
├───────────┼───────┼───────┼─────────┤
│ Read      │ 25    │ 0%    │ 222µs   │
│ Bash      │ 8     │ 0%    │ 16307ms │
│ Grep      │ 4     │ 0%    │ 1ms     │
│ TodoWrite │ 3     │ 0%    │ 70µs    │
╰───────────┴───────┴───────┴─────────╯

Token Usage

╭────────────────────────────┬─────────┬─────────┬────────────┬─────────┬──────╮
│ Model                      │ Prompt  │ Cached  │ Completion │ Total   │ Cost │
├────────────────────────────┼─────────┼─────────┼────────────┼─────────┼──────┤
│ ollama_cloud/glm-5.3-flash │ 1582017 │ 1214080 │ 34738      │ 1616755 │ -    │
╰────────────────────────────┴─────────┴─────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

@inference-gateway-maintainer inference-gateway-maintainer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full review: #1372 (comment)

Comment thread internal/tools/custom/tool.go Resolved
Comment thread internal/tools/custom/manifest.go Resolved
Comment thread internal/tools/custom/manifest.go Resolved
A tools directory whose absolute path holds glob metacharacters (an unmatched bracket, say) matched nothing and silently loaded zero tools, the one quiet skip in the custom-tools story. List manifests with os.ReadDir so the path is treated as data rather than a pattern, keep missing directories silent and warn on anything else that prevents listing.
…ncel

The switch consulted ctx.Err() before the run error, so a call whose process had already exited 0 was reported as timed out when the deadline fired during the pipe-grace window, discarding its captured output. The exit status is now checked first, and a non-zero exit behind exec.ErrWaitDelay is reported as a failure instead of being masked as success.
The loader's user-vs-project identity check compared plain absolute paths while the write-block resolves symlinks and folds case, so a symlinked or case-differing alias of the user's tools dir loaded the same manifests twice and the project load won, flipping the user's own no-approval tools to always-approval. Export config.CanonicalPath, use it in isWithinCustomToolsDir and for the identity check, and test a symlinked project alias of the user dir.
@edenreich

Copy link
Copy Markdown
Contributor Author

@infer Review comments addressed. Can you review this PR again? is it ready for merge? use /ponytail:ponytail-review /go /go-concurrency /domain-driven-design /clean-code /clean-architecture

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Model: ollama_cloud/glm-5.3-flash · View Job

Todos

  • Read the full diff (git diff origin/main...HEAD)
  • Review core package internal/tools/custom (manifest, tool, process handling)
  • Review shared kernel changes (agent/domain/tool_manifest.go, mcp refactor)
  • Review config write-block and container wiring
  • Review tests, docs, examples, e2e
  • Run repo checks (build, vet, tests on touched packages)
  • Write final review with verdict + findings JSON

Pull Request

#1372

✅ Infer Result: Success

All checks pass and the tree is clean. My review is complete - here it is.

Review: ready to merge

Verdict: yes, this PR is ready to merge. I re-read the full diff against main, traced every integration point the new package touches, and ran the checks. No blocking findings; one optional polish below.

Previous review comments - verified addressed

  • 9b42f97 (package move): custom tools now live in internal/tools/custom per the AGENTS.md convention, the customtools alias is registered in the import-style doc, and nothing outside the composition root imports it.
  • 01ca099 (globbing): listManifests now uses os.ReadDir, so a directory name holding glob metacharacters can't break loading - covered by TestNewTools_MetacharacterDirectoryName.
  • 1848024 (exit status vs timeout): the Run() switch now rescues a self-exited exit-0 process out of the WaitDelay path before classifying as timeout/cancel - covered by TestTool_ExecuteKeepsARunThatFinishedDuringThePipeGrace.
  • aeb6099 (path identity): CanonicalPath (symlink-resolved longest-existing prefix + case fold) is used both by the file-tool write block and by the user/project directory dedup, with tests for the symlink alias, another spelling, and the "running from home stays trusted" case.

Checks run

  • go vet on internal/tools/custom, config, internal/agent/domain, internal/mcp, internal/container: clean.
  • go test and go test -race on those packages: pass, including the process-group kill, pipe-grace, cancel, and project-approval tests.
  • Integration verified by reading the consumers, not just the tests: StandardApprovalPolicy consults CallApprover ahead of the mode (approval_policy.go:58), so projectTool.RequiresApproval genuinely asks in standard/readonly/plan and stays silent only in auto; out-of-mode calls still hit the ExecuteTool mode guard ("tool not allowed") rather than an approval prompt; tools.enabled: false gates custom tools through the same llm_tool_service.go:29 flag as the other local tools; custom tools register before LoadMarkdownAgents, so they are in the known map and .infer/agents/*.md can list them; isReserved covers all four contexts' names case-insensitively plus the MCP_ prefix, so registration order can't shadow a built-in. Exec bits survive in git on the example scripts (rwxr-xr-x).

Skill assessments

Domain-driven design: 9/10. Ubiquitous language is consistent across code, docs, tests, and the PR (user tool / project tool / manifest / reserved name). The "project tools always need approval" invariant lives inside the projectTool type rather than scattered in the policy service, and per-mode/approval policy lives on the manifest aggregate, not in services. The one unsatisfied row (domain events) is genuinely not applicable here.

Clean architecture: 9/10 (6/7 rows). Dependencies point inward: internal/tools/custom consumes only the shared kernel contracts (agentdomain.Tool, ToolManifest, CallApprover, ManifestTool) plus the platform formatter; the registry and approval policy need zero changes because they already speak those interfaces - that is the Dependency Rule buying exactly what it promises. exec is confined to the custom package with a two-file platform split, and the container wires everything. The only N/A row is persistence.

Clean code: 9/10. Names carry intent, functions stay small, happy paths un-indented, table-driven tests with t.Run, doc comments short and comment-free bodies. Minor deductions only for the two nits below.

Go / go-concurrency: no findings. Modern stdlib throughout (slices.Backward, slices.ContainsFunc, slices.Concat, cmp.Or, maps.Clone, errors.Is); no goroutines spawned - process lifetime rides on exec.Cmd's own Cancel/WaitDelay machinery, the idiomatic choice; Tool is immutable after construction and per-call ring buffers keep Execute race-free.

ponytail-review: Lean already. Ship. Nothing to cut. The MCP validation dedup actually deletes 87 lines, the bounded-context move was correctly deferred to #1373 instead of speculative scaffolding, and every helper in the new package has a caller and a test.

Optional polish (non-blocking)

  1. tool.go:106-114 - residual race on the failure side of the exit-status fix: if a process self-exits non-zero before the deadline but a child keeps the output pipes open past it, Run returns ErrWaitDelay and the deadline case wins, so the model sees "timed out after 30s" instead of the real "exit status 3: boom". Guarding only ExitCode() > 0 (self-exited non-zero; signal-killed is -1) before the deadline case fixes it without breaking the genuine-timeout classification. Suggestion in the inline comment.
  2. tool.go:110 - the timeout error discards whatever the process printed before being killed. Including the captured stderr/stdout would give the model partial context, but this is debatable and fine either way.

Both are edge-case cosmetics; neither should hold up the merge.

Model: ollama_cloud/glm-5.3-flash · Exit Code: 0 · Duration: 8m 47s

Tokens: 1,828,124 in · 27,621 out · 1,855,745 total (22 requests)

Tool calls: 50 total · 100% success rate

Traces
Session: 1790593679-0e53e524

session (headless, success)                                                                        8m40s
├── chat ollama_cloud/glm-5.3-flash                                                                 9.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.1s
├── execute_tool Read call_mctaku2b                                                                155µs
├── execute_tool Read call_joulywj4                                                                233µs
├── execute_tool Bash call_2paqzbo6                                                                 10ms
├── chat ollama_cloud/glm-5.3-flash                                                                 2.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.3s
├── execute_tool Read call_90m4hf8s                                                                209µs
├── execute_tool Read call_k936yqba                                                                194µs
├── execute_tool Read call_v7zbpkld                                                                188µs
├── execute_tool Read call_krw7lrg0                                                                205µs
├── chat ollama_cloud/glm-5.3-flash                                                                 4.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.9s
├── execute_tool TodoWrite call_6s4q1y85                                                            62µs
├── chat ollama_cloud/glm-5.3-flash                                                                 3.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.3s
├── execute_tool Read call_wevhjo9o                                                                223µs
├── execute_tool Read call_84l7miya                                                                188µs
├── execute_tool Read call_vhjcx6ic                                                                253µs
├── execute_tool Read call_mrv54v79                                                                157µs
├── chat ollama_cloud/glm-5.3-flash                                                                15.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      15.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    15.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            15.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                15.9s
├── execute_tool Read call_8wjxmbye                                                                219µs
├── execute_tool Bash call_vjs0cd7p                                                                  5ms
├── chat ollama_cloud/glm-5.3-flash                                                                 8.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       8.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     8.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             8.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 8.3s
├── execute_tool Bash call_68ujan62                                                                  6ms
├── chat ollama_cloud/glm-5.3-flash                                                                18.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      18.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    18.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            18.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                18.4s
├── execute_tool TodoWrite call_0au14hn4                                                            75µs
├── execute_tool Bash call_rd4ixwud                                                                  7ms
├── chat ollama_cloud/glm-5.3-flash                                                                 2.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.9s
├── execute_tool Read call_ugxlpp4b                                                                218µs
├── execute_tool Read call_s8fvb2qf                                                                330µs
├── execute_tool Read call_kri1y865                                                                378µs
├── chat ollama_cloud/glm-5.3-flash                                                                 3.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.6s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.6s
├── execute_tool Read call_rsbwwq1e                                                                230µs
├── execute_tool Read call_tgaea84u                                                                253µs
├── execute_tool Bash call_xcm726ul                                                                  3ms
├── chat ollama_cloud/glm-5.3-flash                                                                 2.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.4s
├── execute_tool Read call_bexatiqk                                                                172µs
├── execute_tool Read call_62rcid27                                                                215µs
├── chat ollama_cloud/glm-5.3-flash                                                                 5.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.9s
├── execute_tool Read call_dsawxogy                                                                312µs
├── execute_tool Read call_gski7oi8                                                                304µs
├── execute_tool Read call_wxe6b7ui                                                                189µs
├── execute_tool Read call_7ss4thh5                                                                311µs
├── execute_tool Read call_cd3f1bn7                                                                 80µs
├── chat ollama_cloud/glm-5.3-flash                                                                 5.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.3s
├── execute_tool Grep call_y4krqlwv                                                                 29ms
├── execute_tool Grep call_6zoo73le                                                                  1ms
├── chat ollama_cloud/glm-5.3-flash                                                                 3.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.5s
├── execute_tool Read call_ay9vgdt0                                                                222µs
├── execute_tool Read call_e3ndrj7t                                                                191µs
├── chat ollama_cloud/glm-5.3-flash                                                                40.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      39.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    39.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            39.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                39.9s
├── execute_tool Read call_meydadgm                                                                155µs
├── execute_tool Read call_radqich5                                                                251µs
├── execute_tool Bash call_tb3df6mu                                                                 1m4s
├── chat ollama_cloud/glm-5.3-flash                                                                 3.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.5s
├── execute_tool TodoWrite call_t6swnwx9                                                            67µs
├── execute_tool Bash call_dt6bs8ge                                                                13.4s
├── chat ollama_cloud/glm-5.3-flash                                                                 5.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.8s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.8s
├── execute_tool Bash call_oxzs4b84                                                                1m11s
├── execute_tool Grep call_7y74z0na                                                                  2ms
├── chat ollama_cloud/glm-5.3-flash                                                                1m29s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      1m29s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    1m29s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            1m29s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                1m29s
├── execute_tool Grep call_r055hnuk                                                                  1ms
├── chat ollama_cloud/glm-5.3-flash                                                                 5.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.0s
├── execute_tool Bash call_bide4mz1                                                                  3ms
├── execute_tool Grep call_3mw2az0c                                                                357µs
├── chat ollama_cloud/glm-5.3-flash                                                                36.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      36.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    35.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            35.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                35.9s
├── execute_tool Grep call_57ouov5t                                                                371µs
├── chat ollama_cloud/glm-5.3-flash                                                                 4.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.1s
├── execute_tool Read call_v8dr9zi7                                                                192µs
├── chat ollama_cloud/glm-5.3-flash                                                                53.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      53.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    53.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            53.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                53.5s
├── execute_tool TodoWrite call_3ug6yar6                                                            73µs
├── execute_tool Bash call_3xegcrbi                                                                  9ms
╰── chat ollama_cloud/glm-5.3-flash                                                                44.2s
    ╰── POST /v1/chat/completions [inference-gateway, server]                                      44.2s
        ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    44.1s
            ╰── POST /proxy/:provider/*path [inference-gateway, server]                            44.1s
                ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                44.1s
Stats
Tool Calls

╭───────────┬───────┬───────┬─────────╮
│ Tool      │ Calls │ Fail% │ Avg     │
├───────────┼───────┼───────┼─────────┤
│ Read      │ 28    │ 0%    │ 188µs   │
│ Bash      │ 10    │ 0%    │ 14819ms │
│ Grep      │ 6     │ 0%    │ 6ms     │
│ TodoWrite │ 4     │ 0%    │ 77µs    │
╰───────────┴───────┴───────┴─────────╯

Token Usage

╭────────────────────────────┬─────────┬─────────┬────────────┬─────────┬──────╮
│ Model                      │ Prompt  │ Cached  │ Completion │ Total   │ Cost │
├────────────────────────────┼─────────┼─────────┼────────────┼─────────┼──────┤
│ ollama_cloud/glm-5.3-flash │ 1828124 │ 1433600 │ 27621      │ 1855745 │ -    │
╰────────────────────────────┴─────────┴─────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

@inference-gateway-maintainer inference-gateway-maintainer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full review: #1372 (comment)

Comment thread internal/tools/custom/tool.go Resolved
@edenreich
edenreich merged commit 3982850 into main Sep 28, 2026
1 check passed
@edenreich
edenreich deleted the feat/custom-tools branch September 28, 2026 11:41
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.216.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Allow registering custom tools in any language

1 participant