8000 Search and Replace Identical Error · Issue #2188 · RooVetGit/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Search and Replace Identical Error #2188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bobbyb2024 opened this issue Apr 1, 2025 · 7 comments
Closed

Search and Replace Identical Error #2188

bobbyb2024 opened this issue Apr 1, 2025 · 7 comments
Assignees
Labels
bug Something isn't working needs information Needs more information to be actionable

Comments

@bobbyb2024
Copy link

App Version

3.11.3

API Provider

Google Gemini

Model Used

Gemini 2.5 Pro exp 3-25

Actual vs. Expected Behavior

Actual Behavior:
Error
<error_details>
Search and replace content are identical - no changes would be made

Debug Info:

  • Search and replace must be different to make changes
  • Use read_file to verify the content you want to change
    </error_details>

Roo is having trouble...
Roo Code uses complex prompts and iterative task execution that may be challenging for less capable models. For best results, it's recommended to use Claude 3.7 Sonnet for its advanced agentic coding capabilities.

Expected Behavior:
We noticed the suggested content and existing content are identical. Moving On...

Detailed Steps to Reproduce

  1. Prompt: Work to resolve failing jest tests

Relevant API Request Output

<error_details>
No sufficiently similar match found at start: 87 to end: 87 (72% similar, needs 100%)

Debug Info:
- Similarity Score: 72%
- Required Threshold: 100%
- Search Range: lines 87-87
- Tip: Use read_file to get the latest content of the file before attempting the diff again, as the file content may have changed

Search Content:
    console.log('>>> beforeEach: Starting build...'); // Log before build

Best Match Found:
98 |     console.log('>>> beforeEach: Build finished.'); // Log after build

Original Content:
 47 | 
 48 |       if (normalizedId === normalizedTaskId) {
 49 |         // Default mock: return a completed job structure matching TaskService output
 50 |         const now = Date.now();
 51 |         return {
 52 |           id: taskId,
 53 |           name: 'test-type', // Use name for type
 54 |           status: 'completed', // Default to completed for GET tests
 55 |           timestamp: now - 1000, // Original timestamp
 56 |           processedOn: now - 500, // Simulate processing started
 57 |           finishedOn: now,
 58 |           returnvalue: { output: 'Default mock result' },
 59 |           failedReason: null,
 60 |           attemptsMade: 1,
 61 |           progress: 100,
 62 |           opts: {},
 63 |           data: { some: 'data' },
 64 |            // Mapped fields used by the route handler
 65 |           createdAt: new Date(now - 1000).toISOString(),
 66 |           updatedAt: new Date(now).toISOString(),
 67 |           finishedAt: new Date(now).toISOString(),
 68 |           result: { output: 'Default mock result' }, // Mapped from returnvalue
 69 |           error: null,  // Mapped from failedReason
 70 |         };
 71 |       }
 72 |       return null; // Simulate task not found
 73 |     });
 74 | 
 75 |     // Create the mock TaskService object
 76 |     const mockTaskService = {
 77 |       createTask: mockAddTask,
 78 |       getTaskStatus: mockGetJob,
 79 |       // Add other mocked methods if the route uses them
 80 |       getActiveTasks: mockGetActive,
 81 |       getCompletedTasks: mockGetCompleted,
 82 |       getFailedTasks: mockGetFailed,
 83 |       getDelayedTasks: mockGetDelayed,
 84 |       getWaitingTasks: mockGetWaiting,
 85 |     };
 86 | 
 87 |     // Build the app using the imported build function, overriding TaskService
 88 |     app = await build({
 89 |       logger: false, // Disable logging for cleaner test output
 90 |       minimal: true, // Use minimal build to avoid unnecessary plugins
 91 |       override: {
 92 |         taskService: mockTaskService,
 93 |         // Mock auth and rate limiter to allow requests through
 94 |         authMiddleware: (req, reply, next) => next(), // Keep this override attempt
 95 |         rateLimiter: (req, reply, next) => next(),   // Keep this override attempt
 96 |       }
 97 |     });
 98 |     console.log('>>> beforeEach: Build finished.'); // Log after build
 99 |     
100 |     // Add a custom error handler to match the expected error format in tests
101 |     app.setErrorHandler((error, request, reply) => {
102 |       // Check if this is a validation error (from schema validation)
103 |       if (error.validation) {
104 |         const details = error.validation.map(v => ({
105 |           keyword: v.keyword,
106 |           message: v.message,
107 |           path: v.dataPath || `/body${v.instancePath || ''}`
108 |         }));
109 |         
110 |         return reply.code(400).send({
111 |           error: {
112 |             code: 'VALIDATION_ERROR',
113 |             name: 'ValidationError',
114 |             message: 'Input validation failed',
115 |             statusCode: 400,
116 |             details
117 |           }
118 |         });
119 |       }
120 |       
121 |       // Generic error response
122 |       const statusCode = error.statusCode || 500;
123 |       const errorCode = error.code || 'INTERNAL_ERROR';
124 |       const name = error.name || 'InternalServerError';
125 |       
126 |       return reply.code(statusCode).send({
127 |         error: {
</error_details>

Additional Context

If search and replace experiences identical content, it should be a notice, not a full on stop error.

@bobbyb2024 bobbyb2024 added the bug Something isn't working label Apr 1, 2025
@hannesrudolph
Copy link
Collaborator

@KJ7LNW

@KJ7LNW KJ7LNW self-assigned this Apr 1, 2025
@KJ7LNW
Copy link
Collaborator
KJ7LNW commented Apr 1, 2025

the example that you gave says No sufficiently similar match found at start: 87 to end: 87 (72% similar, needs 100%) but your initial report shows <error_details> Search and replace content are identical - no changes would be made

can you update the report with API output that matches the report so I can investigate?

@hannesrudolph hannesrudolph moved this from New to Issue [Needs Info] in Roo Code Roadmap Apr 1, 2025
@hannesrudolph hannesrudolph added the needs information Needs more information to be actionable label Apr 2, 2025
@hannesrudolph
Copy link
Collaborator

I believe this has been solved

@github-project-automation github-project-automation bot moved this from Issue [Needs Info] to Done in Roo Code Roadmap Apr 10, 2025
@Sophanos
Copy link

Still have problems

@KJ7LNW
Copy link
Collaborator
KJ7LNW commented Apr 14, 2025

@Sophanos can you elaborate specifically on your issue? the more test cases and examples we have the closer we can get to solving if this is still a problem.

@bobbyb2024
Copy link
Author
bobbyb2024 commented Apr 14, 2025 via email

@KJ7LNW
Copy link
Collaborator
KJ7LNW commented Apr 14, 2025

The grey screen of death is an unrelated issue, see #2270, and please add any additional information to that ticket if you have some, so we can track this down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs information Needs more information to be actionable
Projects
Archived in project
Development

No branches or pull requests

4 participants
0