Enhance agent marketplace with pagination, reviews, and import precheck#3316
Enhance agent marketplace with pagination, reviews, and import precheck#3316Lifeng-Chen wants to merge 5 commits into
Conversation
…ort precheck Add paginated search for repository listings and mine agents, an admin review queue with approve/reject, and import precheck/copy flow that validates models, knowledge bases, MCP, skills, and tools before copying from the marketplace. Extract repository domain constants and expand backend/frontend tests.
1 similar comment
… tests Align the test file with existing frontend unit tests and fix CI type-check failures caused by missing vitest dependency.
Replace void promise calls with async handlers and .catch() in page.tsx, and split AgentRepositoryDetailModal into smaller components to reduce cognitive complexity below SonarCloud threshold.
Auto-compute tool_count when creating or updating listings, expose it in the list API, and render "x tools" on repository cards when count is greater than zero.
| @@ -1,9 +1,13 @@ | |||
| import logging | |||
| import math | |||
| from typing import Any, Collection, Dict, List, Optional | |||
There was a problem hiding this comment.
Download Count Inflation
increment_agent_repository_downloads increments for any non-deleted repository regardless of status. Should only increment for status=shared to prevent inflating counts for pending/rejected listings.
| @@ -1,26 +1,31 @@ | |||
| import logging | |||
There was a problem hiding this comment.
In-Memory Search
list_agent_repository_listings_impl fetches all records then filters by search in-memory. For large datasets, search should be done at database level via SQL LIKE/ILIKE.
| @@ -1,26 +1,31 @@ | |||
| import logging | |||
There was a problem hiding this comment.
Inefficient Agent Fetch
list_my_editable_agents_impl fetches ALL agents then filters ownership/search in-memory. Inefficient for large tenant datasets.
| @@ -0,0 +1,348 @@ | |||
| """Extract and validate repository import dependencies against the target tenant.""" | |||
There was a problem hiding this comment.
Duplicate DB Calls
build_repository_import_precheck calls get_knowledge_record twice per KB: once in _check_kb_available and again for description. Combine into single call.
| @@ -1,26 +1,31 @@ | |||
| import logging | |||
There was a problem hiding this comment.
Breaking Auth Change
_validate_create_listing_permission changed from email-based to created_by-based authorization. DEV users who previously could share via email match will now be denied.
| @@ -1,26 +1,31 @@ | |||
| import logging | |||
There was a problem hiding this comment.
Breaking Version Naming
Version naming changed from lowercase v to uppercase V (v1 to V1). Creates inconsistency with existing published versions.
| @@ -1,9 +1,13 @@ | |||
| import logging | |||
| import math | |||
| from typing import Any, Collection, Dict, List, Optional | |||
There was a problem hiding this comment.
Download Sum Includes Deleted
sum_agent_repository_downloads_by_agent_ids sums downloads across ALL rows including soft-deleted and non-shared. Should exclude deleted/non-active listings.
| @@ -0,0 +1,418 @@ | |||
| "use client"; | |||
There was a problem hiding this comment.
API Field Mismatch
Frontend AgentRepositoryCopyDialog expects detail.duplicate_skills but backend returns detail.duplicate_names. Skill duplicate errors won't display properly.
| @@ -25,15 +25,25 @@ export interface AgentRepositoryListingItem { | |||
| submitted_by?: string | null; | |||
There was a problem hiding this comment.
Duplicate Interface
frontend/types/agentRepository.ts has duplicate AgentRepositoryListingCreatePayload interface definition. Second definition should be removed.
| @@ -1,18 +1,23 @@ | |||
| "use client"; | |||
There was a problem hiding this comment.
Arbitrary Limit
MineApplyListingModal fetches listings with page_size:100. If agent has >100 listings, prefill may miss entries. Should use unbounded query or justify limit.














No description provided.