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

Unable to select Claude 3.5 Sonnet Zed model #16618

Closed
1 task done
thm76 opened this issue Aug 21, 2024 · 23 comments
Closed
1 task done

Unable to select Claude 3.5 Sonnet Zed model #16618

thm76 opened this issue Aug 21, 2024 · 23 comments
Assignees
Labels
ai Improvement related to Assistant, Copilot, or other AI features assistant AI feedback for Assistant (inline or panel) bug [core label]

Comments

@thm76
Copy link

thm76 commented Aug 21, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When I open the assistant tab there is no model selected.

I select "Claude 3.5 Sonnet Zed" from the dropdown but nothing changes - it still says "No model selected"

If I "Open configuration" the message under "Zed" says "You must accept the terms of service to use this provider" but it's not clear where and how I can view and accept the terms.

Environment

Zed: v0.150.0 (Zed Preview)
OS: macOS 15.0.0
Memory: 16 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Initial assistant tab:
Screenshot 2024-08-22 at 06 11 53

Available options:
Screenshot 2024-08-22 at 06 11 59

After selecting the first options nothing changes and the assistant tab looks the same as before (1st screenshot)

Screenshot 2024-08-22 at 06 12 07

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

Zed.log
2024-08-21T20:15:14.867709Z [INFO] connected to rpc endpoint https://collab.zed.dev/rpc
2024-08-21T20:15:15.058795Z [INFO] starting language server. binary path: "/Users/xxx/Library/Application Support/Zed/node/node-v22.5.1-darwin-x64/bin/node", working directory: "/", args: ["/Users/xxx/Library/Application Support/Zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-08-21T20:15:15.625514Z [INFO] add connection to peer
2024-08-21T20:15:15.626268Z [INFO] add_connection;
2024-08-21T20:15:15.627381Z [INFO] waiting for server hello
2024-08-21T20:15:15.629581Z [INFO] got server hello
2024-08-21T20:15:15.63115Z [INFO] set status to connected (connection id: ConnectionId { owner_id: 0, id: 0 }, peer id: PeerId { owner_id: 495, id: 29975 })
2024-08-21T20:15:15.632499Z [INFO] set status on client 102776: Connected { peer_id: PeerId { owner_id: 495, id: 29975 }, connection_id: ConnectionId { owner_id: 0, id: 0 } }
2024-08-21T20:15:15.912811Z [WARN] request completed with error: failed to connect to the server
2024-08-21T20:15:16.109082Z [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-21T20:15:16.087Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-08-21T20:15:16.087Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-08-21T20:15:16.125567Z [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "68a696b2-5b40-469b-bd01-83f66f6dd8cb",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-08-21T20:15:16.694574Z [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 1,
  "message": "[INFO] [auth] [2024-08-21T20:15:16.693Z] Invalid copilot token: missing token: 403 ",
  "metadataStr": "[INFO] [auth] [2024-08-21T20:15:16.693Z]",
  "extra": [
    "Invalid copilot token: missing token: 403 "
  ]
}
2024-08-21T20:15:16.695365Z [INFO] Language server with id 0 sent unhandled notification window/showMessageRequest:
{
  "type": 2,
  "message": "No access to GitHub Copilot found. You are currently logged in as xxx.",
  "actions": [
    {
      "title": "Sign up for GitHub Copilot"
    },
    {
      "title": "Dismiss"
    }
  ]
}
2024-08-21T20:15:16.729718Z [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-21T20:15:16.701Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-08-21T20:15:16.701Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
2024-08-21T20:15:17.307729Z [INFO] set environment variables from shell:/bin/zsh, path:/Users/xxx/.nvm/versions/node/v18.18.2/bin:/Users/xxx/Library/pnpm:/Users/xxx/.bun/bin:/Users/xxx/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/xxx/.cargo/bin:/usr/local/bin
2024-08-21T20:15:26.745544Z [WARN] request completed with error: failed to connect to the server
2024-08-21T20:15:26.822309Z [ERROR] no worktrees when constructing ProjectLspAdapterDelegate
2024-08-21T20:15:36.48047Z [ERROR] Failed to write settings to file "/Users/xxx/.config/zed/settings.json"

Caused by:
0: failed to persist temporary file: Cross-device link (os error 18)
1: Cross-device link (os error 18)
2024-08-21T20:16:03.295359Z [ERROR] Failed to write settings to file "/Users/xxx/.config/zed/settings.json"

Caused by:
0: failed to persist temporary file: Cross-device link (os error 18)
1: Cross-device link (os error 18)

@thm76 thm76 added admin read bug [core label] labels Aug 21, 2024
@nemith
Copy link

nemith commented Aug 22, 2024

Seriously where do i accept these terms.

@TIAcode
Copy link

TIAcode commented Aug 22, 2024

It will ask to accept the terms when you try to send the first message.

@nemith
Copy link

nemith commented Aug 22, 2024

Gotcha. Got it to work. It is important to note that it only works in the assistant pane. Using the assistant anywhere else (inline, etc) gives an error.

@notpeter notpeter added ai Improvement related to Assistant, Copilot, or other AI features assistant AI feedback for Assistant (inline or panel) and removed triage labels Aug 22, 2024
@thm76
Copy link
Author

thm76 commented Aug 22, 2024

It won't let me select the model in the first place, so I can't send a message (the "Send" button is disabled).

After clicking on the model in the dropdown I'm back to what the first screenshot shows, with "No LLM provider selected"

@thm76
Copy link
Author

thm76 commented Aug 22, 2024

I see the following in the log right after I try to select a model:

Caused by:
0: failed to persist temporary file: Cross-device link (os error 18)
1: Cross-device link (os error 18)
2024-08-22T19:51:53.052829Z [ERROR] Failed to write settings to file "/Users/ext/xxx/.config/zed/settings.json"

@mrnugget mrnugget self-assigned this Aug 23, 2024
@mrnugget
Copy link
Member

I'm going to add the accept-terms form to the configuration page too, but I think the problem you're seeing, @thm76, is related by different: is it possible that your Zed config is a symlink or lives on a different drive or something like that?

@thm76
Copy link
Author

thm76 commented Aug 23, 2024

I'm going to add the accept-terms form to the configuration page too, but I think the problem you're seeing, @thm76, is related by different: is it possible that your Zed config is a symlink or lives on a different drive or something like that?

My home folder is on a different volume from Zed Preview.app

@mrnugget
Copy link
Member

In #16736 I'm adding the accept-tos thing to the configuration view, but I don't think that will fix the problem that you can't select the model.

The problem is that we can't write the settings file (in which we want to write the selected model):

2024-08-21T20:15:36.48047Z [ERROR] Failed to write settings to file "/Users/xxx/.config/zed/settings.json"
Caused by:

0: failed to persist temporary file: Cross-device link (os error 18)

1: Cross-device link (os error 18)

2024-08-21T20:16:03.295359Z [ERROR] Failed to write settings to file "/Users/xxx/.config/zed/settings.json"


Caused by:

0: failed to persist temporary file: Cross-device link (os error 18)

1: Cross-device link (os error 18)

@diegodorado
Copy link

I am having a (probably) related issue:

My settings.json is indeed a symlink because I like to maintain in in sync through nix home-manager.

Trying to switch the llm from the UI, (both alt-M or with the mouse) does not change the selected model...but if a restart the editor it seems it does.

I discovered the following:

  1. change the llm (alt-m or mouse, smae thing)
  2. i can see settings.json changed (need to close and re-open the file)
  3. no UI changes
  4. even though the settings.json got change, say, to ollama, if i prompt to the assistant i do not see request made to ollama, for which i assume the setting got changed, but the model wasn't in some app state
  5. if a reopen the editor, the changes are applied.

I was tailing logs while doing this and haven't seen anything related.

Two things caught my attention:

  1. I was a little bit surprised that switching the model from the UI would change my settings default_model. I guess I was expecting that to be just a session state and not changing my settings.json without noticing it.
  2. I supose that zed has a special watcher for settings.json different than for other (maybe also symlinked) files? because if I change externally that settings.json the buffer does not watch for those changes

@mrnugget
Copy link
Member

mrnugget commented Sep 4, 2024

I am having a (probably) related issue:

My settings.json is indeed a symlink because I like to maintain in in sync through nix home-manager.

Does that mean it's on a different disk volume? Because I too have my settings.json symlinked (~/.config/zed/settings.json points to ~/.dotfiles/zed_settings.json) and everything you described works.

@diegodorado
Copy link

It is the same volume, but because of the home manager way I found to make a symlink out of the store it seems that it is a symlink of a symlink:

❯  file .config/zed/settings.json
.config/zed/settings.json: symbolic link to /nix/store/cxh2i1kdjxfhnnzvcidyxnqprcwk038x-home-manager-files/.config/zed/settings.json

~
❯  file /nix/store/cxh2i1kdjxfhnnzvcidyxnqprcwk038x-home-manager-files/.config/zed/settings.json
/nix/store/cxh2i1kdjxfhnnzvcidyxnqprcwk038x-home-manager-files/.config/zed/settings.json: symbolic link to /nix/store/98bh5mivyh8sckhw96virbdpkpvm4q5f-hm_settings.json

~
❯  file /nix/store/98bh5mivyh8sckhw96virbdpkpvm4q5f-hm_settings.json
/nix/store/98bh5mivyh8sckhw96virbdpkpvm4q5f-hm_settings.json: symbolic link to /home/diegodorado/Code/nix-config/zed/settings.json

~
❯  file /home/diegodorado/Code/nix-config/zed/settings.json
/home/diegodorado/Code/nix-config/zed/settings.json: ASCII text

I may spend some time to see if I can remove that nested symlink if a single symlink worked for you @mrnugget

@mrnugget
Copy link
Member

mrnugget commented Sep 5, 2024

Thank you! That's good debugging information.

@diegodorado
Copy link

@mrnugget thanks for the assistance. Turns out that nested symlink was causing the issue... that was because I symlinked the settings.json and keymap.json alone... I switched to symlinking the whole folder and gitignore conversations and locks and now it works as intended

@mrnugget
Copy link
Member

mrnugget commented Sep 6, 2024

@diegodorado great! thanks for letting me know!

@thm76 does symlinking play a role in your setup? It didn't sound like it does, but I want to be sure.

@thm76
Copy link
Author

thm76 commented Sep 6, 2024

@mrnugget There are no symlinks in my setup. My / is mounted from a different volume from /home - I think that might be the issue..

@thm76
Copy link
Author

thm76 commented Sep 11, 2024

This comes up in the log in v0.153.3:

2024-09-12T08:19:33.679273+10:00 [ERROR] Failed to write settings to file "/Users/ext/xxx/.config/zed/settings.json"

Caused by:
0: failed to persist temporary file: Cross-device link (os error 18)
1: Cross-device link (os error 18)

@agi-dude

This comment was marked as outdated.

@notpeter
Copy link
Member

I'm going to go ahead and close this as stale. If you are still seeing this, please open a new issue with clear steps to reproduce and happy to investigate further.

Thanks all.

@kopparam
Copy link

@thm76 I have the same problem. My home folder is on a different drive than /. Were you able to solve this?

@thm76
Copy link
Author

thm76 commented Jan 30, 2025

No, I haven't been able to solve it.

@notpeter it might be worth reopening this?

@kopparam
Copy link

kopparam commented Jan 30, 2025

@thm76 Just managed to get it to work. I suspect I need to do this for the keybindings too.

mv /Volumes/ExHome/k/.config/zed/settings.json /Volumes/Macintosh\ HD/Users/k/.config/zed/settings.json
ln -s /Volumes/Macintosh\ HD/Users/k/.config/zed/settings.json /Volumes/ExHome/k/.config/zed/settings.json

Copy the settings.json to internal drive. I mirrored the directory structure up from Users. Then created a symlink on the external drive, call it settings.json and point it to the text file in internal drive. In my setup, ExHome is external drive and Macintosh HD is internal drive. Restart Zed.

ls -l /Volumes/ExHome/k/.config/zed/settings.json 
lrwxr-xr-x@ 1 k  staff  55 Jan 30 12:58 /Volumes/ExHome/k/.config/zed/settings.json -> /Volumes/Macintosh HD/Users/k/.config/zed/settings.json

@notpeter
Copy link
Member

@kopparam @thm76 Can you take a look at the steps I described here:

And comment if this matches your configuration or if I'm missing something.
Thanks for sharing your workaround @kopparam.

@thm76
Copy link
Author

thm76 commented Jan 30, 2025

@notpeter #23907 describes the situation very well
@kopparam 's workaround works for me, thanks a lot.

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

8 participants