Skip to content
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

Issue with Applying AI-Generated Code Changes #22903

Open
1 task done
Vanuan opened this issue Jan 9, 2025 · 2 comments
Open
1 task done

Issue with Applying AI-Generated Code Changes #22903

Vanuan opened this issue Jan 9, 2025 · 2 comments
Labels
ai Improvement related to Assistant, Copilot, or other AI features assistant AI feedback for Assistant (inline or panel) bug [core label]

Comments

@Vanuan
Copy link

Vanuan commented Jan 9, 2025

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

  • Demo Example:
    Scenario: Let's say you have a simple Python function that you want to modify using Zed's AI feature:
# Original File: example.py
def greet(name):
    print("Hello, " + name)

# User wants to add a new parameter for a default greeting message
  • Detailed steps

    • Open Zed Editor: Load the example.py file into Zed.
    • Use the Assistant Panel:
    • Open the assistant panel.
    • Use a slash command like /file example.py to load the file context or directly type the function into the chat.
    • Request a Modification:
      • Type in the assistant panel: Modify the greet function to accept an optional message parameter with a default value of 'Hello'. The function should use this message instead of 'Hello, '.
    • AI Response:
      • The AI responds with something like:
def greet(name, message="Hello"):
    print(message + ", " + name)
  • Attempt to Apply Changes:

    • Switch to the edit window where example.py is open.
    • You need to manually copy this new function definition into example.py.
  • Steps to Reproduce:

    1. Open Zed and load a file with a simple function as above.
    2. Use the assistant panel to request a modification to the function.
    3. Note the AI's response in the chat panel.
    4. Try to apply these changes back to the original file in the edit window.
  • Expected Behavior:

    • There should be an easy way to apply changes (like an apply button or automatic context-aware application).
    • The new function should replace the old one with a diff view for confirmation.
    • All changes should be ready to run without manual adjustments for basic scenarios.
  • Actual Behavior:

    • Manual copying of code is required.
    • The old function remains in the file unless manually deleted.
    • The application of changes feels disjointed and not at the "speed of thought" as advertised.

Zed Version and System Specs

Zed: v0.169.0 (Zed Preview)
OS: Linux X11 ubuntu 22.04
Memory: 31 GiB
Architecture: x86_64
GPU: NVIDIA GeForce GTX 1050 Ti with Max-Q Design || NVIDIA || 535.183.01

If applicable, add screenshots or screencasts of the incorrect state / behavior

image

If applicable, attach your Zed.log file to this issue.

No response

@Vanuan Vanuan added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Jan 9, 2025
@Vanuan
Copy link
Author

Vanuan commented Jan 9, 2025

So there are 3 key issues with Zed's AI assistance:

  1. No chat-based code application unlike Cursor - must manually apply changes
  2. Inline assist only handles single-line changes
  3. Selection workflow is unclear - "Transform" feature requires selecting text first with no visual indication

The screenshot shows where inline assistance could help but doesn't:
image

When explicitly asked about transformations, Zed incorrectly claims to have the capability:
image

For comparison, Bolt.new can apply diffs directly from chat and provides minimal diff outputs to reduce tokens.

@JosephTLyons JosephTLyons added ai Improvement related to Assistant, Copilot, or other AI features assistant AI feedback for Assistant (inline or panel) and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jan 9, 2025
@Cheirnomus
Copy link

Thanks for clarifying these fundamental limits to Zed's use of AI. Seeing that this type of issue is still at large prompts me to agree and also point out a related issue, where a more robust but still standard usage of AI is expected.

#21259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai Improvement related to Assistant, Copilot, or other AI features assistant AI feedback for Assistant (inline or panel) bug [core label]
Projects
None yet
Development

No branches or pull requests

3 participants