feat(agents): 支持自定义 MCP 服务器配置 - #218
Conversation
…e-agent-web-ui # Conflicts: # web/src/features/managed-agents/ManagedAgentsPage.agents.suite.tsx # web/src/features/managed-agents/agents/create-dialog.tsx
|
Warning Review limit reached
Next review available in: 34 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Create/Edit Agent editor now supports Directory and custom MCP selection, validates MCP inputs and duplicate toolsets, preserves existing custom tools, updates Directory icon fallbacks, and expands localized integration and test coverage. ChangesAgent editor
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant AgentEditor
participant CreateDialogMcpPicker
participant DraftModel
participant AgentAPI
AgentEditor->>CreateDialogMcpPicker: open Directory or Custom MCP picker
CreateDialogMcpPicker->>DraftModel: validate MCP name and URL
DraftModel-->>CreateDialogMcpPicker: return server and matching toolset
CreateDialogMcpPicker-->>AgentEditor: update rendered draft
AgentEditor->>AgentAPI: save serialized MCP configuration
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/src/features/managed-agents/agentConfig.ts (1)
402-413: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winModel-generated
multiagentreaches a throwing parser without validation.quickstartBuildAgentConfigInputcasts an arbitrary record toAgentMultiagentInput. That value flows intoreplaceDraft, which callsnormalizeCreateAgentDraft.normalizeCreateAgentDraftusescreateAgentDraftSchema.parseand throws aZodError. The user then sees a raw Zod message in the create dialog.
web/src/features/managed-agents/agentConfig.ts#L402-L413: validate the record withmultiagentSchemabefore returning it, or omit the field when it does not match.web/src/features/managed-agents/agents/create-dialog-model.ts#L192-L206: add asafeParse-based variant that returns a typed failure, so callers that accept untrusted configuration do not depend on exceptions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agentConfig.ts` around lines 402 - 413, Validate the derived multiagent record with multiagentSchema before returning it from quickstartBuildAgentConfigInput, omitting it when validation fails instead of casting arbitrary data. In web/src/features/managed-agents/agents/create-dialog-model.ts lines 192-206, add a safeParse-based normalization variant that returns a typed failure for untrusted configuration, and update the relevant callers to use it rather than relying on thrown ZodError exceptions.
🧹 Nitpick comments (10)
web/src/features/managed-agents/agents/use-create-agent-draft.ts (1)
7-10: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueNormalize the initial draft once.
Line 7 and Line 10 each call
normalizeCreateAgentDraft(initialDraft). Each call runs a full schema parse and a deep clone. Compute the value once and reuse it.♻️ Proposed refactor
- const [draft, setDraftState] = useState(() => normalizeCreateAgentDraft(initialDraft)); + const [draft, setDraftState] = useState(() => normalizeCreateAgentDraft(initialDraft)); const [view, setViewState] = useState<CreateAgentView>('rendered'); const [format, setFormatState] = useState<CodeFormat>('YAML'); - const [rawText, setRawText] = useState(() => createAgentConfigText(normalizeCreateAgentDraft(initialDraft), 'YAML')); + const [rawText, setRawText] = useState(() => createAgentConfigText(draft, 'YAML'));Note:
draftis declared beforerawText, so the lazy initializer can read it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/use-create-agent-draft.ts` around lines 7 - 10, Normalize initialDraft once in the useCreateAgentDraft initialization flow, store the result via the existing draft state initializer, and reuse draft when initializing rawText instead of calling normalizeCreateAgentDraft again. Preserve the current YAML format and state behavior.web/src/features/managed-agents/agents/create-dialog-model.ts (2)
192-206: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win
normalizeCreateAgentDraftthrows on invalid input.Line 193 calls
createAgentDraftSchema.parse, which throws aZodError.replaceDraftinuse-create-agent-draft.ts(Line 29) calls it with model-generated configuration fromgenerateCreateAgentConfig. That value is not validated before the call. The generate path catches the error, but the user then sees a raw Zod message instead of a configuration error. Consider asafeParsevariant that returns a typed failure, or validate beforereplaceDraft.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/create-dialog-model.ts` around lines 192 - 206, Update normalizeCreateAgentDraft and the generateCreateAgentConfig-to-replaceDraft flow so invalid generated configuration is handled as a typed validation failure instead of allowing createAgentDraftSchema.parse to throw a raw ZodError. Prefer safeParse or equivalent validation, and ensure replaceDraft receives only validated data while preserving the existing configuration-error handling.
135-135: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReplace the deprecated
.passthrough()call.This file depends on Zod 4 (
web/package.json: zod: ^4.4.3andweb/bun.lock: zod@4.4.3). In Zod 4, usez.looseObject()instead of.passthrough()to avoid the deprecation path.♻️ Proposed refactor
- input_schema: z.object({ type: z.literal('object') }).passthrough(), + input_schema: z.looseObject({ type: z.literal('object') }),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/create-dialog-model.ts` at line 135, Update the input_schema definition to replace the deprecated z.object(...).passthrough() usage with the Zod 4 z.looseObject() API, preserving the existing object type constraint and acceptance of additional fields.web/src/features/managed-agents/agents/use-agent-edit-draft.ts (2)
33-40: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win
renderedAgentEditDraftruns on every render.Line 33 calls
renderedAgentEditDraft(initialConfig)in the component body. The result is consumed only by theuseStateinitializers on Lines 35-37, which ignore it after mount. Each subsequent render still performs a full schema parse, a normalization, and a deep clone. Wrap the call inuseMemo, or move it into a single lazy initializer.♻️ Proposed refactor
- const initialRendered = renderedAgentEditDraft(initialConfig); + const initialRendered = useMemo(() => renderedAgentEditDraft(initialConfig), [initialConfig]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/use-agent-edit-draft.ts` around lines 33 - 40, Memoize the initial rendered draft computation around renderedAgentEditDraft(initialConfig) so it is not re-run on every render. Preserve the existing initial state behavior for renderedDraft, renderedError, and view, and ensure the memoization dependencies reflect when initialConfig changes.
99-114: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
selectFormatandvalidateRawTextduplicateuse-create-agent-draft.ts.These two callbacks, plus the issue-formatting logic at Lines 46-51, are near-identical to
use-create-agent-draft.tsLines 71-86 and Lines 15-20. Only the codec function differs. The repository sets a 1.1% duplicate-code budget for frontend production code. Extract the shared parts into a helper that takes the codec functions.As per coding guidelines: "修改生产 TypeScript/TSX 后运行
bun run lint:duplicates;前端生产代码重复率上限为 1.1%,不得通过扩大 ignore、提高阈值或机械改名绕过检查。"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/use-agent-edit-draft.ts` around lines 99 - 114, Extract the duplicated format-selection, raw-text validation, and issue-formatting logic shared by useAgentEditDraft and useCreateAgentDraft into a reusable helper that accepts the respective codec functions, then update both hooks to use it while preserving their current behavior. Run bun run lint:duplicates and resolve any reported duplication without changing ignore settings or thresholds.Source: Coding guidelines
web/src/features/managed-agents/agents/create-dialog-model.test.ts (1)
110-127: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd raw-path coverage for the URL rules.
Lines 121-126 verify that
addMcpServerrejects credentials and fragments. No test verifiescreateAgentDraftSchemafor the same URLs. The Raw editor validates only through the schema, so this gap hides the mismatch reported oncreate-dialog-model.tsLine 90. Add the same URLs to theinvalidDraftslist at Line 232 after the schema is fixed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/create-dialog-model.test.ts` around lines 110 - 127, The existing raw-editor draft validation does not cover rejecting MCP URLs with credentials or fragments. Update createAgentDraftSchema to apply the same invalid-URL rules, then add drafts using https://user:secret@example.com/mcp and https://example.com/mcp#tools to the invalidDrafts list, preserving the expected schema rejection behavior.web/src/features/managed-agents/agents/create-dialog-api.ts (1)
31-62: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winAdd a maximum page count to the skills pagination loop.
listCreateAgentSkillsonly stops when the API omitsnext_pageor repeats a cursor. If the backend returns a long chain of unique cursors, this loop issues unbounded sequential requests on the create-dialog path.searchAgentsByNameinweb/src/features/managed-agents/api.tsalready caps pages withagentSearchMaxPages. Apply the same bound here.♻️ Proposed page cap
+const skillsMaxPages = 50; + export async function listCreateAgentSkills(workspaceId: string): Promise<AgentSkillOption[]> { const rows: AgentSkillOption[] = []; let page: string | undefined; const seenPages = new Set<string>(); - while (true) { + for (let pageCount = 0; pageCount < skillsMaxPages; pageCount += 1) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/create-dialog-api.ts` around lines 31 - 62, Update listCreateAgentSkills to enforce the existing agentSearchMaxPages-style maximum page bound during skills pagination. Track the number of fetched pages and stop or throw once the configured cap is reached, while preserving termination on missing next_page and repeated cursors.web/src/features/managed-agents/agents/create-dialog-rendered.tsx (1)
69-76: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winReplace the manual
focuslistener with TanStack Query focus refetching.This effect refetches the subagents and skills queries on every window focus. It ignores
staleTimeand runs even when the picker is closed, so it issues extra requests on each tab switch. TanStack Query already refetches on window focus through its focus manager. SetrefetchOnWindowFocuson the two queries instead.♻️ Proposed refactor
- const refetchAgents = agentsQuery.refetch; - const refetchSkills = skillsQuery.refetch; - - useEffect(() => { - const refresh = () => { - void refetchAgents(); - void refetchSkills(); - }; - window.addEventListener('focus', refresh); - return () => window.removeEventListener('focus', refresh); - }, [refetchAgents, refetchSkills]); -Add the option to both queries:
const agentsQuery = useQuery({ queryKey: ['agent-config', 'subagents', workspaceId, debouncedAgentSearch.trim()], queryFn: () => searchCreateAgentSubagents(workspaceId, debouncedAgentSearch), retry: false, refetchOnWindowFocus: true, });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/create-dialog-rendered.tsx` around lines 69 - 76, Remove the manual window focus useEffect and its refresh listener, then configure both the agents and skills useQuery calls with refetchOnWindowFocus: true. Preserve their existing query keys, query functions, and other options.web/src/features/managed-agents/agents/tools/RemoteServerIcon.test.tsx (1)
25-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd cases for rejected and absent URLs.
The suite covers the fallback chain well. Two branches of
remoteServerIconCandidatesstay uncovered:
- No
iconUrland noserverUrl. The component must render theServericon and noimg.- A non-HTTP value, for example
file:///icon.png.parseHTTPURLmust reject it, so noimgis rendered.These cases protect the URL protocol guard against future edits.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/tools/RemoteServerIcon.test.tsx` around lines 25 - 46, Add tests for RemoteServerIcon covering both missing iconUrl/serverUrl and a non-HTTP serverUrl such as file:///icon.png. Verify each case renders no img and displays the Server icon, exercising the rejected and absent branches of remoteServerIconCandidates and parseHTTPURL.web/src/features/managed-agents/agents/create-dialog-picker.tsx (1)
24-67: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReuse
CreateDialogPickerListPropsinCreateDialogPicker.The inline props of
CreateDialogPickerrepeat all ten members ofCreateDialogPickerListProps. Extend the exported type instead. This keeps both components in sync when the list contract changes.♻️ Proposed refactor
-}: { - label: string; - placeholder: string; - searchPlaceholder: string; - emptyLabel: string; - options: CreateDialogPickerOption[]; - selectedIds: string[]; - loading?: boolean; - error?: boolean; - onRetry?: () => void; - onToggle: (id: string) => void; - searchValue?: string; - onSearchChange?: (value: string) => void; - createLabel?: string; - onCreate?: () => void; -}) { +}: CreateDialogPickerListProps & { + label: string; + placeholder: string; + createLabel?: string; + onCreate?: () => void; +}) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/features/managed-agents/agents/create-dialog-picker.tsx` around lines 24 - 67, Update the CreateDialogPicker props declaration to extend or reuse the exported CreateDialogPickerListProps type instead of redeclaring its shared members inline. Keep only the picker-specific createLabel and onCreate fields in the component’s additional props so both component contracts stay synchronized.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/src/features/managed-agents/agents/create-dialog-model.ts`:
- Around line 229-248: Update toggleSkill to preserve the original draft.skills
entries when adding or removing a skill, rather than rebuilding them from
selectedSkillReferences and introducing default versions. Use
selectedSkillReferences only to determine whether the toggled skill exists, then
filter the original entries by skill ID when removing or append the new skill
reference when adding.
- Around line 90-96: The MCP server schema accepts URLs that the rendered-picker
validation rejects; update mcpServerSchema to validate the URL with isHTTPURL
via a z.string().max(2048).refine(...) rule, preserving the required HTTP/HTTPS,
no-credentials, and no-fragment behavior. In
web/src/features/managed-agents/agents/create-dialog-model.ts lines 90-96, make
this schema change; in
web/src/features/managed-agents/agents/create-dialog-model.test.ts lines
110-127, add ftp://internal.example/mcp, https://user:secret@example.com/mcp,
and https://example.com/mcp#tools to invalidDrafts so the raw schema path is
covered.
In `@web/src/features/managed-agents/agents/create-dialog-tools-editor.tsx`:
- Around line 368-381: Update the input schema editor around schemaText and its
Textarea onChange handler to maintain the raw user-entered text in local state,
rather than deriving and re-stringifying it from tool.input_schema on every
render. Publish parsed JSON when valid and the raw text when invalid, while
preserving the visible text exactly as entered so typing and pasting do not
reformat or move the caret.
In `@web/src/features/managed-agents/agents/tools/RemoteServerIcon.tsx`:
- Around line 50-59: Update remoteServerIconCandidates to remove both
publicFaviconCandidate calls, preventing user-configured MCP server hostnames
from being sent to Google. Preserve the remaining directory and origin favicon
candidates, allowing the existing Server icon fallback to handle cases where
they are unavailable.
In `@web/src/features/managed-agents/ManagedAgentsPage.test-utils.tsx`:
- Around line 70-76: The model fixture is seeded under the hard-coded "default"
workspace key while CreateAgentDialog reads the workspace-specific query key.
Update renderManagedAgentsPage and its test utilities to seed
MockAgentsApiOptions.models under the provided workspaceId, or configure
queries.staleTime to 0 so the API fixture controls the result; preserve existing
defaults when no custom models are supplied.
---
Outside diff comments:
In `@web/src/features/managed-agents/agentConfig.ts`:
- Around line 402-413: Validate the derived multiagent record with
multiagentSchema before returning it from quickstartBuildAgentConfigInput,
omitting it when validation fails instead of casting arbitrary data. In
web/src/features/managed-agents/agents/create-dialog-model.ts lines 192-206, add
a safeParse-based normalization variant that returns a typed failure for
untrusted configuration, and update the relevant callers to use it rather than
relying on thrown ZodError exceptions.
---
Nitpick comments:
In `@web/src/features/managed-agents/agents/create-dialog-api.ts`:
- Around line 31-62: Update listCreateAgentSkills to enforce the existing
agentSearchMaxPages-style maximum page bound during skills pagination. Track the
number of fetched pages and stop or throw once the configured cap is reached,
while preserving termination on missing next_page and repeated cursors.
In `@web/src/features/managed-agents/agents/create-dialog-model.test.ts`:
- Around line 110-127: The existing raw-editor draft validation does not cover
rejecting MCP URLs with credentials or fragments. Update createAgentDraftSchema
to apply the same invalid-URL rules, then add drafts using
https://user:secret@example.com/mcp and https://example.com/mcp#tools to the
invalidDrafts list, preserving the expected schema rejection behavior.
In `@web/src/features/managed-agents/agents/create-dialog-model.ts`:
- Around line 192-206: Update normalizeCreateAgentDraft and the
generateCreateAgentConfig-to-replaceDraft flow so invalid generated
configuration is handled as a typed validation failure instead of allowing
createAgentDraftSchema.parse to throw a raw ZodError. Prefer safeParse or
equivalent validation, and ensure replaceDraft receives only validated data
while preserving the existing configuration-error handling.
- Line 135: Update the input_schema definition to replace the deprecated
z.object(...).passthrough() usage with the Zod 4 z.looseObject() API, preserving
the existing object type constraint and acceptance of additional fields.
In `@web/src/features/managed-agents/agents/create-dialog-picker.tsx`:
- Around line 24-67: Update the CreateDialogPicker props declaration to extend
or reuse the exported CreateDialogPickerListProps type instead of redeclaring
its shared members inline. Keep only the picker-specific createLabel and
onCreate fields in the component’s additional props so both component contracts
stay synchronized.
In `@web/src/features/managed-agents/agents/create-dialog-rendered.tsx`:
- Around line 69-76: Remove the manual window focus useEffect and its refresh
listener, then configure both the agents and skills useQuery calls with
refetchOnWindowFocus: true. Preserve their existing query keys, query functions,
and other options.
In `@web/src/features/managed-agents/agents/tools/RemoteServerIcon.test.tsx`:
- Around line 25-46: Add tests for RemoteServerIcon covering both missing
iconUrl/serverUrl and a non-HTTP serverUrl such as file:///icon.png. Verify each
case renders no img and displays the Server icon, exercising the rejected and
absent branches of remoteServerIconCandidates and parseHTTPURL.
In `@web/src/features/managed-agents/agents/use-agent-edit-draft.ts`:
- Around line 33-40: Memoize the initial rendered draft computation around
renderedAgentEditDraft(initialConfig) so it is not re-run on every render.
Preserve the existing initial state behavior for renderedDraft, renderedError,
and view, and ensure the memoization dependencies reflect when initialConfig
changes.
- Around line 99-114: Extract the duplicated format-selection, raw-text
validation, and issue-formatting logic shared by useAgentEditDraft and
useCreateAgentDraft into a reusable helper that accepts the respective codec
functions, then update both hooks to use it while preserving their current
behavior. Run bun run lint:duplicates and resolve any reported duplication
without changing ignore settings or thresholds.
In `@web/src/features/managed-agents/agents/use-create-agent-draft.ts`:
- Around line 7-10: Normalize initialDraft once in the useCreateAgentDraft
initialization flow, store the result via the existing draft state initializer,
and reuse draft when initializing rawText instead of calling
normalizeCreateAgentDraft again. Preserve the current YAML format and state
behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4da66c85-fe68-4896-badf-015076e21e7a
📒 Files selected for processing (29)
docs/design/fe/agent/create-agent-editor.mddocs/design/fe/agent/edit-agent-editor.mdweb/src/features/managed-agents/ManagedAgentsPage.agents.suite.tsxweb/src/features/managed-agents/ManagedAgentsPage.quickstart.suite.tsxweb/src/features/managed-agents/ManagedAgentsPage.test-utils.tsxweb/src/features/managed-agents/agentConfig.test.tsweb/src/features/managed-agents/agentConfig.tsweb/src/features/managed-agents/agents/AgentsResourcePage.tsxweb/src/features/managed-agents/agents/create-dialog-api.tsweb/src/features/managed-agents/agents/create-dialog-mcp-picker.tsxweb/src/features/managed-agents/agents/create-dialog-model.test.tsweb/src/features/managed-agents/agents/create-dialog-model.tsweb/src/features/managed-agents/agents/create-dialog-picker.tsxweb/src/features/managed-agents/agents/create-dialog-rendered.tsxweb/src/features/managed-agents/agents/create-dialog-tools-editor.tsxweb/src/features/managed-agents/agents/create-dialog.tsxweb/src/features/managed-agents/agents/detail.tsxweb/src/features/managed-agents/agents/tools/AgentToolsSection.tsxweb/src/features/managed-agents/agents/tools/RemoteServerIcon.test.tsxweb/src/features/managed-agents/agents/tools/RemoteServerIcon.tsxweb/src/features/managed-agents/agents/tools/model.tsweb/src/features/managed-agents/agents/use-agent-edit-draft.test.tsweb/src/features/managed-agents/agents/use-agent-edit-draft.tsweb/src/features/managed-agents/agents/use-create-agent-draft.tsweb/src/features/managed-agents/types.tsweb/src/shared/api/anthropic.test.tsweb/src/shared/api/anthropic.tsweb/src/shared/i18n/messages/en.jsonweb/src/shared/i18n/messages/zh-CN.json
💤 Files with no reviewable changes (1)
- web/src/features/managed-agents/agents/tools/model.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88e4c7e0aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…to codex/issue-217-custom-mcp-server # Conflicts: # docs/design/fe/agent/create-agent-editor.md # docs/design/fe/agent/edit-agent-editor.md # web/src/features/managed-agents/ManagedAgentsPage.agents.suite.tsx # web/src/features/managed-agents/agents/create-dialog-model.test.ts # web/src/features/managed-agents/agents/create-dialog-model.ts # web/src/features/managed-agents/agents/create-dialog-picker.tsx # web/src/features/managed-agents/agents/create-dialog-tools-editor.tsx # web/src/shared/i18n/messages/en.json # web/src/shared/i18n/messages/zh-CN.json
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/design/fe/agent/create-agent-editor.md`:
- Line 39: Update the MCP constraints statement in the design document to
require case-sensitive uniqueness for custom names within the current Agent,
limit names to 255 characters, limit URLs to 2048 characters, and limit each
Agent to 20 MCP servers. Preserve the existing atomic add/delete requirement and
URL validity restrictions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5c0fe39b-2181-40a9-b8fb-47c19400ab2f
📒 Files selected for processing (13)
docs/design/fe/agent/create-agent-editor.mddocs/design/fe/agent/edit-agent-editor.mdweb/src/features/managed-agents/ManagedAgentsPage.agents.suite.tsxweb/src/features/managed-agents/ManagedAgentsPage.test-utils.test.tsxweb/src/features/managed-agents/ManagedAgentsPage.test-utils.tsxweb/src/features/managed-agents/agents/create-dialog-mcp-picker.tsxweb/src/features/managed-agents/agents/create-dialog-model.test.tsweb/src/features/managed-agents/agents/create-dialog-model.tsweb/src/features/managed-agents/agents/create-dialog-tools-editor.tsxweb/src/features/managed-agents/agents/tools/AgentToolsSection.tsxweb/src/features/managed-agents/agents/tools/RemoteServerIcon.test.tsxweb/src/features/managed-agents/agents/tools/RemoteServerIcon.tsxweb/src/features/managed-agents/agents/use-agent-edit-draft.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- web/src/features/managed-agents/agents/tools/AgentToolsSection.tsx
- web/src/features/managed-agents/agents/use-agent-edit-draft.test.ts
- docs/design/fe/agent/edit-agent-editor.md
- web/src/features/managed-agents/agents/create-dialog-tools-editor.tsx
- web/src/features/managed-agents/agents/create-dialog-mcp-picker.tsx

变更摘要
mcp_servers与同名mcp_toolset,默认权限为always_ask测试
./scripts/pre-commit.sh run check-added-large-files --all-filescd web && bun test(419 pass)cd web && bun run buildcd web && bun run format:check已知问题
./scripts/pre-commit.sh run --all-files仍受已跟踪的web/node_modules/flatted/golang/pkg/flatted/flatted.go两条既有 govet inline 告警影响;与本次前端改动无关,近期 PR Complete Yourbatis migration and remove sqlx #209 已记录同一问题依赖
Closes #217
Summary by CodeRabbit
New Features
Bug Fixes