Skip to content

refactor(tools): move the tools into their own bounded context - #1377

Merged
edenreich merged 5 commits into
mainfrom
fix/issue-1373
Sep 28, 2026
Merged

edenreich merged 5 commits into
mainfrom
fix/issue-1373

Conversation

@inference-gateway-maintainer

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

Copy link
Copy Markdown
Contributor

Resolves #1373

Summary

The built-in tools and the tool registry move out of the agent context into the tools bounded context, next to internal/tools/custom from PR 1372. The agent consumes the tools context, never the other way round: the tool result formatters moved into the tools context as well, so internal/tools imports neither internal/agent nor internal/agent/infrastructure, and a depguard rule now enforces that boundary. Tool definitions are byte-identical (internal/agent/testdata/tool_definitions.golden.json is unchanged).

Tool model home: Tool, ToolManifest, ManifestTool, CallApprover, SelfGatedTool, SessionTool, ToolExecutionResult and ValidateArguments stay in the agentdomain shared kernel. It is the designated shared kernel (every context's domain/ imports exactly agent/domain as its shared kernel), and the a2a, browser, computer and MCP contexts implement these contracts, so moving them to internal/tools/domain would ripple through those contexts plus the domain-is-pure depguard allow-list. That deserves its own step; this PR records the decision.

Changes

  • Moved internal/agent/tools into internal/tools (git-detected 100% renames; package stays tools): the registry, the built-in tools, their embedded YAML manifests, filewriter/, and the markdown-subagent helpers. Call sites keep tools.ToolRead and tools.NewRegistry and only import paths changed: internal/agent, internal/agent/states, internal/container, cmd/tools, cmd/export, internal/presentation/headless, internal/presentation/tui and the internal/tools/custom tests.
  • Moved BaseFormatter/CustomFormatter (plus their unit tests) from internal/agent/infrastructure to internal/tools, since what they format is a tool result: the a2a, computer, MCP and custom tools and the TUI tool formatter service now import the formatter from internal/tools.
  • internal/tools imports neither internal/agent nor internal/agent/infrastructure; the only remaining importer of internal/agent/infrastructure outside the agent context is internal/container, the composition root that builds the services.
  • Added the depguard rule tools-do-not-import-the-agent (.golangci.yml): files under internal/tools may not import github.com/inference-gateway/cli/internal/agent (which prefix-covers internal/agent/infrastructure and friends), with internal/agent/domain explicitly allowed as the shared kernel. Verified by probing: a temporary import of internal/agent/infrastructure from internal/tools is flagged as tools-do-not-import-the-agent.
  • AGENTS.md lists tools among the bounded contexts, points at internal/tools for the registry and manifest paths, records that the tools contracts stay in the agentdomain shared kernel, and documents the import direction. CONTRIBUTING.md's "Adding New Tools" guide follows the new paths.
  • Updated stale comments and test fixtures that pointed at internal/agent/tools paths.

no docs ticket: internal-only refactor

Verification

  • go build ./... and the affected package tests pass after every commit; the tool-definitions golden test is unchanged and green.
  • go test -race ./...: green (full suite, ~4 min).
  • task precommit:run: green (mod:tidy, mocks, fmt, lint:imports, golangci-lint 0 issues, markdownlint).
  • e2e suite (task test:e2e): 6 failures in this runner, all pre-existing - verified by running the suite on clean main (3982850), where TestAgentWriteIsBlockedWithoutApprover and TestChatTUIViaTmux fail with byte-identical errors (headless Write executes without an approver; the TUI panes show a "Username for 'https://github.com':" credential prompt from the gateway binary download and never see the mock reply). Tracked in issue 1378.

…ools

internal/agent/tools becomes the tools bounded context's home next to internal/tools/custom: the registry, the built-in tools, their embedded manifests and filewriter/ move, while the package stays tools so call sites keep tools.ToolRead and tools.NewRegistry and only their import paths change.

internal/agent/testdata/tool_definitions.golden.json is byte-identical.
BaseFormatter and CustomFormatter move from internal/agent/infrastructure into the tools context: they format tool results, and the MCP and custom tools use them too. The a2a, computer and MCP contexts, the custom tools and the UI tool formatter service now import the formatter from internal/tools, so the tools context imports neither internal/agent nor internal/agent/infrastructure.
A depguard rule keeps internal/tools from importing the agent context: the agent consumes the tools, never the other way round, with agent/domain excepted as the shared kernel. AGENTS.md lists tools among the bounded contexts, points at internal/tools for the registry and manifests, and CONTRIBUTING.md's Adding New Tools guide follows the new paths. The tool model stays in the agentdomain shared kernel for now, since the a2a, browser, computer and MCP tools implement it.
@edenreich

Copy link
Copy Markdown
Contributor

@infer /model ollama_cloud/deepseek-v4.1-flash CI is failing and the PR is not ready for review, can you fix the work of glm-5.3-flash? use /ponytail:ponytail /domain-driven-design /go /go-concurrency once the migration is complete and ready and the examples all are working as expected - there is no regression, then we can review this PR.

@inference-gateway-maintainer

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

Copy link
Copy Markdown
Contributor Author

Model: ollama_cloud/deepseek-v4.1-flash · View Job

Todos

  • Fix the invalid depguard rule in .golangci.yml and confirm task lint passes
  • Verify build, vet and unit tests pass (no regression)
  • Verify the examples still work end to end
  • Confirm CI on this branch goes green
  • Review the migration for DDD/import-boundary correctness and report findings + proposals

Pull Request

#1377

✅ Infer Result: Success

CI is green and the tree is clean. Here is my report.

What I changed

One commit, 9b71320 fix(lint): correct the tools depguard rule so the config verifies.

The tools-do-not-import-the-agent rule added in a727d8c had two defects in .golangci.yml:

  1. desc was placed at the rule level. golangci-lint v2's depguard schema only accepts list-mode, files, allow and deny there, so golangci-lint config verify failed with additional properties 'desc' not allowed. That is why CI died inside "Install golangci-lint" 21 seconds in, before a single Go file was linted, and why build, test, e2e, postgres and build-macos were all skipped.
  2. The rule body was indented four spaces deeper than its siblings (rule name at 10 spaces, body at 16 instead of 12). Once desc moved onto the deny entry that made the file unparseable: yaml: line 61: mapping values are not allowed in this context.

The fix moves the description onto the deny entry and aligns the block with presentation-is-a-leaf, domain-is-pure and the rest. I rewrote the file with identical content apart from that block, so no other rule changed.

Verification (all run on this branch after the fix)

  • task lint: green, 0 issues (lint:imports, golangci-lint run --build-tags purego, markdownlint). task build, go build ./..., task test and task vet all green.
  • Depguard probe: adding _ "github.com/inference-gateway/cli/internal/agent/infrastructure" to a file under internal/tools produced import '.../internal/agent/infrastructure' is not allowed from list 'tools-do-not-import-the-agent': the agent context consumes the tools context, never the other way round; agent/domain stays the shared kernel (depguard). So the rule really does fire, and the allow: agent/domain entry correctly exempts the shared kernel. The probe file was deleted; the tree is clean.
  • Examples: go test -tags "e2e purego" -run TestCustomToolsExample -v ./tests/e2e/ passes all four scenarios (WordCount without approval, SaveNote blocked without an approver, SaveNote in auto mode, SaveNote refused in plan mode), which is exactly what examples/tools/README.md promises. task -d examples/tools execute also runs both tools successfully through cmd/tools.
  • task -d examples/tools all cannot complete in this runner, but for an environment reason, not a repo one: headless resolves the model via selectModel(availModels, opts.Model, cfg.Agent.Model), and the model from this session's /model command wins over the example's INFER_AGENT_MODEL, so it aborts with Default model "..." not available before any tool call. The e2e test above covers the same paths.
  • CI on 9b71320 is fully green: lint, build, build-macos, test, e2e, postgres, vet, CodeQL, prepare and all three Analyze jobs pass. e2e passing in GitHub CI confirms the 6 sandbox-only failures tracked in [BUG] tests/e2e fails on main: headless Write is not blocked without an approver, TUI tests never see the mock reply #1378 do not block this PR.

Review findings on the migration (nothing changed here)

  • The move is complete and coherent. No file anywhere still references internal/agent/tools, all call sites resolve to internal/tools, and internal/agent/infrastructure is now imported only by internal/container/container.go plus the agent's own states package, exactly as the PR body claims. The formatter move reads correctly: internal/tools.Ba**seFormatter/CustomFormatter are consumed by the TUI tool formatter, internal/tools/custom, and the a2a/computer/MCP tools.
  • Keeping Tool, ToolManifest, CallApprover, SelfExecutingTool, SessionTool and ValidateArguments in the agentdomain shared kernel is the right call for this step, and the AGENTS.md note records it. The residual cost is that internal/tools is the only context without its own domain/, so the depguard allow: .../internal/agent/domain is a deliberate, documented hole in the "tools never import the agent" boundary. If that is later tightened, moving those contracts into internal/tools/domain will also touch a2a, browser, computer, mcp and the domain-is-pure allow-list, which is why it deserves its own PR.
  • One small gap worth a decision, not urgent: the rule excludes tests (!$test), so a test under internal/tools could import internal/agent/infrastructure and nothing would catch it. The PR body's claim "internal/tools imports neither internal/agent nor internal/agent/infrastructure" holds today (verified by grep), but only for non-test files. Dropping the !$test line would make the guard total; keeping it follows the pattern of the other rules in the file.
  • Docs are consistent: zero internal/agent/tools references remain repo-wide, and AGENTS.md/CONTRIBUTING.md point at the new paths. No [DOCS] ticket is needed for this internal-only refactor.

The branch is pushed and the working tree is clean, so the PR is ready for your review.

Model: ollama_cloud/deepseek-v4.1-flash · Exit Code: 0 · Duration: 12m 0s

Tokens: 3,323,501 in · 38,947 out · 3,362,448 total (50 requests)

Tool calls: 70 total · 100% success rate

Traces
Session: 1790598357-11950850

session (headless, success)                                                                       11m52s
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Bash call_ade5poej                                                                  8ms
├── execute_tool Bash call_cufsx8ix                                                                  3ms
├── execute_tool Bash call_qkzvi3yz                                                                 1.0s [error: tool_error]
├── chat ollama_cloud/deepseek-v4.1-flash                                                          803ms
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      792ms
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    785ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            785ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                785ms
├── execute_tool Bash call_z1nf83so                                                                 1.4s
├── execute_tool Read call_qrdxdeb9                                                                159µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.0s
├── execute_tool Read call_bimnuhfx                                                                144µs
├── chat ollama_cloud/deepseek-v4.1-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 TodoWrite call_ev095aq9                                                            50µs
├── execute_tool Bash call_igalmp49                                                                  4ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Edit call_82m4jkfu                                                                382µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.0s
├── chat ollama_cloud/deepseek-v4.1-flash                                                          912ms
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      886ms
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    880ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            880ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                880ms
├── execute_tool Grep call_62hlk1cq                                                                750µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Read call_19lahn1i                                                                121µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.6s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.6s
├── execute_tool Bash call_t90ggr3a                                                                810µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                          771ms
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      756ms
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    747ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            747ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                747ms
├── execute_tool Wait call_0rzcdtxk                                                                501ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                          756ms
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      742ms
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    735ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            735ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                735ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.0s
├── execute_tool Bash call_e9kaazk1                                                                248ms [error: tool_error]
├── chat ollama_cloud/deepseek-v4.1-flash                                                           3.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.4s
├── execute_tool Grep call_35l0y36p                                                                625µs
├── execute_tool Bash call_hcoc5ddt                                                                  6ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           6.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.2s
├── execute_tool Read call_1ynsy2gl                                                                187µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           7.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       7.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     7.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             7.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 7.4s
├── execute_tool Write call_saj11u7k                                                               758µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      989ms
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    979ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            978ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                978ms
├── execute_tool Bash call_fi6porkr                                                                1m59s
├── chat ollama_cloud/deepseek-v4.1-flash                                                           3.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.2s
├── execute_tool Bash call_2b4g6vvn                                                                  8ms
├── execute_tool Bash call_1k9k8yxb                                                                  4ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.4s
├── execute_tool Bash call_nfs0a9i5                                                                  9ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    991ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            990ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                990ms
├── execute_tool Bash call_3ut53zjb                                                                 5.7s
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.9s
├── execute_tool Bash call_lvsteav9                                                                 1.3s
├── execute_tool TodoWrite call_1huq7gh3                                                            59µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.4s
├── execute_tool Memory call_xir8olp2                                                               84µs
├── execute_tool Bash call_dnun3qd5                                                                45.6s
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.1s
├── execute_tool Bash call_ltxwpv7r                                                                  1ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.5s
├── execute_tool Wait call_h6b1amap                                                                1m32s
├── execute_tool Read call_7ujoeh2a                                                                189µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.7s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.7s
├── execute_tool TodoWrite call_ixg3hsqf                                                            80µs
├── execute_tool Read call_pbb1mfiv                                                                169µs
├── execute_tool Read call_7k9fgb20                                                                162µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           3.0s
│   ╰── 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 Bash call_8h94n6l2                                                                43.5s
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.5s
├── execute_tool Bash call_vcegb6cq                                                                226ms [error: tool_error]
├── chat ollama_cloud/deepseek-v4.1-flash                                                           4.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.9s
├── execute_tool Grep call_3irj2g46                                                                148ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.1s
├── execute_tool Read call_pzdjdqeg                                                                136µs
├── chat ollama_cloud/deepseek-v4.1-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.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_4nq2df5p                                                                 97µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.9s
├── execute_tool Grep call_88df8d5g                                                                277µs
├── chat ollama_cloud/deepseek-v4.1-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 Grep call_zikht0uj                                                                328µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           6.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.7s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.7s
├── execute_tool Grep call_jbn2cl96                                                                313µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                          11.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      11.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    11.4s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            11.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                11.4s
├── execute_tool Grep call_etlbesbe                                                                449µs
├── chat ollama_cloud/deepseek-v4.1-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 Grep call_r2rkxbgx                                                                  1ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                          10.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      10.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    10.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            10.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                10.3s
├── execute_tool Bash call_nca79dvh                                                                  2ms
│   ├── session [infer-action, internal] (headless, success)                                       232ms
│   │   ├── chat mock/openai/gpt-4o [infer-action, client]                                          10ms
│   │   ├── execute_tool WordCount [infer-action, internal] call_0_0                                23ms
│   │   ╰── chat mock/openai/gpt-4o [infer-action, client]                                           9ms
│   ├── session [infer-action, internal] (headless, success)                                       117ms
│   │   ├── chat mock/openai/gpt-4o [infer-action, client]                                          10ms
│   │   ╰── chat mock/openai/gpt-4o [infer-action, client]                                          11ms
│   ├── session [infer-action, internal] (headless, success)                                       197ms
│   │   ├── chat mock/openai/gpt-4o [infer-action, client]                                          10ms
│   │   ├── execute_tool SaveNote [infer-action, internal] call_0_0                                  3ms
│   │   ╰── chat mock/openai/gpt-4o [infer-action, client]                                           8ms
│   ╰── session [infer-action, internal] (headless, success)                                       172ms
│       ├── chat mock/openai/gpt-4o [infer-action, client]                                          10ms
│       ├── execute_tool SaveNote [infer-action, internal] call_0_0                                141µs [error: tool_error]
│       ╰── chat mock/openai/gpt-4o [infer-action, client]                                           8ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Wait call_jffro3hk                                                                 2.5s
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.6s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.6s
├── execute_tool Grep call_qe7n2d3u                                                                329µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Bash call_lprd5q6t                                                                 3.7s
│   ├── session [infer-action, internal] (headless, success)                                       226ms
│   │   ├── chat mock/openai/gpt-4o [infer-action, client]                                          11ms
│   │   ├── execute_tool WordCount [infer-action, internal] call_0_0                                22ms
│   │   ╰── chat mock/openai/gpt-4o [infer-action, client]                                          10ms
│   ├── session [infer-action, internal] (headless, success)                                       122ms
│   │   ├── chat mock/openai/gpt-4o [infer-action, client]                                          11ms
│   │   ╰── chat mock/openai/gpt-4o [infer-action, client]                                           8ms
│   ├── session [infer-action, internal] (headless, success)                                       196ms
│   │   ├── chat mock/openai/gpt-4o [infer-action, client]                                          10ms
│   │   ├── execute_tool SaveNote [infer-action, internal] call_0_0                                  2ms
│   │   ╰── chat mock/openai/gpt-4o [infer-action, client]                                           8ms
│   ╰── session [infer-action, internal] (headless, success)                                       177ms
│       ├── chat mock/openai/gpt-4o [infer-action, client]                                          10ms
│       ├── execute_tool SaveNote [infer-action, internal] call_0_0                                115µs [error: tool_error]
│       ╰── chat mock/openai/gpt-4o [infer-action, client]                                           8ms
├── chat ollama_cloud/deepseek-v4.1-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 Bash call_ni4qyciz                                                                287ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           4.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.5s
├── execute_tool Bash call_0ogt76qm                                                                 52ms
├── execute_tool Write call_poas1lfq                                                               757µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      980ms
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    963ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            962ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                962ms
├── execute_tool Bash call_ofu8awtw                                                                24.1s [error: tool_error]
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    987ms
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            987ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                987ms
├── execute_tool Delete call_telusvda                                                              320µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           3.4s
│   ╰── 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 Bash call_yko71qhu                                                                  8ms
├── execute_tool Grep call_8271bxj3                                                                 16ms
├── execute_tool Grep call_cg4bfm8b                                                                137ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           5.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.2s
├── execute_tool Grep call_mv0cgn33                                                                153ms
├── execute_tool Grep call_lvr47ddl                                                                146ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.1s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.1s
├── execute_tool Read call_6qp3s6rq                                                                217µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           7.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       7.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     7.7s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             7.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 7.7s
├── execute_tool Bash call_y4pdhrym                                                                  4ms
├── execute_tool Bash call_yuo4hgpv                                                                  7ms
├── chat ollama_cloud/deepseek-v4.1-flash                                                           2.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.5s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.5s
├── execute_tool Wait call_uxcfxpdu                                                                3m25s
├── chat ollama_cloud/deepseek-v4.1-flash                                                           7.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       7.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     7.2s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             7.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 7.2s
├── execute_tool Memory call_achcjfyr                                                               1.5s
├── execute_tool Memory call_w3na78v3                                                               1.1s
├── execute_tool TodoWrite call_jliaa6wm                                                            60µs
├── chat ollama_cloud/deepseek-v4.1-flash                                                           1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Bash call_kwgcm3xn                                                                  8ms
╰── chat ollama_cloud/deepseek-v4.1-flash                                                           7.1s
    ╰── POST /v1/chat/completions [inference-gateway, server]                                       7.1s
        ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     7.0s
            ╰── POST /proxy/:provider/*path [inference-gateway, server]                             7.0s
                ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 7.0s
Stats
Tool Calls

╭───────────┬───────┬───────┬─────────╮
│ Tool      │ Calls │ Fail% │ Avg     │
├───────────┼───────┼───────┼─────────┤
│ Bash      │ 27    │ 15%   │ 9131ms  │
│ Grep      │ 13    │ 0%    │ 47ms    │
│ Read      │ 10    │ 0%    │ 160µs   │
│ TodoWrite │ 4     │ 0%    │ 58µs    │
│ Wait      │ 4     │ 0%    │ 75001ms │
│ Memory    │ 3     │ 0%    │ 845ms   │
│ Write     │ 2     │ 0%    │ 755µs   │
│ Edit      │ 1     │ 0%    │ 381µs   │
│ Delete    │ 1     │ 0%    │ 310µs   │
╰───────────┴───────┴───────┴─────────╯

Token Usage

╭──────────────────────────────────┬─────────┬─────────┬────────────┬─────────┬──────╮
│ Model                            │ Prompt  │ Cached  │ Completion │ Total   │ Cost │
├──────────────────────────────────┼─────────┼─────────┼────────────┼─────────┼──────┤
│ ollama_cloud/deepseek-v4.1-flash │ 3323501 │ 2909056 │ 38947      │ 3362448 │ -    │
╰──────────────────────────────────┴─────────┴─────────┴────────────┴─────────┴──────╯

Sessions

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

Triggered by edenreich · Infer Action · OSS

golangci-lint's depguard schema rejects a rule-level desc key, and the added rule body was indented four spaces too deep, which made the YAML unparseable. Move the desc onto the deny entry and align the block with its siblings.
# Conflicts:
#	AGENTS.md
#	cmd/export/export.go
#	internal/agent/tool_definitions_golden_test.go
#	internal/protocols/a2a/query_agent.go
#	internal/protocols/mcp/tool.go
@edenreich
edenreich merged commit 5706c4a into main Sep 28, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1373 branch September 28, 2026 13:45
@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 📦🚀

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.

[TASK] Refactor the tools into their own bounded context

1 participant