Skip to content

fix(mcp-market): Rename pagination field from has_next to hasnext - #1995

Merged
TimeBomb2018 merged 1 commit into
release/v0.4.1from
fix/wxy-release
Aug 11, 2026
Merged

fix(mcp-market): Rename pagination field from has_next to hasnext#1995
TimeBomb2018 merged 1 commit into
release/v0.4.1from
fix/wxy-release

Conversation

@wanxunyang

@wanxunyang wanxunyang commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator
  • Rename pagination response field from has_next to hasnext for consistency
  • Update MCP servers endpoint to use standardized field naming
  • Maintains backward compatibility in pagination logic

Summary by Sourcery

Bug Fixes:

  • 将分页字段名称与标准化的 hasnext 键对齐,以避免 MCP 市场响应中的不一致。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Align the pagination field name with the standardized hasnext key to avoid inconsistencies in MCP market responses.

- Rename pagination response field from `has_next` to `hasnext` for consistency
- Update MCP servers endpoint to use standardized field naming
- Maintains backward compatibility in pagination logic
@sourcery-ai

sourcery-ai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
审阅者指南(在小型 PR 上折叠)

审阅者指南

此 PR 更新了 MCP 市场服务器分页响应,将字段名从 has_next 重命名为 hasnext,在保持底层分页逻辑不变的前提下统一了 API。

在 get_mcp_servers 中更新分页字段的序列图

sequenceDiagram
    actor Client
    participant McpMarketConfigController

    Client->>McpMarketConfigController: get_mcp_servers(page, pagesize)
    McpMarketConfigController-->>Client: JSON { pagination.hasnext, pagination.page, pagination.pagesize, pagination.total }
Loading

文件级变更

变更 详情 文件
统一分页响应字段名称并保持分页逻辑不变。
  • 在 MCP 服务器响应载荷中,将分页元数据键从 has_next 重命名为 hasnext。
  • 保留现有用于判断是否有更多分页的布尔值计算逻辑。
api/app/controllers/mcp_market_config_controller.py

提示与命令

与 Sourcery 交互

  • 触发新的审阅: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 通过回复审阅评论让 Sourcery 创建一个 issue。你也可以在审阅评论中回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写上 @sourcery-ai summary,即可在你希望的位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可标记解决所有 Sourcery 评论。如果你已经处理完所有评论且不再需要看到它们,这将非常实用。
  • 忽略所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审阅。特别适合在你想要从头开始新的审阅时使用——别忘了再评论 @sourcery-ai review 以触发新的审阅!

自定义你的使用体验

访问你的 控制面板 来:

  • 启用或禁用审阅功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the MCP market servers pagination response to rename the field from has_next to hasnext, standardizing the API while keeping the underlying pagination logic unchanged.

Sequence diagram for updated pagination field in get_mcp_servers

sequenceDiagram
    actor Client
    participant McpMarketConfigController

    Client->>McpMarketConfigController: get_mcp_servers(page, pagesize)
    McpMarketConfigController-->>Client: JSON { pagination.hasnext, pagination.page, pagination.pagesize, pagination.total }
Loading

File-Level Changes

Change Details Files
Standardize the pagination response field name and keep pagination logic intact.
  • Rename the pagination metadata key from has_next to hasnext in the MCP servers response payload.
  • Preserve the existing boolean calculation for whether additional pages are available.
api/app/controllers/mcp_market_config_controller.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些高层面的反馈:

  • 描述中提到要保持向后兼容,但实际实现只是将 has_next 重命名为 hasnext。如果现有客户端依赖 has_next,建议同时返回这两个字段,或者添加一个兼容层。
  • 如果其他端点也使用分页机制,那么值得考虑把分页响应的构造逻辑(包括 hasnext 的处理)集中到一个辅助方法中,这样可以在整个 API 中保持命名和行为的一致性。
提供给 AI Agent 的提示
请根据本次代码评审中的评论进行修改:

## 总体评论
- 描述中提到要保持向后兼容,但实际实现只是将 `has_next` 重命名为 `hasnext`。如果现有客户端依赖 `has_next`,建议同时返回这两个字段,或者添加一个兼容层。
- 如果其他端点也使用分页机制,那么值得考虑把分页响应的构造逻辑(包括 `hasnext` 的处理)集中到一个辅助方法中,这样可以在整个 API 中保持命名和行为的一致性。

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • The description mentions maintaining backward compatibility, but the implementation only renames has_next to hasnext; consider returning both fields or adding a compatibility layer if existing clients rely on has_next.
  • If other endpoints use pagination, it may be worth centralizing the pagination response construction (including the hasnext logic) in a helper to keep naming and behavior consistent across the API.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The description mentions maintaining backward compatibility, but the implementation only renames `has_next` to `hasnext`; consider returning both fields or adding a compatibility layer if existing clients rely on `has_next`.
- If other endpoints use pagination, it may be worth centralizing the pagination response construction (including the `hasnext` logic) in a helper to keep naming and behavior consistent across the API.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

Copy link
Copy Markdown

API Breaking Change Report

Comparing against release/v0.4.1 baseline.

Breaking change approval label: api-breaking-approved = false.

Tool Result
oasdiff ✅ PASS
openapi-diff ✅ PASS

oasdiff

Output
No breaking changes to report, but the specs are different.
Run 'oasdiff diff' to see structural differences.

openapi-diff

Output
Unable to find image 'openapitools/openapi-diff:2.1.0-beta.11' locally
2.1.0-beta.11: Pulling from openapitools/openapi-diff
4abcf2066143: Pulling fs layer
a21a63612cbe: Pulling fs layer
92d6f603e71e: Pulling fs layer
b8be18af9f33: Pulling fs layer
704a4a6d46b8: Pulling fs layer
ffabcbe5d181: Pulling fs layer
c2a172360f79: Pulling fs layer
6b9cfc1f0b01: Pulling fs layer
397b98d1dbc3: Pulling fs layer
b8be18af9f33: Waiting
704a4a6d46b8: Waiting
c2a172360f79: Waiting
6b9cfc1f0b01: Waiting
ffabcbe5d181: Waiting
397b98d1dbc3: Waiting
4abcf2066143: Verifying Checksum
4abcf2066143: Download complete
a21a63612cbe: Verifying Checksum
a21a63612cbe: Download complete
b8be18af9f33: Download complete
704a4a6d46b8: Verifying Checksum
704a4a6d46b8: Download complete
4abcf2066143: Pull complete
92d6f603e71e: Verifying Checksum
92d6f603e71e: Download complete
ffabcbe5d181: Verifying Checksum
ffabcbe5d181: Download complete
6b9cfc1f0b01: Verifying Checksum
6b9cfc1f0b01: Download complete
397b98d1dbc3: Verifying Checksum
397b98d1dbc3: Download complete
c2a172360f79: Verifying Checksum
c2a172360f79: Download complete
a21a63612cbe: Pull complete
92d6f603e71e: Pull complete
b8be18af9f33: Pull complete
704a4a6d46b8: Pull complete
ffabcbe5d181: Pull complete
c2a172360f79: Pull complete
6b9cfc1f0b01: Pull complete
397b98d1dbc3: Pull complete
Digest: sha256:6c6b662418e021d13be871dc5a2e8b09936abce02ce05d377caf426663650aa9
Status: Downloaded newer image for openapitools/openapi-diff:2.1.0-beta.11
==========================================================================
==                            API CHANGE LOG                            ==
==========================================================================
                                MemoryBear                                
--------------------------------------------------------------------------
--                              What's New                              --
--------------------------------------------------------------------------
- POST   /v1/memory/merge

--------------------------------------------------------------------------
--                            What's Changed                            --
--------------------------------------------------------------------------
- GET    /v1/app/annotations
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/app/annotations/settings
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/app/annotations/{annotation_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/app/variable
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/app/conversations
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/app/conversations/{conversation_id}/messages
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/app/messages/{message_id}/suggested
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/app/info
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/app/conversations/{conversation_id}/messages/feedbacks
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/knowledges/knowledge_graph_entity_types
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/knowledges/knowledges
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/knowledges/{knowledge_id}/knowledge_graph
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/knowledges/{knowledge_id}/knowledge_graph
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/knowledges/{knowledge_id}/knowledge_graph
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/knowledges/check/yuque/auth
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/knowledges/check/feishu/auth
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/knowledges/{knowledge_id}/sync
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/documents/{kb_id}/documents
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/documents/{document_id}/chunks
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/files/{kb_id}/{parent_id}/files
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/files/folder
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/chunks/{kb_id}/{document_id}/previewchunks
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/chunks/{kb_id}/{document_id}/chunks
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/end_user/mapping
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/end_user/info
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory_config/read_all_config
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory_config/scenes/simple
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory_config/read_config_extracted
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory_config/read_config_forgetting
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory_config/read_config_emotion
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory_config/read_config_reflection
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/memory_config/delete_config
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/analytics/graph_data
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/analytics/community_graph
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/analytics/node_statistics
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/analytics/user_summary
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/analytics/memory_insight
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/analytics/interest_distribution
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/analytics/end_user_info
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/dashboard/end_users
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/ontology/scenes/simple
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/ontology/scenes
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/ontology/classes
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/app/chat
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/app/workflow/interventions/{execution_id}/submit
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/app/files
  Request:
        - Changed multipart/form-data
          Schema: Backward compatible
- POST   /v1/app/messages/{message_id}/feedback
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/knowledges/knowledge
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/knowledges/{knowledge_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/knowledges/{knowledge_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/knowledges/{knowledge_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/documents/document
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/documents/{document_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/documents/{document_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/documents/{document_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/files/file
  Request:
        - Changed multipart/form-data
          Schema: Backward compatible
- POST   /v1/files/customtext
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/files/{file_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/files/{file_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/chunks/{kb_id}/{document_id}/chunk
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/chunks/{kb_id}/{document_id}/chunk/batch
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/chunks/{kb_id}/{document_id}/{doc_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/chunks/{kb_id}/{document_id}/{doc_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/chunks/{kb_id}/{document_id}/{doc_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/chunks/retrieval
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/chunks/{kb_id}/import_qa
  Request:
        - Changed multipart/form-data
          Schema: Backward compatible
- POST   /v1/memory/read/sync
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory/read/internal
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory/write
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/end_user/create
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/end_user/info/update
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory_config/create_config
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/memory_config/update_config
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/memory_config/update_config_extracted
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/memory_config/update_config_forgetting
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/memory_config/update_config_emotion
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/memory_config/update_config_reflection
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory/analytics/generate_cache
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory/ontology/extract
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory/ontology/scene
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/memory/ontology/scene/{scene_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/memory/ontology/scene/{scene_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory/ontology/class
  Request:
        - Changed application/json
          Schema: Backward compatible
- GET    /v1/memory/ontology/class/{class_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- DELETE /v1/memory/ontology/class/{class_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- PUT    /v1/memory/ontology/class/{class_id}
  Request:
        - Changed application/json
          Schema: Backward compatible
- POST   /v1/memory/ontology/import
  Request:
        - Changed multipart/form-data
          Schema: Backward compatible
- POST   /v1/memory/ontology/export
  Request:
        - Changed application/json
          Schema: Backward compatible
--------------------------------------------------------------------------
--                                Result                                --
--------------------------------------------------------------------------
                   API changes are backward compatible                    
--------------------------------------------------------------------------

Gate decision

No breaking changes detected. The check passed without approval override.

@TimeBomb2018
TimeBomb2018 merged commit 8e1815b into release/v0.4.1 Aug 11, 2026
3 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.

2 participants