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.`
まだ誰も着手していません。
評価
調査の方向性
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 はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AnswerDotAI/shell_sage のほかの issue
-
Sassy `mode` from config file is ignored (only CLI `--mode` works)対応中かも @galopyz が 67 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AnswerDotAI/shell_sage#97 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
AnswerDotAI/shell_sage#103 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
AnswerDotAI/shell_sage#98 ·
-
Add terminal history capture for Ghostty対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
AnswerDotAI/shell_sage#94 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
AnswerDotAI/shell_sage#77 · コメント 1 件 ·
AnswerDotAI/shell_sage の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Yeachan-Heo/oh-my-codex#3822 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Jeffy123-zhu/logspecter#20 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
test(compositor): cover centered reflow-shift eviction success path and document fallback contractsオープンreview-followup
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
griffinwork40/agent-afk#4125 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信