Skip to content

Support codemode-only exposure for Think extension tools #1774

@miantiao-me

Description

@miantiao-me

Think currently automatically merges loaded extension tools into the top-level tool set:

const extensionTools = this.extensionManager?.getTools() ?? {}

In some applications, it would be useful to expose extension tools only inside execute / codemode instead of making them directly callable as top-level tools.

Example desired usage:

execute: createExecuteTool({
  ctx: this.ctx,
  tools: {
    ...domainTools,
    ...extensionManager.getTools(),
  },
})

This makes dynamically loaded extensions behave more like a programmable plugin library: the model calls them through codemode when composing code, without expanding the top-level tool space for every turn.

Could Think provide an official way to control extension tool exposure, for example:

extensionToolExposure: "top-level" | "codemode" | "both" | "manual"

or a simpler opt-out:

exposeExtensionToolsAsTopLevel: false

The default could stay unchanged for compatibility.

Motivation:

  • reduce top-level tool count
  • prevent dynamic extensions from bloating the tool space
  • encourage composing extension capabilities through code
  • let applications decide where extension tools are exposed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions