Skip to content

refactor(agents): split Tool Search internals - #113296

Merged
steipete merged 1 commit into
mainfrom
refactor/tool-search-internals-split
Jul 24, 2026
Merged

steipete merged 1 commit into
mainfrom
refactor/tool-search-internals-split

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

src/agents/tool-search.ts remained a 2,328-line grandfathered module after the earlier code-controller extraction, so catalog state, directory projection, runtime execution, code-mode IPC, transcript projection, and config ownership were still coupled behind a max-lines suppression.

Why This Change Was Made

This Peter-requested behavior-neutral refactor keeps tool-search.ts as the compatibility facade while splitting its internals by cohesive ownership: catalog lifecycle, code-mode IPC, config resolution, directory hydration, JSON projection, runtime execution, transcript projection, and shared contracts. The max-lines suppression and baseline entry are removed; all resulting production modules are 29–547 lines. Net production LOC grows by 64 lines (2.8%) for explicit imports, shared contracts, and the stable facade boundary.

AI-assisted: yes. The implementation and moved behavior were reviewed against the existing callers and focused suites.

User Impact

No user-visible behavior, tool names, schemas, help text, runtime defaults, or public imports change. Maintainers gain smaller ownership boundaries and the repository no longer needs the Tool Search max-lines exception.

Evidence

  • node scripts/run-vitest.mjs src/agents/tool-search.test.ts — 79 passed.
  • node scripts/run-vitest.mjs src/agents/tool-search.stream-errors.test.ts — 2 passed.
  • node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt.tool-search-run-plan.test.ts — 12 passed.
  • node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt.tool-search-catalog-abort.test.ts — 1 passed.
  • node scripts/check-changed.mjs -- <touched files> — passed on Blacksmith Testbox, including production/test typechecks, formatting, max-lines ratchet, lint, import cycles, and architecture guards.
  • node scripts/check-deadcode-exports.mjs — all three Knip unused-export scans passed with 0 entries on Blacksmith Testbox.
  • Repository-local autoreview helper, Codex branch mode against origin/main — clean, 0 accepted/actionable findings. The mandated global wrapper was attempted first but its pre-review regex scanner recursively crashed on the moved regex-heavy patch before invoking Codex.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Jul 24, 2026
@steipete steipete self-assigned this Jul 24, 2026
@steipete
steipete marked this pull request as ready for review July 24, 2026 09:43
@steipete
steipete force-pushed the refactor/tool-search-internals-split branch from 1464aa5 to 29692ac Compare July 24, 2026 09:46
@steipete
steipete force-pushed the refactor/tool-search-internals-split branch from 29692ac to 004e458 Compare July 24, 2026 09:54
@steipete
steipete merged commit 050475b into main Jul 24, 2026
117 checks passed
@steipete
steipete deleted the refactor/tool-search-internals-split branch July 24, 2026 10:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 24, 2026
…omic-publication-20260724

* origin/main:
  refactor(memory-lancedb): remove dead legacy path scan (#113299)
  fix(test): satisfy no-map-spread in exec approvals (#113303)
  fix: keep OAuth refresh failures terminal [AI] (#112957)
  fix: reusable exec approvals apply to approved arguments (#112946)
  refactor(agents): split tool search internals (#113296)
  fix: keep inline eval approvals one-shot [AI] (#112956)
  refactor(normalization): reuse trimmed list helpers (#113295)
  fix(openai): fail fast on invalid TLS certificates (#111818)
  fix: recognize more shell wrappers [AI] (#112955)
  fix(i18n): correct Indonesian seconds labels
  chore(i18n): refresh native locales
  fix: block opaque exec dispatch wrappers (#112953)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant