continue icon indicating copy to clipboard operation
continue copied to clipboard

Edit tools (edit_existing_file, single_find_and_replace) fail when workspace is connected via Remote SSH

Open arash2105 opened this issue 5 months ago • 1 comments

Before submitting your bug report

Relevant environment info

- Continue extension version: 1.3.40
- VS Code version:  Version: 1.124.2 
- OS: Windows_NT x64 10.0.26200
- Connection type: Remote – SSH (via ms-vscode-remote.remote-ssh)
- Remote OS: Linux (Ubuntu 22.04)
- Local OS: Windows 11

Description

  1. Open a folder in VS Code using Remote – SSH.
  2. Install and activate the Continue extension.
  3. Open a simple text file, e.g., e.php containing only 123456789.
  4. Ask Continue to edit the file, for example: "Add 10 to the number" or "Replace content with 123456799".
  5. The agent attempts to use edit_existing_file, single_find_and_replace, or run_terminal_command to modify the file.

Observed Behavior

  • edit_existing_file fails with:
    Failed to edit undefined. To continue working with the file, read it again to see the most up-to-date contents
  • single_find_and_replace fails with:
    string old_string is required (even though the argument is correctly provided).
  • create_new_file fails with:
    contents argument is required. (type string) (again despite providing the argument).
  • run_terminal_command executes without error but the file is not actually modified (e.g., echo 123456799 > movie.php has no effect; view_diff shows empty diff).
  • read_file and file_glob_search work correctly and show the original content.

Expected Behavior

All edit tools should modify file content in a remote SSH workspace exactly as they do in a local workspace.

Additional Notes

The problem appears to be related to file path resolution or write-permissions when the workspace is accessed via Remote – SSH. The agent can read files but cannot write them, which severely limits functionality in remote development environments.

To reproduce

No response

Log output


arash2105 avatar Jun 15 '26 22:06 arash2105

Hi I checked the latest code and this issue looks partially outdated.

  • The main Remote SSH execution/write path seems to be handled correctly now:
  • file writes go through VS Code workspace.fs.writeFile(...)
  • remote terminal commands are routed through the VS Code integrated terminal instead of local spawn
  • So the original “Remote SSH cannot edit/write files” root cause may already be fixed.

What still appears to remain is the error handling / UX:

  • Failed to edit undefined can still happen because the apply failure path closes state without preserving filepath
  • if this issue still reproduces, the likely fix is to preserve the resolved file URI/filepath throughout the apply flow and include it in failure state
  • it would also help to harden edit-tool arg normalization (old_string / new_string / contents) in case some of the reported failures are coming from argument-shape mismatches rather than Remote SSH itself

Suggested fix direction:

  1. preserve filepath in the edit apply failure path
  2. make the failure message fallback-safe (avoid showing undefined)
  3. ensure the apply pipeline keeps full remote URIs intact end-to-end

So my read is: the original Remote SSH write bug may be fixed, but the failure reporting path still needs cleanup, and there may be a separate argument-handling issue if repro still exists.

I would like to fix this issue. @sestinj

Manpreet2298 avatar Jun 20 '26 10:06 Manpreet2298

This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.

github-actions[bot] avatar Sep 19 '26 01:09 github-actions[bot]

This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, you are welcome to leave a comment and this will keep the issue open. However please note that this repo is no longer being actively maintained.

github-actions[bot] avatar Sep 29 '26 01:09 github-actions[bot]