Skip to content

refactor: align system tool JSON schema codec#7116

Open
FinleyGe wants to merge 4 commits into
labring:mainfrom
FinleyGe:codex/fix-system-tool-jsonschema-enum
Open

refactor: align system tool JSON schema codec#7116
FinleyGe wants to merge 4 commits into
labring:mainfrom
FinleyGe:codex/fix-system-tool-jsonschema-enum

Conversation

@FinleyGe

Copy link
Copy Markdown
Collaborator

Summary

  • add codec coverage for workflow node input/output value types when converting to JSON Schema
  • keep select input options as JSON Schema enum for agent tool schemas
  • route agent tool catalog schema generation through nodeInputs2JsonSchema
  • update system tool secret modal UI to use the v2 modal and fix manual input rendering

Tests

  • pnpm --dir packages/global test -- test/core/app/jsonschema.test.ts
  • pnpm --dir packages/service test -- test/core/workflow/dispatch/ai/toolcall/hooks/useToolCatalog.test.ts (ran package test set: 200 passed, 2 skipped)
  • git diff --check

FinleyGe added 3 commits June 15, 2026 12:29
- Use `JSONSchema` instead of `InputConfig` for system tool I/O
  definitions
- Centralize JSON Schema to Node I/O conversion utilities
- Cleanup redundant type definitions and schema properties across
  packages
- Migrate to updated MyModal component and refactor layout
- Update input styling and placeholder logic
- Add missing input controller for 'input' type fields
- Update `getJsonSchemaPropertyFromValueType` to handle complex types
  like `arrayObject` and `chatHistory` properly instead of falling back
  to default types.
- Refactor `getEnumValuesFromNodeInput` to correctly collect enum values
  from different input configurations.
- Update `useToolCatalog` to use `nodeInputs2JsonSchema` for consistent
  schema generation across tools and nodes.
- Add comprehensive test cases to verify JSON schema conversion for
  various value types and enum sources.
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 14.8% 1221 / 8249
🔵 Statements 14.76% 1277 / 8651
🔵 Functions 12.95% 256 / 1976
🔵 Branches 12.43% 564 / 4536
File CoverageNo changed files found.
Generated in workflow #833 for commit cdcadd5 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_cdcadd5d839dbd905171e6c14a16691f5cf24ffb

🕒 Time: 2026-06-15 18:32:22 (UTC+8)

@github-actions

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_cdcadd5d839dbd905171e6c14a16691f5cf24ffb

🕒 Time: 2026-06-15 18:39:37 (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