Skip to content

feat(core/app): store tool schemas as strings - #7497

Open
FinleyGe wants to merge 4 commits into
labring:mainfrom
FinleyGe:fix/jsonschema-storage
Open

feat(core/app): store tool schemas as strings#7497
FinleyGe wants to merge 4 commits into
labring:mainfrom
FinleyGe:fix/jsonschema-storage

Conversation

@FinleyGe

@FinleyGe FinleyGe commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • store MCP and HTTP tool JSON Schema fields as JSON strings at the Mongo persistence boundary
  • decode string values on reads while preserving compatibility with historical object data
  • add codec regression coverage for MCP and HTTP tool schemas
  • fixing: mcp工具以$开头的字段无法存储 #7477

Scope

The public API and runtime contracts remain JSON objects. The codec applies to apps.modules and app_versions.nodes nested tool schema fields. No data migration is required for rollout; legacy object values remain readable.

Validation

  • git diff --check passed
  • Vitest and ESLint were not run because workspace dependencies are not installed in the current environment; offline installation was blocked by a missing @orama/orama tarball.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 24.72% 2220 / 8978
🔵 Statements 24.72% 2335 / 9443
🔵 Functions 21.07% 460 / 2183
🔵 Branches 20.05% 1025 / 5112
File CoverageNo changed files found.
Generated in workflow #2180 for commit 954c2a0 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_954c2a047277c52a020e84b4828638038190fc6c

🕒 Time: 2026-08-12 11:56:46 (UTC+8)

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_954c2a047277c52a020e84b4828638038190fc6c

🕒 Time: 2026-08-12 11:54:33 (UTC+8)

Before saving to MongoDB, stringify known JSON Schema fields to avoid
restrictions on keys containing dots or dollar signs. Restore them on
read and keep backward compatibility with existing object data.
Refactor the common node walker to use a transform callback and remove
the encode/decode boolean. Add cleanWorkflowToolJsonSchemasForStorage
for upgrade scripts to stringify historical object schemas. Skip
Mongoose
documents in post find hooks so raw reads are not decoded.
Add admin API to convert legacy object-form tool JSON Schemas in app
modules and app version nodes to strings. Defaults to dry-run and
processes in batches; pass dryRun=false to apply changes.
@FinleyGe
FinleyGe force-pushed the fix/jsonschema-storage branch from b14c135 to 21dc320 Compare August 12, 2026 02:29
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