Unverified 提交 d67d5a0d authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Graduate local agent from experiment (#2173)

<!-- CURSOR_SUMMARY --> > [!NOTE] > Graduates the local agent feature from experiment and simplifies related settings and tests. > > - Agent v2 (local-agent) is now available to all Pro users by removing `experiments.enableLocalAgent` gating in `ChatModeSelector` > - Always render the "Agent Permissions (Pro)" section in Settings and remove the "Enable Agent v2" experiment toggle > - `SettingsList` no longer filters sections by settings; always includes `agent-permissions` > - Mark `experiments.enableLocalAgent` as DEPRECATED in the schema > - E2E: stop toggling local agent in setup; retain model selection logic for local-agent scenarios > - Minor: adjust test fixture name regex in fake LLM responses handler > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 39bdf8ef4bea64909bb5cd623e1fdd559d156692. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Graduate the Local Agent (Agent v2) from the experiments flag. It’s now available to Pro users by default and the settings reflect this. - **Refactors** - Show Local Agent in ChatModeSelector for Pro without experiment gating. - Always show the Agent Permissions section; label updated to “Agent Permissions (Pro)”. - Removed the “Enable Agent v2” toggle from Experiments. - Marked experiments.enableLocalAgent as DEPRECATED in the schema. - Cleaned up e2e helper to stop toggling local agent mode; minor test regex fix. - **Migration** - No action needed. The old experiments.enableLocalAgent flag is ignored. <sup>Written for commit 39bdf8ef4bea64909bb5cd623e1fdd559d156692. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
上级 ec9b5ede
...@@ -326,9 +326,6 @@ export class PageObject { ...@@ -326,9 +326,6 @@ export class PageObject {
if (autoApprove) { if (autoApprove) {
await this.toggleAutoApprove(); await this.toggleAutoApprove();
} }
if (localAgent) {
await this.toggleLocalAgentMode();
}
await this.setUpDyadProvider(); await this.setUpDyadProvider();
await this.goToAppsTab(); await this.goToAppsTab();
// Select a non-openAI model for local agent mode, // Select a non-openAI model for local agent mode,
......
...@@ -183,13 +183,17 @@ ...@@ -183,13 +183,17 @@
{ {
"type": "function", "type": "function",
"name": "list_files", "name": "list_files",
"description": "List all files in the application directory recursively. If you are not sure, list all files by omitting the directory parameter.", "description": "List files in the application directory. By default, lists only the immediate directory contents. Use recursive=true to list all files recursively. If you are not sure, list all files by omitting the directory parameter.",
"parameters": { "parameters": {
"type": "object", "type": "object",
"properties": { "properties": {
"directory": { "directory": {
"type": "string", "type": "string",
"description": "Optional subdirectory to list" "description": "Optional subdirectory to list"
},
"recursive": {
"type": "boolean",
"description": "Whether to list files recursively (default: false)"
} }
}, },
"additionalProperties": false, "additionalProperties": false,
......
...@@ -141,7 +141,7 @@ export function ChatModeSelector() { ...@@ -141,7 +141,7 @@ export function ChatModeSelector() {
</span> </span>
</div> </div>
</SelectItem> </SelectItem>
{isProEnabled && settings?.experiments?.enableLocalAgent && ( {isProEnabled && (
<SelectItem value="local-agent"> <SelectItem value="local-agent">
<div className="flex flex-col items-start"> <div className="flex flex-col items-start">
<div className="flex items-center gap-1.5"> <div className="flex items-center gap-1.5">
......
import { ScrollArea } from "@/components/ui/scroll-area"; import { ScrollArea } from "@/components/ui/scroll-area";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { useEffect, useMemo } from "react"; import { useEffect } from "react";
import { useScrollAndNavigateTo } from "@/hooks/useScrollAndNavigateTo"; import { useScrollAndNavigateTo } from "@/hooks/useScrollAndNavigateTo";
import { useAtom } from "jotai"; import { useAtom } from "jotai";
import { activeSettingsSectionAtom } from "@/atoms/viewAtoms"; import { activeSettingsSectionAtom } from "@/atoms/viewAtoms";
import { useSettings } from "@/hooks/useSettings";
import type { UserSettings } from "@/lib/schemas";
type SettingsSection = { type SettingsSection = {
id: string; id: string;
label: string; label: string;
isEnabled?: (settings: UserSettings | null) => boolean;
}; };
const SETTINGS_SECTIONS: SettingsSection[] = [ const SETTINGS_SECTIONS: SettingsSection[] = [
...@@ -23,7 +20,6 @@ const SETTINGS_SECTIONS: SettingsSection[] = [ ...@@ -23,7 +20,6 @@ const SETTINGS_SECTIONS: SettingsSection[] = [
{ {
id: "agent-permissions", id: "agent-permissions",
label: "Agent Permissions", label: "Agent Permissions",
isEnabled: (settings) => !!settings?.experiments?.enableLocalAgent,
}, },
{ id: "tools-mcp", label: "Tools (MCP)" }, { id: "tools-mcp", label: "Tools (MCP)" },
{ id: "experiments", label: "Experiments" }, { id: "experiments", label: "Experiments" },
...@@ -32,17 +28,13 @@ const SETTINGS_SECTIONS: SettingsSection[] = [ ...@@ -32,17 +28,13 @@ const SETTINGS_SECTIONS: SettingsSection[] = [
export function SettingsList({ show }: { show: boolean }) { export function SettingsList({ show }: { show: boolean }) {
const [activeSection, setActiveSection] = useAtom(activeSettingsSectionAtom); const [activeSection, setActiveSection] = useAtom(activeSettingsSectionAtom);
const { settings } = useSettings();
const scrollAndNavigateTo = useScrollAndNavigateTo("/settings", { const scrollAndNavigateTo = useScrollAndNavigateTo("/settings", {
behavior: "smooth", behavior: "smooth",
block: "start", block: "start",
}); });
const settingsSections = useMemo(() => { const settingsSections = SETTINGS_SECTIONS;
return SETTINGS_SECTIONS.filter(
(section) => !section.isEnabled || section.isEnabled(settings ?? null),
);
}, [settings]);
useEffect(() => { useEffect(() => {
const observer = new IntersectionObserver( const observer = new IntersectionObserver(
......
...@@ -192,8 +192,8 @@ export const NeonSchema = z.object({ ...@@ -192,8 +192,8 @@ export const NeonSchema = z.object({
export type Neon = z.infer<typeof NeonSchema>; export type Neon = z.infer<typeof NeonSchema>;
export const ExperimentsSchema = z.object({ export const ExperimentsSchema = z.object({
enableLocalAgent: z.boolean().optional(),
// Deprecated // Deprecated
enableLocalAgent: z.boolean().describe("DEPRECATED").optional(),
enableSupabaseIntegration: z.boolean().describe("DEPRECATED").optional(), enableSupabaseIntegration: z.boolean().describe("DEPRECATED").optional(),
enableFileEditing: z.boolean().describe("DEPRECATED").optional(), enableFileEditing: z.boolean().describe("DEPRECATED").optional(),
}); });
......
...@@ -131,17 +131,16 @@ export default function SettingsPage() { ...@@ -131,17 +131,16 @@ export default function SettingsPage() {
</div> </div>
{/* Agent v2 Permissions */} {/* Agent v2 Permissions */}
{settings?.experiments?.enableLocalAgent && (
<div <div
id="agent-permissions" id="agent-permissions"
className="bg-white dark:bg-gray-800 rounded-xl shadow-sm p-6" className="bg-white dark:bg-gray-800 rounded-xl shadow-sm p-6"
> >
<h2 className="text-lg font-medium text-gray-900 dark:text-white mb-4"> <h2 className="text-lg font-medium text-gray-900 dark:text-white mb-4">
Agent Permissions Agent Permissions (Pro)
</h2> </h2>
<AgentToolsSettings /> <AgentToolsSettings />
</div> </div>
)}
{/* Tools (MCP) */} {/* Tools (MCP) */}
<div <div
...@@ -181,27 +180,6 @@ export default function SettingsPage() { ...@@ -181,27 +180,6 @@ export default function SettingsPage() {
a faster, native-Git performance experience. a faster, native-Git performance experience.
</div> </div>
</div> </div>
<div className="space-y-1 mt-4">
<div className="flex items-center space-x-2">
<Switch
id="enable-local-agent"
checked={!!settings?.experiments?.enableLocalAgent}
onCheckedChange={(checked) => {
updateSettings({
experiments: {
...settings?.experiments,
enableLocalAgent: checked,
},
});
}}
/>
<Label htmlFor="enable-local-agent">Enable Agent v2</Label>
</div>
<div className="text-sm text-gray-500 dark:text-gray-400">
Enables the local agent with enhanced capabilities and tool
permissions.
</div>
</div>
</div> </div>
</div> </div>
......
...@@ -91,7 +91,7 @@ function extractTestCaseName(promptText: string): string | null { ...@@ -91,7 +91,7 @@ function extractTestCaseName(promptText: string): string | null {
// - "tc=foo" // - "tc=foo"
// - "[dump] tc=foo" // - "[dump] tc=foo"
// Stops at "[" to mimic existing fixture naming convention. // Stops at "[" to mimic existing fixture naming convention.
const m = promptText.match(/(?:^|\s)tc=([^\[]+)/); const m = promptText.match(/(?:^|\s)tc=([^[]+)/);
if (!m) return null; if (!m) return null;
return m[1].trim().split(/\s+/)[0] || null; return m[1].trim().split(/\s+/)[0] || null;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论