refactor: replace ban-types Function with real call signatures - #6671
Merged
Conversation
- packages/mcp-utils/src/sandbox/run-code.ts: executePendingJobs now typed against quickjs-emscripten-core's own (maxJobsToExecute?: number) => ExecutePendingJobsResult signature. - apps/api/src/harnesses/decopilot/built-in-tools/index.ts: the instrumentBuiltIns execute-wrapper cast now types execute as (input: unknown, options: unknown) => unknown, matching the two call sites that already pass it exactly those two arguments.
decocms Bot
pushed a commit
that referenced
this pull request
Aug 28, 2026
PR: #6671 refactor: replace ban-types Function with real call signatures Bump type: patch - decocms (apps/api/package.json): 4.289.0 -> 4.289.1 - @decocms/native (apps/native/package.json): 4.289.0 -> 4.289.1 - @decocms/mcp-utils (packages/mcp-utils/package.json): 1.2.0 -> 1.2.1 Deploy-Scope: server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two spots in the codebase type a callback as the bare
Functiontype, which the repo'sban-typesoxlint rule flags (awarn-level rule, not CI-enforced, so it accumulates as un-caught debt) —Functionaccepts any arity/argument types, so a caller can pass the wrong shape and only find out at runtime.packages/mcp-utils/src/sandbox/run-code.ts:executePendingJobsonQuickJSRuntimealready has a real exported signature,(maxJobsToExecute?: number | void) => ExecutePendingJobsResult, fromquickjs-emscripten-core's own.d.ts. Typed the inlinectx.runtimeparam against that instead ofFunction.apps/api/src/harnesses/decopilot/built-in-tools/index.ts:instrumentBuiltInscasts each AI-SDK tool'sexecuteto read it off before wrapping. Both call sites (originalExecute.call(t, input, options)) always pass exactly two arguments, so the cast is now(input: unknown, options: unknown) => unknowninstead ofFunction.Why a maintainer wants this: a real signature is what
bunx tsc --noEmitcan actually check a call against;Functionis a no-op for that in both places.Behavior-preserving — same runtime code, only annotations changed. No test needed (pure type-level change); a reviewer confirms with:
Locally ran:
bun run fmt,bunx tsc --noEmitin bothpackages/mcp-utilsandapps/api(both clean), andbunx oxlinton both touched files (0 warnings/errors). Full CI validates the rest.Summary by cubic
Replaces bare
Functionannotations with real call signatures in two spots sotsccan actually check callback shapes instead of accepting anything at compile time.packages/mcp-utils/src/sandbox/run-code.ts,executePendingJobsnow types the runtime callback as(maxJobsToExecute?: number) => ExecutePendingJobsResult, matchingquickjs-emscripten-core's exported signature.apps/api/src/harnesses/decopilot/built-in-tools/index.ts, theexecutecast is now(input: unknown, options: unknown) => unknown, matching the two call sites that pass exactly those arguments.Behavior is unchanged; this is a pure type-level refactor, so no tests or runtime effects. Verify with
bunx tsc --noEmitinpackages/mcp-utilsandapps/api, plusbunx oxlinton both touched files.Written for commit 529fefa. Summary will update on new commits.