From 984d368f7ac024919a1707ceb632a2ddd5d1369b Mon Sep 17 00:00:00 2001 From: Chris Estreich Date: Tue, 22 Jul 2025 09:18:38 -0700 Subject: [PATCH 01/28] Fix evals; broken by #5865 (#6065) --- apps/web-evals/scripts/check-services.sh | 4 +- apps/web-evals/src/app/runs/new/new-run.tsx | 4 +- package.json | 2 +- packages/evals/package.json | 11 +- .../migrations/0001_lowly_captain_flint.sql | 1 + .../src/db/migrations/meta/0001_snapshot.json | 417 ++++++++++++++++++ .../src/db/migrations/meta/_journal.json | 7 + 7 files changed, 436 insertions(+), 10 deletions(-) create mode 100644 packages/evals/src/db/migrations/0001_lowly_captain_flint.sql create mode 100644 packages/evals/src/db/migrations/meta/0001_snapshot.json diff --git a/apps/web-evals/scripts/check-services.sh b/apps/web-evals/scripts/check-services.sh index fd1e74997c..104a472208 100755 --- a/apps/web-evals/scripts/check-services.sh +++ b/apps/web-evals/scripts/check-services.sh @@ -7,13 +7,13 @@ fi if ! nc -z localhost 5432 2>/dev/null; then echo "❌ PostgreSQL is not running on port 5432" - echo "💡 Start it with: pnpm --filter @roo-code/evals db:start" + echo "💡 Start it with: pnpm --filter @roo-code/evals db:up" exit 1 fi if ! nc -z localhost 6379 2>/dev/null; then echo "❌ Redis is not running on port 6379" - echo "💡 Start it with: pnpm --filter @roo-code/evals redis:start" + echo "💡 Start it with: pnpm --filter @roo-code/evals redis:up" exit 1 fi diff --git a/apps/web-evals/src/app/runs/new/new-run.tsx b/apps/web-evals/src/app/runs/new/new-run.tsx index 90717d6fec..f8633611b6 100644 --- a/apps/web-evals/src/app/runs/new/new-run.tsx +++ b/apps/web-evals/src/app/runs/new/new-run.tsx @@ -350,7 +350,7 @@ export function NewRun() { name="timeout" render={({ field }) => ( - Timeout (minutes) + Timeout (Minutes)
field.onChange(value[0])} /> -
{field.value} min
+
{field.value}
diff --git a/package.json b/package.json index 61f1f6cdaf..99becf0a0c 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "changeset:version": "cp CHANGELOG.md src/CHANGELOG.md && changeset version && cp -vf src/CHANGELOG.md .", "knip": "knip --include files", "update-contributors": "node scripts/update-contributors.js", - "evals": "docker compose -f packages/evals/docker-compose.yml --profile server --profile runner up --build --scale runner=0" + "evals": "dotenvx run -f packages/evals/.env.development packages/evals/.env.local -- docker compose -f packages/evals/docker-compose.yml --profile server --profile runner up --build --scale runner=0" }, "devDependencies": { "@changesets/cli": "^2.27.10", diff --git a/packages/evals/package.json b/packages/evals/package.json index 3d1cfb3e92..83690a99c4 100644 --- a/packages/evals/package.json +++ b/packages/evals/package.json @@ -18,11 +18,12 @@ "db:push": "pnpm drizzle-kit push", "db:test:push": "pnpm drizzle-kit:test push", "db:production:push": "pnpm drizzle-kit:production push", - "db:start": "docker compose up -d db", - "db:stop": "docker compose down db", - "redis:start": "docker compose up -d redis", - "redis:stop": "docker compose down redis", - "services:start": "docker compose up -d db redis" + "db:up": "dotenvx run -f .env.development .env.local -- docker compose up -d db", + "db:down": "dotenvx run -f .env.development .env.local -- docker compose down db", + "redis:up": "dotenvx run -f .env.development .env.local -- docker compose up -d redis", + "redis:down": "dotenvx run -f .env.development .env.local -- docker compose down redis", + "services:up": "dotenvx run -f .env.development .env.local -- docker compose up -d db redis", + "services:down": "dotenvx run -f .env.development .env.local -- docker compose down db redis" }, "dependencies": { "@roo-code/ipc": "workspace:^", diff --git a/packages/evals/src/db/migrations/0001_lowly_captain_flint.sql b/packages/evals/src/db/migrations/0001_lowly_captain_flint.sql new file mode 100644 index 0000000000..16d3cc1bdd --- /dev/null +++ b/packages/evals/src/db/migrations/0001_lowly_captain_flint.sql @@ -0,0 +1 @@ +ALTER TABLE "runs" ADD COLUMN "timeout" integer DEFAULT 5 NOT NULL; \ No newline at end of file diff --git a/packages/evals/src/db/migrations/meta/0001_snapshot.json b/packages/evals/src/db/migrations/meta/0001_snapshot.json new file mode 100644 index 0000000000..194fd6055c --- /dev/null +++ b/packages/evals/src/db/migrations/meta/0001_snapshot.json @@ -0,0 +1,417 @@ +{ + "id": "43b197c4-ff4f-48c1-908b-a330e66a162d", + "prevId": "b50d5e6a-0f3f-4605-a5e7-9351711fc5e4", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.runs": { + "name": "runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "runs_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "task_metrics_id": { + "name": "task_metrics_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "settings": { + "name": "settings", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "pid": { + "name": "pid", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "socket_path": { + "name": "socket_path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "concurrency": { + "name": "concurrency", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 2 + }, + "timeout": { + "name": "timeout", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "passed": { + "name": "passed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "failed": { + "name": "failed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "runs_task_metrics_id_taskMetrics_id_fk": { + "name": "runs_task_metrics_id_taskMetrics_id_fk", + "tableFrom": "runs", + "tableTo": "taskMetrics", + "columnsFrom": ["task_metrics_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.taskMetrics": { + "name": "taskMetrics", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "taskMetrics_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "tokens_in": { + "name": "tokens_in", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tokens_out": { + "name": "tokens_out", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tokens_context": { + "name": "tokens_context", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "cache_writes": { + "name": "cache_writes", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "cache_reads": { + "name": "cache_reads", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "duration": { + "name": "duration", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tool_usage": { + "name": "tool_usage", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tasks": { + "name": "tasks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "tasks_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "run_id": { + "name": "run_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "task_metrics_id": { + "name": "task_metrics_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "language": { + "name": "language", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "exercise": { + "name": "exercise", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passed": { + "name": "passed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "finished_at": { + "name": "finished_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "tasks_language_exercise_idx": { + "name": "tasks_language_exercise_idx", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "language", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "exercise", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tasks_run_id_runs_id_fk": { + "name": "tasks_run_id_runs_id_fk", + "tableFrom": "tasks", + "tableTo": "runs", + "columnsFrom": ["run_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "tasks_task_metrics_id_taskMetrics_id_fk": { + "name": "tasks_task_metrics_id_taskMetrics_id_fk", + "tableFrom": "tasks", + "tableTo": "taskMetrics", + "columnsFrom": ["task_metrics_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.toolErrors": { + "name": "toolErrors", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "toolErrors_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "run_id": { + "name": "run_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "task_id": { + "name": "task_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tool_name": { + "name": "tool_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "toolErrors_run_id_runs_id_fk": { + "name": "toolErrors_run_id_runs_id_fk", + "tableFrom": "toolErrors", + "tableTo": "runs", + "columnsFrom": ["run_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "toolErrors_task_id_tasks_id_fk": { + "name": "toolErrors_task_id_tasks_id_fk", + "tableFrom": "toolErrors", + "tableTo": "tasks", + "columnsFrom": ["task_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/evals/src/db/migrations/meta/_journal.json b/packages/evals/src/db/migrations/meta/_journal.json index b26aac5417..e20425b105 100644 --- a/packages/evals/src/db/migrations/meta/_journal.json +++ b/packages/evals/src/db/migrations/meta/_journal.json @@ -8,6 +8,13 @@ "when": 1748937674449, "tag": "0000_young_trauma", "breakpoints": true + }, + { + "idx": 1, + "version": "7", + "when": 1753198630651, + "tag": "0001_lowly_captain_flint", + "breakpoints": true } ] } From 5629199d5134850f80a9045458d34d9e6fa38f29 Mon Sep 17 00:00:00 2001 From: "roomote[bot]" <219738659+roomote[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:26:32 -0400 Subject: [PATCH 02/28] Add jump icon for newly created files (#5738) * feat: add jump icon for newly created files - Add jump icon to newFileCreated tool case in ChatRow.tsx - Matches existing pattern from readFile case for consistent UX - Allows users to quickly open newly created files - Fixes issue #5736 * fix: remove duplicate file path display in newFileCreated case - Removed redundant ToolUseBlock that was showing file path twice - Added onJumpToFile prop to CodeAccordian component to support jump icon - Jump icon now appears in CodeAccordian header for newFileCreated files - Maintains consistent UX with existing file operations while avoiding duplication Fixes feedback from @daniel-lxs about duplicate elements being shown * fix: address PR feedback for jump icon on new files - Fix openFile message to use correct path format with './' prefix - Remove duplicate chevron icon when jump icon is present - Add aria-label for accessibility - Fix styling: use mr-1 to match progressStatus icon - Remove redundant margin style from jump icon --------- Co-authored-by: Roo Code Co-authored-by: Roo Code Co-authored-by: Daniel Riccio --- webview-ui/src/components/chat/ChatRow.tsx | 1 + .../src/components/common/CodeAccordian.tsx | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 926bd400f0..4fa921f443 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -533,6 +533,7 @@ export const ChatRowContent = ({ isLoading={message.partial} isExpanded={isExpanded} onToggleExpand={handleToggleExpand} + onJumpToFile={() => vscode.postMessage({ type: "openFile", text: "./" + tool.path })} /> ) diff --git a/webview-ui/src/components/common/CodeAccordian.tsx b/webview-ui/src/components/common/CodeAccordian.tsx index b07461c70e..7dcef11e10 100644 --- a/webview-ui/src/components/common/CodeAccordian.tsx +++ b/webview-ui/src/components/common/CodeAccordian.tsx @@ -17,6 +17,7 @@ interface CodeAccordianProps { isFeedback?: boolean onToggleExpand: () => void header?: string + onJumpToFile?: () => void } const CodeAccordian = ({ @@ -29,6 +30,7 @@ const CodeAccordian = ({ isFeedback, onToggleExpand, header, + onJumpToFile, }: CodeAccordianProps) => { const inferredLanguage = useMemo(() => language ?? (path ? getLanguageFromPath(path) : "txt"), [path, language]) const source = useMemo(() => code.trim(), [code]) @@ -68,7 +70,18 @@ const CodeAccordian = ({ )} - + {onJumpToFile && path && ( + { + e.stopPropagation() + onJumpToFile() + }} + aria-label={`Open file: ${path}`} + /> + )} + {!onJumpToFile && } )} {(!hasHeader || isExpanded) && ( From dbde23c84e2191e6106e562a52d9ec60ea0d7efa Mon Sep 17 00:00:00 2001 From: "roomote[bot]" <219738659+roomote[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 14:15:28 -0700 Subject: [PATCH 03/28] fix: add case sensitivity mention to suggested fixes in apply_diff error message (#6076) Co-authored-by: Roo Code --- src/core/tools/multiApplyDiffTool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/tools/multiApplyDiffTool.ts b/src/core/tools/multiApplyDiffTool.ts index b41d409dbb..4ddef4880b 100644 --- a/src/core/tools/multiApplyDiffTool.ts +++ b/src/core/tools/multiApplyDiffTool.ts @@ -451,7 +451,7 @@ Diff ${i + 1} failed for file: ${relPath} Error: ${failPart.error} Suggested fixes: -1. Verify the search content exactly matches the file content (including whitespace) +1. Verify the search content exactly matches the file content (including whitespace and case) 2. Check for correct indentation and line endings 3. Use to see the current file content 4. Consider breaking complex changes into smaller diffs From 2b8228ef0c1459692798afae3f38f806d80f9d7d Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Tue, 22 Jul 2025 15:37:27 -0600 Subject: [PATCH 04/28] docs: clarify when to use update_todo_list tool (#5926) * docs: clarify when to use update_todo_list tool Added 'complicated' to the condition for when to use the update_todo_list tool, making it clearer that the tool should be used for tasks that are either complicated OR involve multiple steps. * fix: update vscode mock and snapshots for update_todo_list tool changes - Add missing RelativePattern export to vscode mock - Fix onDidChangeWorkspaceFolders function in workspace mock - Update test snapshots to reflect new "complicated" text in update_todo_list tool documentation - Build tree-sitter WASM files to fix parsing tests Fixes failing CI tests related to PR #5926 documentation changes. * Delete package-lock.json * revert: remove unrelated changes to src/__mocks__/vscode.js --------- Co-authored-by: Roo Code Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com> --- .../add-custom-instructions/architect-mode-prompt.snap | 2 +- .../__snapshots__/add-custom-instructions/ask-mode-prompt.snap | 2 +- .../add-custom-instructions/mcp-server-creation-disabled.snap | 2 +- .../add-custom-instructions/mcp-server-creation-enabled.snap | 2 +- .../add-custom-instructions/partial-reads-enabled.snap | 2 +- .../__snapshots__/system-prompt/consistent-system-prompt.snap | 2 +- .../__snapshots__/system-prompt/with-computer-use-support.snap | 2 +- .../__snapshots__/system-prompt/with-diff-enabled-false.snap | 2 +- .../__snapshots__/system-prompt/with-diff-enabled-true.snap | 2 +- .../system-prompt/with-diff-enabled-undefined.snap | 2 +- .../system-prompt/with-different-viewport-size.snap | 2 +- .../__snapshots__/system-prompt/with-mcp-hub-provided.snap | 2 +- .../__snapshots__/system-prompt/with-undefined-mcp-hub.snap | 2 +- src/core/prompts/tools/update-todo-list.ts | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap index 273e43d20b..632273dea0 100644 --- a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap +++ b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap @@ -420,7 +420,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap index a169a1f3af..09b6b04348 100644 --- a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap +++ b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap @@ -317,7 +317,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap index 273e43d20b..632273dea0 100644 --- a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap +++ b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap @@ -420,7 +420,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap index 8e1b90a1cf..7ca32b80a1 100644 --- a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap +++ b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap @@ -469,7 +469,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/partial-reads-enabled.snap b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/partial-reads-enabled.snap index 7ee1ab207f..7dce6219f3 100644 --- a/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/partial-reads-enabled.snap +++ b/src/core/prompts/__tests__/__snapshots__/add-custom-instructions/partial-reads-enabled.snap @@ -425,7 +425,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap index 273e43d20b..632273dea0 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap @@ -420,7 +420,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap index e23dc220b4..419049609e 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap @@ -473,7 +473,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-false.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-false.snap index 273e43d20b..632273dea0 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-false.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-false.snap @@ -420,7 +420,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-true.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-true.snap index ad90a58850..4390b95519 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-true.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-true.snap @@ -508,7 +508,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-undefined.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-undefined.snap index 273e43d20b..632273dea0 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-undefined.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-undefined.snap @@ -420,7 +420,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-different-viewport-size.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-different-viewport-size.snap index 005813848f..191816f180 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-different-viewport-size.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-different-viewport-size.snap @@ -473,7 +473,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-mcp-hub-provided.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-mcp-hub-provided.snap index 8e1b90a1cf..7ca32b80a1 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-mcp-hub-provided.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-mcp-hub-provided.snap @@ -469,7 +469,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-undefined-mcp-hub.snap b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-undefined-mcp-hub.snap index 273e43d20b..632273dea0 100644 --- a/src/core/prompts/__tests__/__snapshots__/system-prompt/with-undefined-mcp-hub.snap +++ b/src/core/prompts/__tests__/__snapshots__/system-prompt/with-undefined-mcp-hub.snap @@ -420,7 +420,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. diff --git a/src/core/prompts/tools/update-todo-list.ts b/src/core/prompts/tools/update-todo-list.ts index 528d5a1b51..30100617df 100644 --- a/src/core/prompts/tools/update-todo-list.ts +++ b/src/core/prompts/tools/update-todo-list.ts @@ -56,7 +56,7 @@ Replace the entire TODO list with an updated checklist reflecting the current st **When to Use:** -- The task involves multiple steps or requires ongoing tracking. +- The task is complicated or involves multiple steps or requires ongoing tracking. - You need to update the status of several todos at once. - New actionable items are discovered during task execution. - The user requests a todo list or provides multiple tasks. From c6a29f3f27e04a498fba1aa5634ca30d7be3d234 Mon Sep 17 00:00:00 2001 From: Murilo Pires <50873657+MuriloFP@users.noreply.github.com> Date: Tue, 22 Jul 2025 20:26:18 -0300 Subject: [PATCH 05/28] feat: add llama-4-maverick model to Vertex AI provider (#5808) (#6023) * feat: add llama-4-maverick model to Vertex AI provider (#5808) * fix: update llama-4-maverick pricing to correct values --- packages/types/src/providers/vertex.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/types/src/providers/vertex.ts b/packages/types/src/providers/vertex.ts index c405621f82..a48ebacdfb 100644 --- a/packages/types/src/providers/vertex.ts +++ b/packages/types/src/providers/vertex.ts @@ -273,6 +273,15 @@ export const vertexModels = { maxThinkingTokens: 24_576, supportsReasoningBudget: true, }, + "llama-4-maverick-17b-128e-instruct-maas": { + maxTokens: 8192, + contextWindow: 131072, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.35, + outputPrice: 1.15, + description: "Meta Llama 4 Maverick 17B Instruct model, 128K context.", + }, } as const satisfies Record export const VERTEX_REGIONS = [ From 8dcc078d85c76420cebc6e03867096334fa5e1c0 Mon Sep 17 00:00:00 2001 From: "roomote[bot]" <219738659+roomote[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 21:17:14 -0400 Subject: [PATCH 06/28] feat: add Qwen/Qwen3-235B-A22B-Instruct-2507 model to Chutes AI provider (#6052) Co-authored-by: Roo Code Co-authored-by: Matt Rubens --- packages/types/src/providers/chutes.ts | 10 ++++++++++ src/api/providers/__tests__/chutes.spec.ts | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/packages/types/src/providers/chutes.ts b/packages/types/src/providers/chutes.ts index 524f842059..5d81799223 100644 --- a/packages/types/src/providers/chutes.ts +++ b/packages/types/src/providers/chutes.ts @@ -18,6 +18,7 @@ export type ChutesModelId = | "deepseek-ai/DeepSeek-R1-Zero" | "deepseek-ai/DeepSeek-V3-0324" | "Qwen/Qwen3-235B-A22B" + | "Qwen/Qwen3-235B-A22B-Instruct-2507" | "Qwen/Qwen3-32B" | "Qwen/Qwen3-30B-A3B" | "Qwen/Qwen3-14B" @@ -163,6 +164,15 @@ export const chutesModels = { outputPrice: 0, description: "DeepSeek V3 (0324) model.", }, + "Qwen/Qwen3-235B-A22B-Instruct-2507": { + maxTokens: 32768, + contextWindow: 262144, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0, + outputPrice: 0, + description: "Qwen3 235B A22B Instruct 2507 model with 262K context window.", + }, "Qwen/Qwen3-235B-A22B": { maxTokens: 32768, contextWindow: 40960, diff --git a/src/api/providers/__tests__/chutes.spec.ts b/src/api/providers/__tests__/chutes.spec.ts index cf8d9a6e13..419ac50dfd 100644 --- a/src/api/providers/__tests__/chutes.spec.ts +++ b/src/api/providers/__tests__/chutes.spec.ts @@ -163,6 +163,28 @@ describe("ChutesHandler", () => { expect(model.info).toEqual(expect.objectContaining(chutesModels[testModelId])) }) + it("should return Qwen3-235B-A22B-Instruct-2507 model with correct configuration", () => { + const testModelId: ChutesModelId = "Qwen/Qwen3-235B-A22B-Instruct-2507" + const handlerWithModel = new ChutesHandler({ + apiModelId: testModelId, + chutesApiKey: "test-chutes-api-key", + }) + const model = handlerWithModel.getModel() + expect(model.id).toBe(testModelId) + expect(model.info).toEqual( + expect.objectContaining({ + maxTokens: 32768, + contextWindow: 262144, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0, + outputPrice: 0, + description: "Qwen3 235B A22B Instruct 2507 model with 262K context window.", + temperature: 0.5, // Default temperature for non-DeepSeek models + }), + ) + }) + it("completePrompt method should return text from Chutes API", async () => { const expectedResponse = "This is a test response from Chutes" mockCreate.mockResolvedValueOnce({ choices: [{ message: { content: expectedResponse } }] }) From 0cb76d9ae9b321293aabb63002d53caa466c3352 Mon Sep 17 00:00:00 2001 From: Murilo Pires <50873657+MuriloFP@users.noreply.github.com> Date: Tue, 22 Jul 2025 22:31:20 -0300 Subject: [PATCH 07/28] fix: add Git installation check for checkpoints feature (#3109) (#5920) Co-authored-by: Daniel Riccio --- src/core/checkpoints/index.ts | 50 +++++++++++++++++++++++++++--- src/i18n/locales/ca/common.json | 4 ++- src/i18n/locales/de/common.json | 4 ++- src/i18n/locales/en/common.json | 4 ++- src/i18n/locales/es/common.json | 4 ++- src/i18n/locales/fr/common.json | 4 ++- src/i18n/locales/hi/common.json | 4 ++- src/i18n/locales/id/common.json | 4 ++- src/i18n/locales/it/common.json | 4 ++- src/i18n/locales/ja/common.json | 4 ++- src/i18n/locales/ko/common.json | 4 ++- src/i18n/locales/nl/common.json | 4 ++- src/i18n/locales/pl/common.json | 4 ++- src/i18n/locales/pt-BR/common.json | 4 ++- src/i18n/locales/ru/common.json | 4 ++- src/i18n/locales/tr/common.json | 4 ++- src/i18n/locales/vi/common.json | 4 ++- src/i18n/locales/zh-CN/common.json | 4 ++- src/i18n/locales/zh-TW/common.json | 4 ++- src/utils/__tests__/git.spec.ts | 49 +++++++++++++++++++++++++++++ src/utils/git.ts | 11 ++++++- 21 files changed, 159 insertions(+), 23 deletions(-) diff --git a/src/core/checkpoints/index.ts b/src/core/checkpoints/index.ts index dcbe796eb7..02fb5dfc5a 100644 --- a/src/core/checkpoints/index.ts +++ b/src/core/checkpoints/index.ts @@ -6,6 +6,8 @@ import { TelemetryService } from "@roo-code/telemetry" import { Task } from "../task/Task" import { getWorkspacePath } from "../../utils/path" +import { checkGitInstalled } from "../../utils/git" +import { t } from "../../i18n" import { ClineApiReqInfo } from "../../shared/ExtensionMessage" import { getApiMetrics } from "../../shared/getApiMetrics" @@ -70,6 +72,47 @@ export function getCheckpointService(cline: Task) { cline.checkpointServiceInitializing = true + // Check if Git is installed before initializing the service + // Note: This is intentionally fire-and-forget to match the original IIFE pattern + // The service is returned immediately while Git check happens asynchronously + checkGitInstallation(cline, service, log, provider) + + return service + } catch (err) { + log(`[Task#getCheckpointService] ${err.message}`) + cline.enableCheckpoints = false + return undefined + } +} + +async function checkGitInstallation( + cline: Task, + service: RepoPerTaskCheckpointService, + log: (message: string) => void, + provider: any, +) { + try { + const gitInstalled = await checkGitInstalled() + + if (!gitInstalled) { + log("[Task#getCheckpointService] Git is not installed, disabling checkpoints") + cline.enableCheckpoints = false + cline.checkpointServiceInitializing = false + + // Show user-friendly notification + const selection = await vscode.window.showWarningMessage( + t("common:errors.git_not_installed"), + t("common:buttons.learn_more"), + ) + + if (selection === t("common:buttons.learn_more")) { + await vscode.env.openExternal(vscode.Uri.parse("https://git-scm.com/downloads")) + } + + return + } + + // Git is installed, proceed with initialization service.on("initialize", () => { log("[Task#getCheckpointService] service initialized") @@ -115,12 +158,11 @@ export function getCheckpointService(cline: Task) { log(`[Task#getCheckpointService] initShadowGit -> ${err.message}`) cline.enableCheckpoints = false }) - - return service } catch (err) { - log(`[Task#getCheckpointService] ${err.message}`) + log(`[Task#getCheckpointService] Unexpected error during Git check: ${err.message}`) + console.error("Git check error:", err) cline.enableCheckpoints = false - return undefined + cline.checkpointServiceInitializing = false } } diff --git a/src/i18n/locales/ca/common.json b/src/i18n/locales/ca/common.json index 633208d4bc..8ca5ae09a5 100644 --- a/src/i18n/locales/ca/common.json +++ b/src/i18n/locales/ca/common.json @@ -32,6 +32,7 @@ "could_not_open_file_generic": "No s'ha pogut obrir el fitxer!", "checkpoint_timeout": "S'ha esgotat el temps en intentar restaurar el punt de control.", "checkpoint_failed": "Ha fallat la restauració del punt de control.", + "git_not_installed": "Git és necessari per a la funció de punts de control. Si us plau, instal·la Git per activar els punts de control.", "no_workspace": "Si us plau, obre primer una carpeta de projecte", "update_support_prompt": "Ha fallat l'actualització del missatge de suport", "reset_support_prompt": "Ha fallat el restabliment del missatge de suport", @@ -111,7 +112,8 @@ }, "buttons": { "save": "Desar", - "edit": "Editar" + "edit": "Editar", + "learn_more": "Més informació" }, "tasks": { "canceled": "Error de tasca: Ha estat aturada i cancel·lada per l'usuari.", diff --git a/src/i18n/locales/de/common.json b/src/i18n/locales/de/common.json index 71155b1ebe..8853f4da41 100644 --- a/src/i18n/locales/de/common.json +++ b/src/i18n/locales/de/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Datei konnte nicht geöffnet werden!", "checkpoint_timeout": "Zeitüberschreitung beim Versuch, den Checkpoint wiederherzustellen.", "checkpoint_failed": "Fehler beim Wiederherstellen des Checkpoints.", + "git_not_installed": "Git ist für die Checkpoint-Funktion erforderlich. Bitte installiere Git, um Checkpoints zu aktivieren.", "no_workspace": "Bitte öffne zuerst einen Projektordner", "update_support_prompt": "Fehler beim Aktualisieren der Support-Nachricht", "reset_support_prompt": "Fehler beim Zurücksetzen der Support-Nachricht", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Speichern", - "edit": "Bearbeiten" + "edit": "Bearbeiten", + "learn_more": "Mehr erfahren" }, "tasks": { "canceled": "Aufgabenfehler: Die Aufgabe wurde vom Benutzer gestoppt und abgebrochen.", diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index 6bab0ab9a9..8adcbfa8cc 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Could not open file!", "checkpoint_timeout": "Timed out when attempting to restore checkpoint.", "checkpoint_failed": "Failed to restore checkpoint.", + "git_not_installed": "Git is required for the checkpoints feature. Please install Git to enable checkpoints.", "no_workspace": "Please open a project folder first", "update_support_prompt": "Failed to update support prompt", "reset_support_prompt": "Failed to reset support prompt", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Save", - "edit": "Edit" + "edit": "Edit", + "learn_more": "Learn More" }, "tasks": { "canceled": "Task error: It was stopped and canceled by the user.", diff --git a/src/i18n/locales/es/common.json b/src/i18n/locales/es/common.json index d307800c79..666aa4ec0b 100644 --- a/src/i18n/locales/es/common.json +++ b/src/i18n/locales/es/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "¡No se pudo abrir el archivo!", "checkpoint_timeout": "Se agotó el tiempo al intentar restaurar el punto de control.", "checkpoint_failed": "Error al restaurar el punto de control.", + "git_not_installed": "Git es necesario para la función de puntos de control. Por favor, instala Git para activar los puntos de control.", "no_workspace": "Por favor, abre primero una carpeta de proyecto", "update_support_prompt": "Error al actualizar el mensaje de soporte", "reset_support_prompt": "Error al restablecer el mensaje de soporte", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Guardar", - "edit": "Editar" + "edit": "Editar", + "learn_more": "Más información" }, "tasks": { "canceled": "Error de tarea: Fue detenida y cancelada por el usuario.", diff --git a/src/i18n/locales/fr/common.json b/src/i18n/locales/fr/common.json index b0571e3714..1a29a4c374 100644 --- a/src/i18n/locales/fr/common.json +++ b/src/i18n/locales/fr/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Impossible d'ouvrir le fichier !", "checkpoint_timeout": "Expiration du délai lors de la tentative de rétablissement du checkpoint.", "checkpoint_failed": "Échec du rétablissement du checkpoint.", + "git_not_installed": "Git est requis pour la fonctionnalité des points de contrôle. Veuillez installer Git pour activer les points de contrôle.", "no_workspace": "Veuillez d'abord ouvrir un espace de travail", "update_support_prompt": "Erreur lors de la mise à jour du prompt de support", "reset_support_prompt": "Erreur lors de la réinitialisation du prompt de support", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Enregistrer", - "edit": "Modifier" + "edit": "Modifier", + "learn_more": "En savoir plus" }, "tasks": { "canceled": "Erreur de tâche : Elle a été arrêtée et annulée par l'utilisateur.", diff --git a/src/i18n/locales/hi/common.json b/src/i18n/locales/hi/common.json index ca4efea535..34331f6683 100644 --- a/src/i18n/locales/hi/common.json +++ b/src/i18n/locales/hi/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "फ़ाइल नहीं खोली जा सकी!", "checkpoint_timeout": "चेकपॉइंट को पुनर्स्थापित करने का प्रयास करते समय टाइमआउट हो गया।", "checkpoint_failed": "चेकपॉइंट पुनर्स्थापित करने में विफल।", + "git_not_installed": "चेकपॉइंट सुविधा के लिए Git आवश्यक है। कृपया चेकपॉइंट সক্ষম करने के लिए Git इंस्टॉल करें।", "no_workspace": "कृपया पहले प्रोजेक्ट फ़ोल्डर खोलें", "update_support_prompt": "सपोर्ट प्रॉम्प्ट अपडेट करने में विफल", "reset_support_prompt": "सपोर्ट प्रॉम्प्ट रीसेट करने में विफल", @@ -107,7 +108,8 @@ }, "buttons": { "save": "सहेजें", - "edit": "संपादित करें" + "edit": "संपादित करें", + "learn_more": "और अधिक जानें" }, "tasks": { "canceled": "टास्क त्रुटि: इसे उपयोगकर्ता द्वारा रोका और रद्द किया गया था।", diff --git a/src/i18n/locales/id/common.json b/src/i18n/locales/id/common.json index 46ce587e61..25e70b3540 100644 --- a/src/i18n/locales/id/common.json +++ b/src/i18n/locales/id/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Tidak dapat membuka file!", "checkpoint_timeout": "Timeout saat mencoba memulihkan checkpoint.", "checkpoint_failed": "Gagal memulihkan checkpoint.", + "git_not_installed": "Git diperlukan untuk fitur checkpoint. Silakan instal Git untuk mengaktifkan checkpoint.", "no_workspace": "Silakan buka folder proyek terlebih dahulu", "update_support_prompt": "Gagal memperbarui support prompt", "reset_support_prompt": "Gagal mereset support prompt", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Simpan", - "edit": "Edit" + "edit": "Edit", + "learn_more": "Pelajari Lebih Lanjut" }, "tasks": { "canceled": "Error tugas: Dihentikan dan dibatalkan oleh pengguna.", diff --git a/src/i18n/locales/it/common.json b/src/i18n/locales/it/common.json index 11bae26eb3..775175e3d8 100644 --- a/src/i18n/locales/it/common.json +++ b/src/i18n/locales/it/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Impossibile aprire il file!", "checkpoint_timeout": "Timeout durante il tentativo di ripristinare il checkpoint.", "checkpoint_failed": "Impossibile ripristinare il checkpoint.", + "git_not_installed": "Git è richiesto per la funzione di checkpoint. Per favore, installa Git per abilitare i checkpoint.", "no_workspace": "Per favore, apri prima una cartella di progetto", "update_support_prompt": "Errore durante l'aggiornamento del messaggio di supporto", "reset_support_prompt": "Errore durante il ripristino del messaggio di supporto", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Salva", - "edit": "Modifica" + "edit": "Modifica", + "learn_more": "Scopri di più" }, "tasks": { "canceled": "Errore attività: È stata interrotta e annullata dall'utente.", diff --git a/src/i18n/locales/ja/common.json b/src/i18n/locales/ja/common.json index 52ab094633..ecd60699f8 100644 --- a/src/i18n/locales/ja/common.json +++ b/src/i18n/locales/ja/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "ファイルを開けませんでした!", "checkpoint_timeout": "チェックポイントの復元を試みる際にタイムアウトしました。", "checkpoint_failed": "チェックポイントの復元に失敗しました。", + "git_not_installed": "チェックポイント機能にはGitが必要です。チェックポイントを有効にするにはGitをインストールしてください。", "no_workspace": "まずプロジェクトフォルダを開いてください", "update_support_prompt": "サポートメッセージの更新に失敗しました", "reset_support_prompt": "サポートメッセージのリセットに失敗しました", @@ -107,7 +108,8 @@ }, "buttons": { "save": "保存", - "edit": "編集" + "edit": "編集", + "learn_more": "詳細" }, "tasks": { "canceled": "タスクエラー:ユーザーによって停止およびキャンセルされました。", diff --git a/src/i18n/locales/ko/common.json b/src/i18n/locales/ko/common.json index 63566f946b..e96f728199 100644 --- a/src/i18n/locales/ko/common.json +++ b/src/i18n/locales/ko/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "파일을 열 수 없습니다!", "checkpoint_timeout": "체크포인트 복원을 시도하는 중 시간 초과되었습니다.", "checkpoint_failed": "체크포인트 복원에 실패했습니다.", + "git_not_installed": "체크포인트 기능을 사용하려면 Git이 필요합니다. 체크포인트를 활성화하려면 Git을 설치하세요.", "no_workspace": "먼저 프로젝트 폴더를 열어주세요", "update_support_prompt": "지원 프롬프트 업데이트에 실패했습니다", "reset_support_prompt": "지원 프롬프트 재설정에 실패했습니다", @@ -107,7 +108,8 @@ }, "buttons": { "save": "저장", - "edit": "편집" + "edit": "편집", + "learn_more": "더 알아보기" }, "tasks": { "canceled": "작업 오류: 사용자에 의해 중지 및 취소되었습니다.", diff --git a/src/i18n/locales/nl/common.json b/src/i18n/locales/nl/common.json index fc3c1ce018..b99e8f2e81 100644 --- a/src/i18n/locales/nl/common.json +++ b/src/i18n/locales/nl/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Kon bestand niet openen!", "checkpoint_timeout": "Time-out bij het herstellen van checkpoint.", "checkpoint_failed": "Herstellen van checkpoint mislukt.", + "git_not_installed": "Git is vereist voor de checkpoint-functie. Installeer Git om checkpoints in te schakelen.", "no_workspace": "Open eerst een projectmap", "update_support_prompt": "Bijwerken van ondersteuningsprompt mislukt", "reset_support_prompt": "Resetten van ondersteuningsprompt mislukt", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Opslaan", - "edit": "Bewerken" + "edit": "Bewerken", + "learn_more": "Meer informatie" }, "tasks": { "canceled": "Taakfout: gestopt en geannuleerd door gebruiker.", diff --git a/src/i18n/locales/pl/common.json b/src/i18n/locales/pl/common.json index ef756ec1ce..7ba7e93514 100644 --- a/src/i18n/locales/pl/common.json +++ b/src/i18n/locales/pl/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Nie można otworzyć pliku!", "checkpoint_timeout": "Upłynął limit czasu podczas próby przywrócenia punktu kontrolnego.", "checkpoint_failed": "Nie udało się przywrócić punktu kontrolnego.", + "git_not_installed": "Funkcja punktów kontrolnych wymaga oprogramowania Git. Zainstaluj Git, aby włączyć punkty kontrolne.", "no_workspace": "Najpierw otwórz folder projektu", "update_support_prompt": "Nie udało się zaktualizować komunikatu wsparcia", "reset_support_prompt": "Nie udało się zresetować komunikatu wsparcia", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Zapisz", - "edit": "Edytuj" + "edit": "Edytuj", + "learn_more": "Dowiedz się więcej" }, "tasks": { "canceled": "Błąd zadania: Zostało zatrzymane i anulowane przez użytkownika.", diff --git a/src/i18n/locales/pt-BR/common.json b/src/i18n/locales/pt-BR/common.json index 8856e541be..753f7ae5bb 100644 --- a/src/i18n/locales/pt-BR/common.json +++ b/src/i18n/locales/pt-BR/common.json @@ -32,6 +32,7 @@ "could_not_open_file_generic": "Não foi possível abrir o arquivo!", "checkpoint_timeout": "Tempo esgotado ao tentar restaurar o ponto de verificação.", "checkpoint_failed": "Falha ao restaurar o ponto de verificação.", + "git_not_installed": "O Git é necessário para o recurso de checkpoints. Por favor, instale o Git para habilitar os checkpoints.", "no_workspace": "Por favor, abra primeiro uma pasta de projeto", "update_support_prompt": "Falha ao atualizar o prompt de suporte", "reset_support_prompt": "Falha ao redefinir o prompt de suporte", @@ -111,7 +112,8 @@ }, "buttons": { "save": "Salvar", - "edit": "Editar" + "edit": "Editar", + "learn_more": "Saiba Mais" }, "tasks": { "canceled": "Erro na tarefa: Foi interrompida e cancelada pelo usuário.", diff --git a/src/i18n/locales/ru/common.json b/src/i18n/locales/ru/common.json index fd23dffe2a..6431bf0ca9 100644 --- a/src/i18n/locales/ru/common.json +++ b/src/i18n/locales/ru/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Не удалось открыть файл!", "checkpoint_timeout": "Превышено время ожидания при попытке восстановления контрольной точки.", "checkpoint_failed": "Не удалось восстановить контрольную точку.", + "git_not_installed": "Для функции контрольных точек требуется Git. Пожалуйста, установите Git, чтобы включить контрольные точки.", "no_workspace": "Пожалуйста, сначала откройте папку проекта", "update_support_prompt": "Не удалось обновить промпт поддержки", "reset_support_prompt": "Не удалось сбросить промпт поддержки", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Сохранить", - "edit": "Редактировать" + "edit": "Редактировать", + "learn_more": "Узнать больше" }, "tasks": { "canceled": "Ошибка задачи: Она была остановлена и отменена пользователем.", diff --git a/src/i18n/locales/tr/common.json b/src/i18n/locales/tr/common.json index 9eeae720ef..cfc2a37591 100644 --- a/src/i18n/locales/tr/common.json +++ b/src/i18n/locales/tr/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Dosya açılamadı!", "checkpoint_timeout": "Kontrol noktasını geri yüklemeye çalışırken zaman aşımına uğradı.", "checkpoint_failed": "Kontrol noktası geri yüklenemedi.", + "git_not_installed": "Kontrol noktaları özelliği için Git gereklidir. Kontrol noktalarını etkinleştirmek için lütfen Git'i yükleyin.", "no_workspace": "Lütfen önce bir proje klasörü açın", "update_support_prompt": "Destek istemi güncellenemedi", "reset_support_prompt": "Destek istemi sıfırlanamadı", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Kaydet", - "edit": "Düzenle" + "edit": "Düzenle", + "learn_more": "Daha Fazla Bilgi" }, "tasks": { "canceled": "Görev hatası: Kullanıcı tarafından durduruldu ve iptal edildi.", diff --git a/src/i18n/locales/vi/common.json b/src/i18n/locales/vi/common.json index bd66d623bb..b4593a3476 100644 --- a/src/i18n/locales/vi/common.json +++ b/src/i18n/locales/vi/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "Không thể mở tệp!", "checkpoint_timeout": "Đã hết thời gian khi cố gắng khôi phục điểm kiểm tra.", "checkpoint_failed": "Không thể khôi phục điểm kiểm tra.", + "git_not_installed": "Yêu cầu Git cho tính năng điểm kiểm tra. Vui lòng cài đặt Git để bật điểm kiểm tra.", "no_workspace": "Vui lòng mở thư mục dự án trước", "update_support_prompt": "Không thể cập nhật lời nhắc hỗ trợ", "reset_support_prompt": "Không thể đặt lại lời nhắc hỗ trợ", @@ -107,7 +108,8 @@ }, "buttons": { "save": "Lưu", - "edit": "Chỉnh sửa" + "edit": "Chỉnh sửa", + "learn_more": "Tìm hiểu thêm" }, "tasks": { "canceled": "Lỗi nhiệm vụ: Nó đã bị dừng và hủy bởi người dùng.", diff --git a/src/i18n/locales/zh-CN/common.json b/src/i18n/locales/zh-CN/common.json index 515ee7d048..182ab29f33 100644 --- a/src/i18n/locales/zh-CN/common.json +++ b/src/i18n/locales/zh-CN/common.json @@ -33,6 +33,7 @@ "could_not_open_file_generic": "无法打开文件!", "checkpoint_timeout": "尝试恢复检查点时超时。", "checkpoint_failed": "恢复检查点失败。", + "git_not_installed": "存档点功能需要 Git。请安装 Git 以启用存档点。", "no_workspace": "请先打开项目文件夹", "update_support_prompt": "更新支持消息失败", "reset_support_prompt": "重置支持消息失败", @@ -112,7 +113,8 @@ }, "buttons": { "save": "保存", - "edit": "编辑" + "edit": "编辑", + "learn_more": "了解更多" }, "tasks": { "canceled": "任务错误:它已被用户停止并取消。", diff --git a/src/i18n/locales/zh-TW/common.json b/src/i18n/locales/zh-TW/common.json index cceb53e5f3..2746e16ee1 100644 --- a/src/i18n/locales/zh-TW/common.json +++ b/src/i18n/locales/zh-TW/common.json @@ -28,6 +28,7 @@ "could_not_open_file_generic": "無法開啟檔案!", "checkpoint_timeout": "嘗試恢復檢查點時超時。", "checkpoint_failed": "恢復檢查點失敗。", + "git_not_installed": "存檔點功能需要 Git。請安裝 Git 以啟用存檔點。", "no_workspace": "請先開啟專案資料夾", "update_support_prompt": "更新支援訊息失敗", "reset_support_prompt": "重設支援訊息失敗", @@ -107,7 +108,8 @@ }, "buttons": { "save": "儲存", - "edit": "編輯" + "edit": "編輯", + "learn_more": "了解更多" }, "tasks": { "canceled": "工作錯誤:它已被使用者停止並取消。", diff --git a/src/utils/__tests__/git.spec.ts b/src/utils/__tests__/git.spec.ts index 3ab306feec..f87ae5667b 100644 --- a/src/utils/__tests__/git.spec.ts +++ b/src/utils/__tests__/git.spec.ts @@ -4,6 +4,7 @@ import * as fs from "fs" import * as path from "path" import { + checkGitInstalled, searchCommits, getCommitInfo, getWorkingState, @@ -83,6 +84,54 @@ describe("git utils", () => { vitest.clearAllMocks() }) + describe("checkGitInstalled", () => { + it("should return true when git --version succeeds", async () => { + vitest.mocked(exec).mockImplementation((command: string, options: any, callback: any) => { + if (command === "git --version") { + callback(null, { stdout: "git version 2.39.2", stderr: "" }) + return {} as any + } + callback(new Error("Unexpected command")) + return {} as any + }) + + const result = await checkGitInstalled() + expect(result).toBe(true) + expect(vitest.mocked(exec)).toHaveBeenCalledWith("git --version", {}, expect.any(Function)) + }) + + it("should return false when git --version fails", async () => { + vitest.mocked(exec).mockImplementation((command: string, options: any, callback: any) => { + if (command === "git --version") { + callback(new Error("git not found")) + return {} as any + } + callback(new Error("Unexpected command")) + return {} as any + }) + + const result = await checkGitInstalled() + expect(result).toBe(false) + expect(vitest.mocked(exec)).toHaveBeenCalledWith("git --version", {}, expect.any(Function)) + }) + + it("should handle unexpected errors gracefully", async () => { + vitest.mocked(exec).mockImplementation((command: string, options: any, callback: any) => { + if (command === "git --version") { + // Simulate an unexpected error + callback(new Error("Unexpected system error")) + return {} as any + } + callback(new Error("Unexpected command")) + return {} as any + }) + + const result = await checkGitInstalled() + expect(result).toBe(false) + expect(vitest.mocked(exec)).toHaveBeenCalledWith("git --version", {}, expect.any(Function)) + }) + }) + describe("searchCommits", () => { const mockCommitData = [ "abc123def456", diff --git a/src/utils/git.ts b/src/utils/git.ts index fd6abfa309..42d069416e 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -210,7 +210,16 @@ async function checkGitRepo(cwd: string): Promise { } } -async function checkGitInstalled(): Promise { +/** + * Checks if Git is installed on the system by attempting to run git --version + * @returns {Promise} True if Git is installed and accessible, false otherwise + * @example + * const isGitInstalled = await checkGitInstalled(); + * if (!isGitInstalled) { + * console.log("Git is not installed"); + * } + */ +export async function checkGitInstalled(): Promise { try { await execAsync("git --version") return true From aa0e6d31d8abdc9b40388f65b22298980745f40f Mon Sep 17 00:00:00 2001 From: Daniel <57051444+daniel-lxs@users.noreply.github.com> Date: Tue, 22 Jul 2025 20:31:36 -0500 Subject: [PATCH 08/28] feat: add merge-resolver mode for intelligent conflict resolution (#6090) --- .roo/rules-merge-resolver/1_workflow.xml | 142 ++++++++ .../rules-merge-resolver/2_best_practices.xml | 165 +++++++++ .roo/rules-merge-resolver/3_tool_usage.xml | 228 +++++++++++++ .../4_complete_example.xml | 315 ++++++++++++++++++ .roo/rules-merge-resolver/5_communication.xml | 153 +++++++++ .roo/rules-pr-fixer/1_workflow.xml | 2 +- .roo/rules-pr-fixer/2_best_practices.xml | 36 +- .roo/rules-pr-fixer/3_common_patterns.xml | 32 +- .roo/rules-pr-fixer/4_tool_usage.xml | 26 +- .roo/rules-pr-fixer/5_examples.xml | 101 ++++++ .roomodes | 32 ++ 11 files changed, 1187 insertions(+), 45 deletions(-) create mode 100644 .roo/rules-merge-resolver/1_workflow.xml create mode 100644 .roo/rules-merge-resolver/2_best_practices.xml create mode 100644 .roo/rules-merge-resolver/3_tool_usage.xml create mode 100644 .roo/rules-merge-resolver/4_complete_example.xml create mode 100644 .roo/rules-merge-resolver/5_communication.xml diff --git a/.roo/rules-merge-resolver/1_workflow.xml b/.roo/rules-merge-resolver/1_workflow.xml new file mode 100644 index 0000000000..a63809db70 --- /dev/null +++ b/.roo/rules-merge-resolver/1_workflow.xml @@ -0,0 +1,142 @@ + + + This mode resolves merge conflicts for a specific pull request by analyzing git history, + commit messages, and code changes to make intelligent resolution decisions. It receives + a PR number (e.g., "#123") and handles the entire conflict resolution process. + + + + + Parse PR number from user input +
+ Extract the PR number from input like "#123" or "PR #123" + Validate that a PR number was provided +
+
+ + + Fetch PR information + + gh pr view [PR_NUMBER] --json title,body,headRefName,baseRefName + +
+ Get PR title and description to understand the intent + Identify the source and target branches +
+
+ + + Checkout PR branch and prepare for rebase + + gh pr checkout [PR_NUMBER] --force + git fetch origin main + git rebase origin/main + +
+ Force checkout the PR branch to ensure clean state + Fetch the latest main branch + Attempt to rebase onto main to reveal conflicts +
+
+ + + Check for merge conflicts + + git status --porcelain + git diff --name-only --diff-filter=U + +
+ Identify files with merge conflicts (marked with 'UU') + Create a list of files that need resolution +
+
+
+ + + + Analyze each conflicted file to understand the changes + + Read the conflicted file to identify conflict markers + Extract the conflicting sections between <<<<<<< and >>>>>>> + Run git blame on both sides of the conflict + Fetch commit messages and diffs for relevant commits + Analyze the intent behind each change + + + + + Determine the best resolution strategy for each conflict + + Categorize changes by intent (bugfix, feature, refactor, etc.) + Evaluate recency and relevance of changes + Check for structural overlap vs formatting differences + Identify if changes can be combined or if one should override + Consider test updates and related changes + + + + + Apply the resolution strategy to resolve conflicts + + For each conflict, apply the chosen resolution + Ensure proper escaping of conflict markers in diffs + Validate that resolved code is syntactically correct + Stage resolved files with git add + + + + + Verify the resolution and prepare for commit + + Run git status to confirm all conflicts are resolved + Check for any compilation or syntax errors + Review the final diff to ensure sensible resolutions + Prepare a summary of resolution decisions + + + + + + + gh pr checkout [PR_NUMBER] --force + Force checkout the PR branch to ensure clean state + + + + git fetch origin main + Get the latest main branch from origin + + + + git rebase origin/main + Rebase current branch onto main to reveal conflicts + + + + git blame -L [start_line],[end_line] [commit_sha] -- [file_path] + Get commit information for specific lines + + + + git show --format="%H%n%an%n%ae%n%ad%n%s%n%b" --no-patch [commit_sha] + Get commit metadata including message + + + + git show [commit_sha] -- [file_path] + Get the actual changes made in a commit + + + + git ls-files -u + List unmerged files with stage information + + + + + All merge conflicts have been resolved + Resolved files have been staged + No syntax errors in resolved code + Resolution decisions are documented + +
\ No newline at end of file diff --git a/.roo/rules-merge-resolver/2_best_practices.xml b/.roo/rules-merge-resolver/2_best_practices.xml new file mode 100644 index 0000000000..5bf1b393eb --- /dev/null +++ b/.roo/rules-merge-resolver/2_best_practices.xml @@ -0,0 +1,165 @@ + + + + Intent-Based Resolution + + Always prioritize understanding the intent behind changes rather than + just looking at the code differences. Commit messages, PR descriptions, + and issue references provide crucial context. + + + Code changes have purpose - bugfixes should be preserved, features + should be integrated properly, and refactors should maintain consistency. + + + Conflict between a bugfix and a refactor + Apply the bugfix logic within the refactored structure + Simply choose one side without considering both intents + + + + + Preserve All Valuable Changes + + When possible, combine non-conflicting changes from both sides rather + than discarding one side entirely. + + + Both sides of a conflict often contain valuable changes that can coexist + if properly integrated. + + + + + Escape Conflict Markers + + When using apply_diff or search_and_replace tools, always escape merge + conflict markers with backslashes to prevent parsing errors. + + + + + + Consider Related Changes + + Look beyond the immediate conflict to understand related changes in + tests, documentation, or dependent code. + + + A change might seem isolated but could be part of a larger feature + or fix that spans multiple files. + + + + + + + Bugfixes generally take precedence over features + + Bugfixes address existing problems and should be preserved, + while features can be reintegrated around the fix. + + + + + More recent changes are often more relevant + + Recent changes likely reflect the current understanding of + requirements and may supersede older implementations. + + + When older changes are bugfixes or security patches that + haven't been addressed in newer code. + + + + + Changes that include test updates are likely more complete + + Developers who update tests alongside code changes demonstrate + thoroughness and understanding of the impact. + + + + + Logic changes take precedence over formatting changes + + Formatting can be reapplied, but logic changes represent + functional improvements or fixes. + + + + + + + Blindly choosing one side without analysis + + You might lose important changes or introduce regressions + + + Always analyze both sides using git blame and commit history + + + + + Ignoring the PR description and context + + The PR description often explains the why behind changes, + which is crucial for proper resolution + + + Always fetch and read the PR information before resolving + + + + + Not validating the resolved code + + Merged code might be syntactically incorrect or introduce + logical errors + + + Always check for syntax errors and review the final diff + + + + + Not escaping conflict markers in diffs + + Unescaped conflict markers (<<<<<<, =======, >>>>>>) in SEARCH + or REPLACE sections will be interpreted as actual diff syntax, + causing the apply_diff tool to fail or produce incorrect results + + + Always escape conflict markers with a backslash (\) when they + appear in the content you're searching for or replacing. + Example: \<<<<<<< HEAD instead of <<<<<<< HEAD + + + + + + + Fetch PR title and description for context + Identify all files with conflicts + Understand the overall change being merged + + + + Run git blame on conflicting sections + Read commit messages for intent + Consider if changes can be combined + Escape conflict markers in diffs + + + + Verify no conflict markers remain + Check for syntax/compilation errors + Review the complete diff + Document resolution decisions + + + \ No newline at end of file diff --git a/.roo/rules-merge-resolver/3_tool_usage.xml b/.roo/rules-merge-resolver/3_tool_usage.xml new file mode 100644 index 0000000000..35f3b5da75 --- /dev/null +++ b/.roo/rules-merge-resolver/3_tool_usage.xml @@ -0,0 +1,228 @@ + + + + execute_command + For all git and gh CLI operations + Git commands provide the historical context needed for intelligent resolution + + + + read_file + To examine conflicted files and understand the conflict structure + Need to see the actual conflict markers and code + + + + apply_diff or search_and_replace + To resolve conflicts by replacing conflicted sections + Precise editing of specific conflict blocks + + + + + + + Always use gh CLI for GitHub operations instead of MCP tools + Chain git commands with && for efficiency + Use --format options for structured output + Capture command output for parsing + + + + + Get PR information + gh pr view [PR_NUMBER] --json title,body,headRefName,baseRefName + + + + Checkout PR branch + gh pr checkout [PR_NUMBER] --force + + + + Fetch latest main branch + git fetch origin main + + + + Rebase onto main to reveal conflicts + git rebase origin/main + + + + Check conflict status + git status --porcelain | grep "^UU" + + + + Get blame for specific lines + git blame -L [start],[end] HEAD -- [file] | cut -d' ' -f1 + + + + Get commit message + git log -1 --format="%s%n%n%b" [commit_sha] + + + + Stage resolved file + git add [file_path] + + + + Continue rebase after resolution + git rebase --continue + + + + + + + Read the entire conflicted file first to understand structure + Note line numbers of conflict markers for precise editing + Identify the pattern of conflicts (multiple vs single) + + + + <<<<<<< HEAD - Start of current branch changes + ======= - Separator between versions + >>>>>>> [branch] - End of incoming changes + + + + + + Always escape conflict markers with backslash + Include enough context to ensure unique matches + Use :start_line: for precision + Combine multiple resolutions in one diff when possible + + + +src/feature.ts + +<<<<<<< SEARCH +:start_line:45 +------- +\<<<<<<< HEAD +function oldImplementation() { + return "old"; +} +\======= +function newImplementation() { + return "new"; +} +\>>>>>>> feature-branch +======= +function mergedImplementation() { + // Combining both approaches + return "merged"; +} +>>>>>>> REPLACE + + + ]]> + + + + + Use for simple conflict resolutions + Enable regex mode for complex patterns + Always escape special characters + + + +src/config.ts +\<<<<<<< HEAD[\s\S]*?\>>>>>>> \w+ +// Resolved configuration +const config = { + // Merged settings from both branches +} +true + + ]]> + + + + + + + execute_command - Get PR info with gh CLI + execute_command - Checkout PR with gh pr checkout --force + execute_command - Fetch origin main + execute_command - Rebase onto origin/main + execute_command - Check for conflicts with git status + + + + + + execute_command - List conflicted files + read_file - Examine conflict structure + execute_command - Git blame on conflict regions + execute_command - Fetch commit messages + + + + + + read_file - Get exact conflict content + apply_diff - Replace conflict with resolution + execute_command - Stage resolved file + execute_command - Verify resolution status + + + + + + execute_command - Check all conflicts resolved + execute_command - Continue rebase with git rebase --continue + execute_command - Verify clean status + + + + + + + Rebase completes without conflicts + + Inform user that PR can be merged without conflicts + No resolution needed + + + + + A rebase is already in progress + + Check status with git status + Either continue existing rebase or abort with git rebase --abort + + + + + Conflict markers are incomplete or nested + + Use search_and_replace with careful regex patterns + Manual inspection may be required + + + + + Binary files cannot be merged automatically + + Identify which version to keep based on PR intent + Use git checkout --theirs or --ours + + + + + Code contains literal conflict marker strings + + Extra careful escaping in diffs + Consider using search_and_replace with precise patterns + + + + \ No newline at end of file diff --git a/.roo/rules-merge-resolver/4_complete_example.xml b/.roo/rules-merge-resolver/4_complete_example.xml new file mode 100644 index 0000000000..dae8587997 --- /dev/null +++ b/.roo/rules-merge-resolver/4_complete_example.xml @@ -0,0 +1,315 @@ + + + User provides PR #123 which has merge conflicts between a bugfix branch + and a feature branch that refactored the same code. + + + + #123 + + + + + Parse PR number and fetch PR information + +gh pr view 123 --json title,body,headRefName,baseRefName + + ]]> + + + The PR is a bugfix for a memory leak issue. This context will help + prioritize preserving the fix during conflict resolution. + + + + + Checkout PR branch and prepare for rebase + +gh pr checkout 123 --force + + ]]> + + + +git fetch origin main + + ]]> + FETCH_HEAD + ]]> + + +git rebase origin/main + + ]]> + ", then run "git rebase --continue". + ]]> + + + + Check for merge conflicts + +git status --porcelain | grep "^UU" + + ]]> + + + Two files have conflicts: the main processor file and its test file. + Both need to be resolved before continuing the rebase. + + + + + Examine the conflicted processor file + +src/data/processor.ts +
+ ]]> + = new Map(); +47 | +48 | <<<<<<< HEAD +49 | async processData(data: DataInput): Promise { +50 | // Refactored to use async/await +51 | const result = await this.transform(data); +52 | return result; +53 | } +54 | ======= +55 | processData(data: any[]): ProcessedData { +56 | const listener = this.createListener(); +57 | this.listeners.set(data.id, listener); +58 | +59 | return this.transform(data); +60 | } +61 | >>>>>>> abc123 (Fix memory leak in data processor) +62 | +63 | cleanup() { +64 | <<<<<<< HEAD +65 | // TODO: Implement cleanup +66 | ======= +67 | // Fix: Clear all listeners to prevent memory leak +68 | this.listeners.forEach(listener => { +69 | listener.removeAllListeners(); +70 | }); +71 | this.listeners.clear(); +72 | >>>>>>> abc123 (Fix memory leak in data processor) +73 | } +74 | } + ]]> + + + + Analyze the conflicts using git blame + +git blame -L 49,53 HEAD -- src/data/processor.ts | cut -d' ' -f1 | sort -u | xargs -I {} git log -1 --format="%h %s" {} + + ]]> + + + +git log -1 --format="%h %s" abc123 + + ]]> + + + + HEAD (main after rebase): Has async/await refactor but missing listener logic + Incoming (bugfix branch): Adds listener tracking and cleanup for memory leak fix + + Resolution strategy: Combine both changes - keep async/await refactor + but include the listener tracking and cleanup logic. + + + + + Resolve the conflicts + +src/data/processor.ts + +<<<<<<< SEARCH +:start_line:48 +------- +\<<<<<<< HEAD + async processData(data: DataInput): Promise { + // Refactored to use async/await + const result = await this.transform(data); + return result; + } +\======= + processData(data: any[]): ProcessedData { + const listener = this.createListener(); + this.listeners.set(data.id, listener); + + return this.transform(data); + } +\>>>>>>> abc123 (Fix memory leak in data processor) +======= + async processData(data: DataInput): Promise { + // Create and track listener for cleanup (memory leak fix) + const listener = this.createListener(); + this.listeners.set(data.id, listener); + + // Refactored to use async/await + const result = await this.transform(data); + return result; + } +>>>>>>> REPLACE + +<<<<<<< SEARCH +:start_line:63 +------- + cleanup() { +\<<<<<<< HEAD + // TODO: Implement cleanup +\======= + // Fix: Clear all listeners to prevent memory leak + this.listeners.forEach(listener => { + listener.removeAllListeners(); + }); + this.listeners.clear(); +\>>>>>>> abc123 (Fix memory leak in data processor) + } +======= + cleanup() { + // Fix: Clear all listeners to prevent memory leak + this.listeners.forEach(listener => { + listener.removeAllListeners(); + }); + this.listeners.clear(); + } +>>>>>>> REPLACE + + + ]]> + + Combined both changes: kept the async/await refactor from main + while preserving the memory leak fix (listener tracking and cleanup) + from the bugfix branch. + + + + + Resolve test file conflicts + +src/data/processor.test.ts + + ]]> + + +src/data/processor.test.ts + + + + + ]]> + + + + Stage resolved files and continue rebase + +git add src/data/processor.ts src/data/processor.test.ts + + ]]> + + +git rebase --continue + + ]]> + + + + + Final validation + +git status + + ]]> + + + +git diff origin/main --stat + + ]]> + + + + + + +Successfully resolved merge conflicts for PR #123 "Fix memory leak in data processor". + +Resolution Summary: +- src/data/processor.ts: Combined the async/await refactor with the memory leak fix by preserving listener tracking and cleanup logic within the refactored async method +- src/data/processor.test.ts: Updated tests to work with the async implementation while maintaining memory leak test coverage + +Both the feature refactor and the critical bugfix have been preserved in the resolution. The rebase has been completed successfully and the branch is ready to be pushed. + + + ]]> + + + Always checkout PR with --force and rebase to reveal conflicts + Fetch PR context to understand the intent of changes + Use git blame and commit messages to understand the history + Combine non-conflicting improvements when possible + Prioritize bugfixes while accommodating refactors + Complete the rebase process with git rebase --continue + Validate that both sets of changes work together + + \ No newline at end of file diff --git a/.roo/rules-merge-resolver/5_communication.xml b/.roo/rules-merge-resolver/5_communication.xml new file mode 100644 index 0000000000..18594d5269 --- /dev/null +++ b/.roo/rules-merge-resolver/5_communication.xml @@ -0,0 +1,153 @@ + + + Be direct and technical when explaining resolution decisions + Focus on the rationale behind each conflict resolution + Provide clear summaries of what was merged and why + + + I'll help you resolve these conflicts... + Let me handle this for you... + Don't worry about the conflicts... + + + + Analyzing PR #123 for merge conflicts... + Resolving conflicts based on commit history analysis... + Applied resolution strategy: [specific strategy] + + + + + + Acknowledge the PR number + State that you're fetching PR information + Indicate the analysis will begin + + + + Fetching information for PR #123 to understand the context and identify merge conflicts... + + + + + During each major phase of resolution + + Analyzing [X] conflicted files... + Running git blame on [file] to understand change history... + Resolving conflicts in [file] by [strategy]... + Validating resolved changes... + + + + Number of conflicts found + Files being processed + Resolution strategy being applied + + + + + Explain each significant resolution decision + Reference specific commits when relevant + Justify why certain changes were kept or merged + + + + Conflict in [file]: + - HEAD: [brief description of changes] + - Incoming: [brief description of changes] + - Resolution: [what was decided and why] + + + + + + + + Expected a PR number (e.g., "#123" or "123"). Please provide the PR number to resolve conflicts for. + + + + + + PR #[number] does not have any merge conflicts. The branch can be merged without conflict resolution. + + + + + + Could not find PR #[number]. Please verify the PR number and ensure you have access to the repository. + + + + + + Found complex conflicts in [file] that require careful analysis. Examining commit history to determine the best resolution strategy... + + + + + + + State that conflicts are resolved + Provide resolution summary + List files that were resolved + Mention key decisions made + + + + + + Questions about next steps + Offers to do additional work + Uncertain language about the resolution + + + + + Document why specific resolutions were chosen + Reference commit SHAs when they influenced decisions + Explain trade-offs when both sides had valid changes + + + + Preserved bugfix from commit abc123 while adapting it to the refactored structure from def456 + + + Combined both implementations as they addressed different aspects of the same feature + + + Chose the more recent implementation as it included additional error handling + + + + + + + + Binary file conflict in [file]. Based on PR intent "[title]", choosing [which version] version. + + + + + + Conflict: [file] was deleted in one branch but modified in another. Based on the changes, [keeping/removing] the file because [reason]. + + + + + + Conflict in [file] involves only whitespace/formatting. Applying consistent formatting from [which] branch. + + + + \ No newline at end of file diff --git a/.roo/rules-pr-fixer/1_workflow.xml b/.roo/rules-pr-fixer/1_workflow.xml index db74ead7ee..fb487e5fdd 100644 --- a/.roo/rules-pr-fixer/1_workflow.xml +++ b/.roo/rules-pr-fixer/1_workflow.xml @@ -45,7 +45,7 @@ Determine if the PR is from a fork by checking 'gh pr view [PR_NUMBER] --repo [owner]/[repo] --json isCrossRepository'. Apply code changes based on review feedback using file editing tools. Fix failing tests by modifying test files or source code as needed. - For conflict resolution: Use GIT_EDITOR=true for non-interactive rebases, then resolve conflicts via file editing. + For conflict resolution: Delegate to merge-resolver mode using new_task with the PR number. If changes affect user-facing content (i18n files, UI components, announcements), delegate translation updates using the new_task tool with translate mode. Review modified files with 'git status --porcelain' to ensure no temporary files are included. Stage files selectively using 'git add -u' (for modified tracked files) or 'git add ' (for new files). diff --git a/.roo/rules-pr-fixer/2_best_practices.xml b/.roo/rules-pr-fixer/2_best_practices.xml index 50a8395b9c..2dc5775ced 100644 --- a/.roo/rules-pr-fixer/2_best_practices.xml +++ b/.roo/rules-pr-fixer/2_best_practices.xml @@ -41,33 +41,25 @@ - How to correctly escape conflict markers when using apply_diff. + Delegate merge conflict resolution to the merge-resolver mode. diff --git a/.roo/rules-pr-fixer/3_common_patterns.xml b/.roo/rules-pr-fixer/3_common_patterns.xml index 1c6c0bcf65..4ef2a34b9e 100644 --- a/.roo/rules-pr-fixer/3_common_patterns.xml +++ b/.roo/rules-pr-fixer/3_common_patterns.xml @@ -27,32 +27,26 @@ Commands to detect merge conflicts. - - Rebase operations using GIT_EDITOR to prevent interactive prompts. + + Delegate merge conflict resolution to the merge-resolver mode. - - Check current conflict status without interactive input. - - Check out a pull request branch locally.