0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Github Copilotで「uvがインストールされていないのでserenaが使えません」と出たので調べてみた

Posted at

実行環境:windows11

VSCodeでGithub Copilotを使っているときに、
uvがインストールされていないのでserenaが使えません
というエラーメッセージが出てきたので調べてみた。

結論としては、uvを入れるとcopilotのserena含むagentモードがフル機能で動くらしい。

エラーの状況

uvがない状態でもaskモードは普通に動いた。
image.png

しかしagenetモードにすると赤い警告マークが表示されるようになった。
image.png

この状態でもagentモードは動いたが、毎回このマークが出て気になるので調べてみた。
image.png
serenaとかcontext7とかいろいろ出てきた。どうやらcopilot agentの機能がいろいろ使えていないらしい。

serenaとは

AIにプロジェクト全体のコードを深く理解させるためのローカル分析エンジンらしい。
Github Copilotの新しいアーキテクチャではこのserenaを経由して

  • コード検索
  • ディレクトリ構造の解析
  • 成形タスク
  • コンテキスト中質

などの処理を高速化してるらしい。
つまりserenaが起動していない=copilot agentが本気を出せていない状況
これが使えないのはなかなかもったいないので有効化していく。

serenaを動かすにはuvが必要とのこと。

uvとは

Rust製のPythonパッケージ管理ツールで仮想環境の作成やpythonバージョン管理、pip install的な処理を高速化してくれるものらしい。

uvをインストールする(Windows)

powershellで以下を実行

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

ただ自分の環境では以下のエラーが出た

Error: PowerShell requires an execution policy in [Unrestricted, RemoteSigned, Bypass] to run uv.

調べると「外部スクリプトを実行できない」というエラーだったので、一時的に制限を緩める方法で実行した。

powershell -ExecutionPolicy Bypass -c "irm https://astral.sh/uv/install.ps1 | iex"

インストール後に以下を実行してバージョンが表示されたらOK

uvx --version

Copilot agentモードを確認

VS Codeを再起動してCopilot chatを開くと、agentモードの赤いマークが消えていた。
image.png

レンチマークを押してみるとserenaを有効化できるようになっていた。
image.png

これでagentモードをフル機能で使えるようになった。

参考サイト:
https://note.com/npaka/n/n44c54312fb04
https://qiita.com/masakinihirota/items/a2c0ef5e6f9a0aa868d1

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?