Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Piping certain cmd outputs to shell sage causes LiteLLM `This model does not support assistant message prefill. The conversation must end with a user message.`

オープン 初心者向け
#79 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python, shell
領域
cli

調査の方向性

ip yai/core.py で _shell_re と IPyAIExtension の completion パスを調べることから始め、報告されたコマンドの出力を ShellSage にパイプして失敗を再現します。リクエストの構築とキャッシュ動作を最小再現と比較します。同じパイプされた出力が LiteLLM assistant-prefill エラーなしで completion されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

diff --git a/ipyai/core.py b/ipyai/core.py
index c2e7e9e..7db83c1 100644
--- a/ipyai/core.py
+++ b/ipyai/core.py
@@ -102,7 +102,7 @@ prompt_from_lines astream_to_stdout transform_dots unload_ipython_extension""".s
 _prompt_template = """{context}<user-request>{prompt}</user-request>"""
 _tool_re = re.compile(r"&`(\w+)`")
 _var_re = re.compile(r"\$`(\w+)`")
-_shell_re = re.compile(r"!`([^`]+)`")
+_shell_re = re.compile(r"(?<![\w`])!`([^`]+)`")
 _tool_block_re = re.compile(
     r"<details class='tool-usage-details'>\s*<summary>([^\n]*?)</summary>\s*```json\s*(.*?)\s*```\s*</details>", flags=re.DOTALL)
 _status_attrs = "model completion_model think search code_theme log_exact".split()
@@ -788,7 +788,7 @@ class IPyAIExtension:
         parts.append("</current-input>")
         parts.append("\nReturn ONLY the completion text to insert immediately after the prefix."
             " Do not repeat the prefix or include any explanation.")
-        chat = AsyncChat(model=self.completion_model, sp=_COMPLETION_SP)
+        chat = AsyncChat(model=self.completion_model, sp=_COMPLETION_SP, cache=True)
         res = await chat("\n".join(parts))
         return (contents(res).content or "").strip()

Minimal repro. Piping this into shell sage leads to:

litellm.exceptions.BadRequestError: litellm.BadRequestError: AnthropicException - b'{"type":"error","error":{"type":"invalid_request_error","message":"This model does not support assistant message prefill. The conversation must end with a user message."},"request_id":"req_011CZSMPZ3QszFE6X6fwGrSC"}'

Might be a lisette issue.

主要言語
Jupyter Notebook
スター
409
フォーク
44
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AnswerDotAI/shell_sage のほかの issue

AnswerDotAI/shell_sage の issue をすべて見る

似ている issue

CLI の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。