Export API: let a record name its session, carry tool names, and list the archive
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read core/sessionexport/record.go and walk.go for the current record fields and session matching, then compare the timeline data in core/session/timeline/timeline.go with Summaries(). Start with proposal 2: check how tool calls are projected and how errorMsgBudget limits data. Done means the agreed record response includes tool names with a defined cap and tests cover the projection; the issue leaves proposals 1 and 3 as additional work.
索引モデルが issue の本文から書いたものです。
説明
Three things a real user could not do with GET /v1/export
A user followed session-export-guide.md
and hit the same wall three times. Each one is a small addition to the endpoint, and each
one removes a hand-written join.
Docs for all three are in now (#1830), so none of this blocks use. These would stop the
docs having to teach a workaround.
1. A record cannot name its own session
--session takes a session id and matches it exactly — walk.go does a map lookup on
s.ID. So a user must first run:
curl -s 'http://localhost:47601/v1/sessions?archived=true' \
| jq -r '.sessions[] | select(.title) | "\(.id) \(.title[0:60])"'
to turn a title into an id, then export, then join the ids back to titles to label a
report. grep -c Title core/sessionexport/record.go is 0.
Proposal: ?include=title, opt-in and never default.
Opt-in matters. A title is derived from a /rename, else a user query, else ordinary
conversation, so it holds prompt text. Verified: on a fixture whose only message content
was SECRET-PROMPT-DO-NOT-EXPORT, that string became the session title verbatim.
An export promises to be content-free and therefore shareable. ?include=title breaks
that promise, which is why it must be requested explicitly and documented as doing so.
agentop export --with-titles would need the same warning.
2. Tool names are in a different endpoint from token counts
A record has toolCount and toolCallCount. It has no tool names. The timeline has
names but almost no tokens — grep over core/session/timeline/timeline.go finds only
outputTokens and liveTokens, with no inputTokens and no cache counts.
So "which tools ran, and what did those turns cost" needs both endpoints and a join on
seq. A user wrote this, with two curls and a mktemp -d:
jq -n --slurpfile tl "$D/tl.json" --slurpfile ev "$D/ev.json" -r '...'
Proposal: add the tool names the model asked for to the record, as a list on the
response record.
Names are not arguments. toolCalls[].Name is Bash, Read, Edit — the projection
already excludes Arguments, which is where content lives. So this keeps the
content-free property, unlike (1).
Worth checking first: a turn can request many tools, so this needs a cap and a rule for
what to drop, in the spirit of the existing errorMsgBudget.
3. No way to discover sessions from the export surface
Finding a session to export means a separate call to /v1/sessions?archived=true. The
export surface cannot answer "what is in here".
Proposal: ?list=1 returning one row per archived session: id, event count, first
and last at. This is what Summaries() already holds, so the walk does not run.
Lowest value of the three — the existing endpoint does work — but it would make the
export self-describing, and it costs nothing to serve.
Why not in #1830
That PR is five review rounds deep and is the endpoint itself. These are additions on
top, and (1) needs a privacy decision rather than a code review.
Order
2, then 3, then 1. (2) removes the most-painful join and is privacy-neutral. (3) is cheap.
(1) is last because opt-in-content is a policy question, and the workaround is one jq.
Refs #1810, #1830
- 主要言語
- Go
- スター
- 31
- フォーク
- 49
- 平均マージ
- 9時間 43分
- マージ済み PR(30日)
- 367
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rossoctl/cortex のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug laptop
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
rossoctl/cortex の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behind対応中かも @arshil42 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
ether/etherpad-go#571 ·
メンテナーはふだん 1 日以内に返信
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)オープンcost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sisaku-security/sisakulint#860 · コメント 2 件 ·