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

pi-coding-agent: Pi 1.4 system messages dropped, so LLM spans have no system prompt or tools

オープン
#2,662 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@pcbeingused333 がすでに取り組んでいます。

2026年10月25日 から。

  • #2663 @pcbeingused333 による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
observability

調査の方向性

Start in js/src/instrumentation/plugins/pi-coding-agent-plugin.ts: normalizePiMessage currently returns [] for role:"system" messages and normalizePiContextInput only reads context.systemPrompt. Read pi-agent-core's StreamFn/SystemMessage docs (content, sections, toolsAdded, toolsRemoved) and reproduce with Pi 1.4 by checking that an openai.responses.create span under AgentSession.prompt gains system input and metadata.tools. Done: system messages are normalized into input, tools are folded from toolsAdded/toolsRemoved with a fallback to context.tools, and executors are wrapped from agent.state.tools.

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

説明

Summary

With @earendil-works/pi-coding-agent / pi-agent-core / pi-ai 1.4.0, the Pi Coding Agent integration (js/src/instrumentation/plugins/pi-coding-agent-plugin.ts, braintrust 3.39.0 and main at 50280e8b1) records LLM spans with no system prompt and no tool list.

Cause

Pi 1.4's agent loop calls the stream function with a normalized TranscriptContext. Its system prompt and tool declarations travel only in role: "system" messages (SystemMessage: content, sections, toolsAdded, toolsRemoved). pi-agent-core's StreamFn doc says: "the system prompt and tool declarations are carried by the transcript's system messages, never by context.systemPrompt or context.tools."

The plugin reads only those absent fields:

  • normalizePiContextInput adds a system message only from context.systemPrompt;
  • normalizePiMessage returns [] for a role: "system" message, so the transcript's system messages are dropped;
  • extractToolMetadata(context.tools) (LLM span metadata.tools) and wrapPiToolExecutors(context.tools) see undefined.

Observed

In our dev project, every openai.responses.create LLM span under AgentSession.prompt has an input of only user/assistant/tool messages and no metadata.tools; the prompt span has pi_coding_agent.active_tools (names only). There is no plugin option to recover this: spanCustomizers.onSpanExport runs after the data is gone.

Suggested fix

  • Normalize each SystemMessage into a { role: "system", content } input message, rendering content followed by its sections (later messages replace sections by name; null removes one), or at least keep the message's content and sections.
  • Fold toolsAdded / toolsRemoved across the transcript's system messages into the declared tool set and report it as metadata.tools, falling back to context.tools for callers that still pass it.
  • Wrap tool executors from the agent's tools (agent.state.tools) rather than context.tools.

We work around it by adding the agent state's systemPrompt and tools to the AgentSession.prompt span through a span customizer.

主要言語
TypeScript
スター
29
フォーク
21
平均マージ
1日 13時間
マージ済み PR(30日)
67

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

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

braintrustdata/braintrust-sdk-javascript のほかの issue

braintrustdata/braintrust-sdk-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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