Issue with large file edit timing out

Constantly having claude 3.7 / 3.5 “tool call timeout”, and fail to apply edits to a 10k line file. (3.5 and 3.7 also still randomly edit completely unrelated sections of code)

i’ve been interested in just testing and seeing if Cursor can help with my giant old codebase… and it’s been rough. Any suggestions?

Should be easy to reproduce, just make a 10k line php helper function file :laughing: and ask for any edit.

VSCode Version: 1.96.2
Commit: ae378be9dc2f5f1a6a1a220c6e25f9f03c8d4e10
Date: 2025-03-07T07:01:25.026Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100

I’ve tried hinting to it with project file structure as suggested here: Context and large codebases - #4 by danperks

doesn’t seem to help, as main issue is with the applying of edits on a large file just confuses / overloads cursor.

my prompt was:

Make small, incremental code changes to avoid timeouts..  #this is a common issue with claude 3.7

search how "joeTools::getMythicalNightFishDetails()" and $mnf_a is used throughout the codebase.     #this sometimes greps, but then see SS, it'll fail not sure what cmd it's sending thats failing? think its related to windows folder structure?

get a specific town name via: joeTools::getTownName($a['town_id']);  #ends up searching this, i think just slowly overloading context window.. :\

adjust 'town_id' to be an array of town_id's and have 'town_name' key dynamically added via getTownName()  ie:
    1921=>array('id'=>1921,'name'=>"Carnival King","img"=>"carnival-king",'weight'=>50000,'length'=>130,'points'=>15000,'gold'=>15000,
           'analysis_total'=>275,'chum_id'=>60,'town_id'=>97,'town_name'=>"Festivia",
            'pole_ids'=>array(84,85), "pole_name"=>"Circus Net or Freakshow Cage","max_level"=>50
    ),

becomes:
    1921=>array('id'=>1921,'name'=>"Carnival King","img"=>"carnival-king",'weight'=>50000,'length'=>130,'points'=>15000,'gold'=>15000,
            'analysis_total'=>275,'chum_id'=>60,'town_id'=>array(97,98,99,100),
            'pole_ids'=>array(84,85), "pole_name"=>"Circus Net or Freakshow Cage","max_level"=>50
    ), 

and then integrate change into code where its used.   be careful to not overfill your context as this is a big codebase. #doesnt work.. was trying diff things

it ends up understanding my terrible prompt with the simple changes to make, but it fails with editing them within the large file…

Dev tools console log shows errors like:

    at X_s.$endAiConnectTransportReportError (workbench.desktop.main.js:2320:112240)
    at tTi.S (workbench.desktop.main.js:4950:42947)
    at tTi.Q (workbench.desktop.main.js:4950:42725)
    at tTi.M (workbench.desktop.main.js:4950:41813)
    at tTi.L (workbench.desktop.main.js:4950:40914)
    at qae.value (workbench.desktop.main.js:4950:39706)
    at M.B (workbench.desktop.main.js:49:748)
    at M.fire (workbench.desktop.main.js:49:967)
    at Vie.fire (workbench.desktop.main.js:2302:10362)
    at l.onmessage (workbench.desktop.main.js:4995:12119)

and:

submitChatMaybeAbortCurrent @ workbench.desktop.main.js:1920

and:

    at t (workbench.desktop.main.js:2320:112985)
    at async Object.checkNumberConfig (workbench.desktop.main.js:75:27503)
    at async J6t.maybeRefreshConfig (workbench.desktop.main.js:638:21515)
maybeRefreshConfig	@	workbench.desktop.main.js:638
await in maybeRefreshConfig		
call	@	workbench.desktop.main.js:964
(anonymous)	@	workbench.desktop.main.js:967
(anonymous)	@	workbench.desktop.main.js:967
runTool	@	workbench.desktop.main.js:967
toolWrappedStream	@	workbench.desktop.main.js:967
await in toolWrappedStream		
Ax	@	workbench.desktop.main.js:593
handleStreamComposer	@	workbench.desktop.main.js:924
streamResponse	@	workbench.desktop.main.js:593
(anonymous)	@	workbench.desktop.main.js:2978
(anonymous)	@	workbench.desktop.main.js:2937
processCodeBlocks	@	workbench.desktop.main.js:950
(anonymous)	@	workbench.desktop.main.js:1920
await in (anonymous)		
submitChatMaybeAbortCurrent	@	workbench.desktop.main.js:1920
await in submitChatMaybeAbortCurrent		
Xi	@	workbench.desktop.main.js:2913
await in Xi		
onClick	@	workbench.desktop.main.js:2913
(anonymous)	@	workbench.desktop.main.js:1940

and:

[ToolV2Service] Error executing tool 5 (readFileParams): {toolCallId: 'toolu_bdrk_01VNmPDxoWsjeuk99o6EkjLT', name: 'read_file', isStreaming: false, error: {…}}

and:

workbench.desktop.main.js:639 diff computation quit early, not sure what to do here
5
workbench.desktop.main.js:639 diff computation quit early, not sure what to do here
workbench.desktop.main.js:5045 Cpp: error when triggering from source typing Error: stream took too long

in workbench.desktop.main.js:
maxComputationTimeMs: 200,

seems like its just hitting the hard limit and looping and getting stuck… would be nice if it retried with a higher timeout up to a max?

i give up for now tho… as its ignoring a more specific prompt telling it to not edit outside of the bounds i’m asking… example:

new prompt was:

**IMPORTANT:**  
Only modify the code strictly within the designated search areas/line ranges. Do not change any code outside of these bounds. All modifications must be incremental and confined to the specified context.

### Steps & Instructions:

1. **Search for References:**  
   - **Task:** Use grep to locate all references to `"joeTools::getMythicalNightFishDetails()"` and the variable `$mnf_a` throughout the codebase.  
   - **Output:** Return only the file names and line numbers where these occur.

2. **Path Handling:**  
   - When accessing or reading files, use relative Windows paths.

3. **Targeted Code Update for Town Name Handling:**  
   - **Focus Area:** For each instance where `joeTools::getTownName($a['town_id'])` is used, limit the modification to the immediate code block only.  
   - **Change Required:**  
     - Change the `'town_id'` key (which is a single value) to `'town_ids'` and convert it into an array (e.g., `array(97,98,99,100)`).  
     - Remove any existing `'town_name'` key, ensuring that the town name will be dynamically added using `joeTools::getTownName()` in a later step.  
   - **Example:**  
     **Before:**  
     ```php
     1921 => array(
         'id' => 1921,
         'name' => "Carnival King",
         "img" => "carnival-king",
         'weight' => 50000,
         'length' => 130,
         'points' => 15000,
         'gold' => 15000,
         'analysis_total' => 275,
         'chum_id' => 60,
         'town_id' => 97,
         'town_name' => "Festivia",
         'pole_ids' => array(84,85),
         "pole_name" => "Circus Net or Freakshow Cage",
         "max_level" => 50
     ),
     ```  
     **After:**  
     ```php
     1921 => array(
         'id' => 1921,
         'name' => "Carnival King",
         "img" => "carnival-king",
         'weight' => 50000,
         'length' => 130,
         'points' => 15000,
         'gold' => 15000,
         'analysis_total' => 275,
         'chum_id' => 60,
         'town_ids' => array(97,98,99,100),
         'pole_ids' => array(84,85),
         "pole_name" => "Circus Net or Freakshow Cage",
         "max_level" => 50
     ),
     ```

4. **Diff Computation & Incremental Edits:**  
   - **Limit Scope:** Only compute diffs for the specific code blocks where changes are required.  
   - **Confirmation:** Provide a diff output for review before finalizing any changes.  
   - **Clarification:** If additional context is needed for a safe edit, request clarification without altering code outside the defined boundaries.

5. **Final Integration:**  
   - Integrate these targeted changes solely into the relevant code segments where `joeTools::getTownName($a['town_id'])` is used.  
   - Ensure no other parts of the file (or codebase) are affected by these modifications.

image