Skip to content

refactor(tool): delegate pkg/tool to github.com/gollem-dev/tools#222

Merged
m-mizutani merged 6 commits into
mainfrom
refactor/migrate-pkg-tool-to-gollem-tools
Jun 14, 2026
Merged

refactor(tool): delegate pkg/tool to github.com/gollem-dev/tools#222
m-mizutani merged 6 commits into
mainfrom
refactor/migrate-pkg-tool-to-gollem-tools

Conversation

@m-mizutani

@m-mizutani m-mizutani commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces warren's in-tree implementations of the 12 external pkg/tool/* integrations with the independently published modules under github.com/gollem-dev/tools (@v0.1.0). Each tool's Specs/Run logic (HTTP clients, API parsing, query execution) now lives upstream; warren retains only the ToolSet interface extension — a thin wrapper per tool that binds CLI flags, planner metadata (ID/Description/Prompt), Configure, LogValue, and Helper.

Tools migrated: otx, urlscan, vt, shodan, abusech, ipdb, whois, intune, slack, github, bigquery, webfetch.

What stays in warren

  • Flags, env vars, tool IDs, and ErrActionUnavailable gating — unchanged, so runtime behavior is equivalent.
  • github: repository-hint YAML loading and the Prompt() built from it (the external module has no repo-hint concept).
  • bigquery: the Prompt() rendered from configured tables/runbooks, plus the generate-config Helper() subcommand and its support code (absent upstream). Only the runtime query execution (run.go) is delegated.
  • webfetch: the LLM-client construction from --webfetch-llm-* flags (llmflag.go) and HITL gating (RequiresHITL); the built client is passed to the external toolset via WithLLMClient.

Out of scope

  • pkg/agents/* (bigquery/slack/falcon) — a separate, still-wired tool system; untouched.
  • pkg/tool/base and pkg/tool/knowledge — warren-internal, no upstream equivalent.

Regression review

A diff of old vs. external behavior found no loss of tool functions, parameters, output keys, or warren-specific features. Remaining differences are improvements (correct URL encoding, stricter param specs) or minor (webfetch now caps responses at 10 MiB; shodan/abusech drop redundant 200-response shape checks). These were accepted as-is since the Specs/Run logic intentionally moved upstream.

Breaking changes (intentional)

pkg/tool/* is application-internal (warren is not published as a library); these are accepted breaking changes, called out here for completeness:

  • Specs() now requires Configure() first. The wrappers delegate Specs/Run to the external *ToolSet, which only exists after Configure() builds it; calling Specs() on a zero-value Action now returns an error instead of the previously-static spec list. All warren callers invoke Specs() after ToolSets() (which configures every tool), so there is no internal impact.
  • Removed exported DTO types. pkg/tool/github (CodeSearchResult, IssueSearchResult, ContentResult, CommitResult, BlameRange, BlameResult) and pkg/tool/slack (SearchOptions, SearchResponse, SearchOutput, …) DTOs were moved upstream / removed along with their Run logic. No package in this repo imports them.

Verification

  • go vet ./..., go test ./... — all pass
  • golangci-lint run (tool + cli) — 0 issues
  • gosec (tool) — no findings

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the tool implementations in the pkg/tool directory (including abusech, bigquery, github, intune, ipdb, otx, shodan, slack, urlscan, vt, webfetch, and whois) by externalizing their core execution and specification logic to the github.com/gollem-dev/tools module. The local packages have been simplified to thin wrappers that bind CLI flags and handle planner metadata/prompts, while delegating the runtime execution to the externalized packages. Corresponding tests have been updated to verify this delegation. Feedback on the changes points out a redundant nil check for x.client in pkg/tool/webfetch/action.go that can be safely removed.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pkg/tool/webfetch/action.go Outdated
@m-mizutani
m-mizutani merged commit d5d96d3 into main Jun 14, 2026
7 checks passed
@m-mizutani
m-mizutani deleted the refactor/migrate-pkg-tool-to-gollem-tools branch June 14, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant