Skip to content

refactor(computer-tool): split the computer tool by responsibility - #124358

Merged
steipete merged 1 commit into
mainfrom
steipete/cu-tool-split
Aug 16, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/cu-tool-split

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

computer-tool.ts had accumulated the model schema, v1 coordinate/frame handling, v2 wire construction, node selection and execution affinity, result projection, and screenshot delivery in one 1,542-line module. That required a grandfathered max-lines suppression and made each responsibility harder to review in isolation.

Why This Change Was Made

Split the implementation along settled ownership boundaries: a leaf shared-types module, schema construction, wire-request construction, node/session affinity, and model-result delivery. computer-tool.ts now retains only the public tool definition and orchestration. The schema, action set, capability descriptors, and model-visible behavior are unchanged.

Post-split physical line counts:

Module Lines
computer-tool.ts 243
computer-tool-node.ts 497
computer-tool-request.ts 528
computer-tool-result.ts 232
computer-tool-schema.ts 160
computer-tool-shared.ts 53

The max-lines suppression and config/max-lines-baseline.txt entry for computer-tool.ts are both removed. No replacement suppressions were added.

User Impact

No user-visible behavior changes. This makes future computer-use work easier to review and keeps each production module within the repository line budget.

Evidence

  • node scripts/run-vitest.mjs src/agents/tools: 83 files and 1,959 tests before and after; 1,958 passed and 1 skipped.
  • pnpm tsgo: passed.
  • pnpm check:test-types: passed.
  • node scripts/run-oxlint.mjs src/agents/tools: passed.
  • node --import tsx scripts/check-madge-import-cycles.ts: 0 cycles.
  • pnpm deadcode:full: passed.
  • git diff --check: passed.
  • Codex autoreview in local and branch modes: clean, with no accepted/actionable findings.
  • The requested refs/remotes/origin/ci-max-lines-base ref was absent after fetch, so the max-lines ratchet is left to the PR's authoritative CI run as directed by the work order.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 02:31
@steipete
steipete merged commit c348815 into main Aug 16, 2026
249 checks passed
@steipete
steipete deleted the steipete/cu-tool-split branch August 16, 2026 02:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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