Skip to content

fix: restrict batch import by gateway type and product type compatibility#273

Merged
learnerjohn merged 1 commit intohigress-group:mainfrom
lexburner:fix/batch-import-model-api
Apr 17, 2026
Merged

fix: restrict batch import by gateway type and product type compatibility#273
learnerjohn merged 1 commit intohigress-group:mainfrom
lexburner:fix/batch-import-model-api

Conversation

@lexburner
Copy link
Copy Markdown
Contributor

📝 Description

  • Fix HigressModelResult missing modelApiId/modelApiName fields, which caused the import dialog to show empty service names when importing from Higress
  • Add backend validation in validateImportParam: Higress gateway only supports MCP_SERVER batch import; REST_API, AGENT_API, and MODEL_API are explicitly rejected with clear error messages
  • Add backend validation: Nacos source does not support REST_API import
  • Fix HigressOperator.fetchAgentAPIs() returning null instead of empty PageResult, which could cause NPE
  • Frontend: show all source type options (Higress/AI Gateway/Nacos) but disable unsupported combinations with tooltip explaining why, instead of hiding them — this is more friendly for community users
  • Frontend: hide "批量导入" button for AGENT_SKILL and WORKER product types, as they have their own dedicated Nacos import flow

Background

The batch import feature was originally designed for MCP_SERVER and AGENT_API from Gateway/Nacos. However, it was inadvertently exposed for all product types including REST_API, MODEL_API, AGENT_SKILL, and WORKER. This caused several issues:

Product Type Higress AI Gateway Nacos
MCP_SERVER ✅ Works ✅ Works ✅ Works
AGENT_API ❌ Returns null → NPE ✅ Works ✅ Works
MODEL_API ❌ Route name ≠ model ID ✅ Works ❌ Not supported
REST_API ❌ Throws UnsupportedOperationException ✅ Works ❌ Not supported
AGENT_SKILL/WORKER N/A (has dedicated import) N/A N/A

🔗 Related Issues

Fix #272

✅ Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change
  • Documentation update
  • Code refactoring
  • Performance improvement

🧪 Testing

  • Manual testing completed
  • Verified Higress + REST_API returns INVALID_REQUEST with clear message
  • Verified Higress + MODEL_API returns INVALID_REQUEST with clear message
  • Verified Higress + AGENT_API returns INVALID_REQUEST with clear message
  • Verified Higress + MCP_SERVER still works correctly
  • Verified frontend disables unsupported source types with tooltip

📋 Checklist

  • Code has been formatted (mvn spotless:apply for backend, npm run lint:fix for frontend)
  • Code is self-reviewed
  • No breaking changes
  • All CI checks pass

…lity

- Fix HigressModelResult missing modelApiId/modelApiName fields
- Add backend validation: Higress only supports MCP_SERVER batch import
- Add backend validation: Nacos does not support REST_API import
- HigressOperator.fetchAgentAPIs returns empty PageResult instead of null
- Frontend: disable unsupported source types with tooltip instead of hiding
- Frontend: hide batch import button for AGENT_SKILL/WORKER (use dedicated Nacos import)
@learnerjohn learnerjohn merged commit a7f0d9c into higress-group:main Apr 17, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 导入higress模型提示请求无效:MODEL_API product must specify a model name

2 participants