openai-sdk: empty systemPrompt produces trailing blank lines in agent instructions
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- ai
調査の方向性
src/agents/openai-sdk.ts の buildInstructions から始め、systemPrompt が baseInstructions とどのように結合されているかを確認します。空のプロンプトと空白文字のみのプロンプトのテストを追加し、それらの出力が undefined の場合と一致し、末尾に空行がないことを検証します。
索引モデルが issue の本文から書いたものです。
説明
Observed behavior
buildInstructions in src/agents/openai-sdk.ts only branches on systemPrompt === undefined:
return systemPrompt === undefined
? baseInstructions
: `${baseInstructions}\n\n${systemPrompt}`;
When systemPrompt is the empty string (or whitespace-only), the join produces ...this mode.\n\n and the resulting instructions value ends with trailing blank lines.
import { buildSandboxAgentOptions } from 'loop-the-loop/agents/openai-sdk';
const opts = buildSandboxAgentOptions({ systemPrompt: '' }, false, '/repo');
console.log(/\n\s*$/.test(opts.instructions)); // true
This mirrors the codex-cli issue fixed in #17.
Expected behavior
An empty or whitespace-only systemPrompt should be treated as if it were omitted, so the rendered instructions match the systemPrompt === undefined output exactly (no trailing blank lines, no extra separator).
Possible fix
const trimmed = systemPrompt?.trim();
return trimmed ? `${baseInstructions}\n\n${trimmed}` : baseInstructions;
Add a test that passes systemPrompt: '' and asserts the result equals the undefined case.
Severity: S4. Trailing whitespace is cosmetic and unlikely to confuse the model, but the inconsistency is easy to fix.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
joewalker/loop-the-loop のほかの issue
-
bug S4
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal informationオープンbug S3
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
joewalker/loop-the-loop#79 ·
joewalker/loop-the-loop の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
outline/outline#14348 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Agent import retains quotes in .env API keys followed by inline comments対応中かも @yxr-2025 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
elie222/rakazo#2322 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
awslabs/visual-asset-management-system#804 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
dsh-market/dsh-market#1027 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信