Skip to content

refactor: unified tool desc in the app - #7649

Open
Nixieboluo wants to merge 7 commits into
labring:mainfrom
Nixieboluo:refactor/unified-tool-desc
Open

refactor: unified tool desc in the app#7649
Nixieboluo wants to merge 7 commits into
labring:mainfrom
Nixieboluo:refactor/unified-tool-desc

Conversation

@Nixieboluo

@Nixieboluo Nixieboluo commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Context

toolDescription and intro can become inconsistent across templates, canvas nodes, persisted workflows, and runtime tool calls. This change unifies node and runtime tool descriptions around intro.

The removal is intentional. Existing node-level toolDescription values are not preserved or used.

Description

This change removes node-level toolDescription from workflow data contracts and ensures all runtime tool descriptions are derived from intro.

Legacy workflows are normalized at migration boundaries so obsolete node-level fields are discarded before entering application-internal data. MCP and HTTP tool nodes use the provider description as a fallback only when their stored intro is empty. Existing custom intros always take precedence.

System tools now discard the provider's legacy toolDescription field at the adaptation boundary. System tool details, display DTOs, templates, canvas nodes, and runtime nodes retain only intro.

Changes in the codebase

  • Removed node-level toolDescription from:
    • Workflow node schemas and types
    • Runtime node types
    • Tool call node types
    • Workflow OpenAPI schemas
    • Canvas serialization and runtime conversion
  • Updated workflow migration schemas to drop legacy node-level toolDescription.
  • Added storage-boundary cleanup for copied or encoded toolset nodes.
  • Updated ToolCall schema generation to use only intro as the tool description source.
  • Removed toolDescription from system tool collection, detail, child detail, codec, repository, preview, and display mappings.
  • Preserved toolset item descriptions and input parameter-level toolDescription.
  • Added MCP and HTTP description fallback behavior:
    • Existing workflow loading fills an empty intro from the tool provider description.
    • Runtime workflow rewriting fills an empty intro for unsaved legacy workflows.
    • Existing non-empty intros are preserved.
  • Updated related unit and integration tests.

Aditional information

  • The removal of node-level toolDescription is an intentional breaking change for existing node behavior.
  • Input parameter-level toolDescription remains supported for model parameter descriptions.
  • Toolset item description remains supported and is copied into child node intro when runtime nodes are created.
  • Workflow tools, Agent tools, and their existing description behavior are outside the scope of this change.
  • This PR breaks pro build, and fixed in https://github.com/labring/fastgpt-pro/pull/1112.

Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Preserve saved intro while backfilling existing tool nodes from remote descriptions.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 33.35% 3338 / 10008
🔵 Statements 33.24% 3524 / 10599
🔵 Functions 27.88% 667 / 2392
🔵 Branches 27.94% 1662 / 5948
File CoverageNo changed files found.
Generated in workflow #2915 for commit 260f969 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Build and publish successful - Preview fastgpt Image:

ghcr.io/labring/fastgpt-pr:fastgpt_260f969db8f984f356c2890251a0c568e43f9529

🕒 Time: 2026-09-03 18:02:44 (UTC+8)

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_260f969db8f984f356c2890251a0c568e43f9529

🕒 Time: 2026-09-03 18:03:56 (UTC+8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant