Repository navigation
feat(tui): /btw で作業を止めずに横から質問する - #74
Open
yukihamada wants to merge 2 commits into
Open
yukihamada wants to merge 2 commits into
yukihamada wants to merge 2 commits into
Conversation
- サーバーに POST /session/:id/btw を追加。直近40件のメッセージとセッションの
目的(タイトル)からテキスト抜粋を作り、別の1回限りのモデル要求で答える。
ツールなし(tools={}・toolChoice none・全権限 deny のエージェント)、
使い捨てのセッションIDで送り、会話履歴・実行状態・キャッシュキーに触れない。
- モデルは small_model(未設定ならメインのプロバイダの小型モデル、なければメイン)。
- 失敗は error、空回答は空文字で返し、TUI が表示を分ける。
- TUI: /btw <質問>(別名 /side)をサーバーへ送らず手元で処理し、閉じられる
パネルに回答を表示。実行中でも使える。esc で閉じると要求を中断、r で再試行。
- 費用はセッションに入らないため KV(btw_spend)に記録し、ステータス行の
「今回 / 今日」に加算する。
- SDK v2 を再生成(session.btw)。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Codex(/side)・Grok(/btw) と同じ「作業中のエージェントを止めずに横から短い質問をする」機能を Sente の対話画面(packages/tui)に追加します。本家 OpenCode のデスクトップ版 /btw(packages/app・
session.generate)を参考にしましたが、このフォークのサーバーには同等の API が無いため、専用エンドポイントを足しています。使い方
/btw <質問>(別名/side)。メインが生成中・ツール実行中でも使えます。esc/enterで閉じる(待機中なら要求を中断)、空回答・失敗時はrで再試行、↑↓/PageUp/Downでスクロール。/btwだけなら使い方をトースト表示。入力候補・/help に表示されます。設計
POST /session/:sessionID/btw{question, providerID?, modelID?}→{text, providerID, modelID, cost, tokens, error?}(packages/sente/src/session/btw.ts)。tools: {}・toolChoice: "none"・全権限 deny のエージェント。small_model(設定可能)/メインのプロバイダの小型モデル > メインのモデル。errorに入れて 200 で返す(TUI でプロバイダの文言をそのまま出すため)。空回答は空文字。/btwはサーバーのコマンドに送らず手元で処理(/mode・/vと同じ場所)。DialogBtwが SDKsession.btwを呼ぶ。btw_spend、2日分)に記録し、ステータス行の「今回 / 今日」に加算します。session.btwと型のみ。生成時に出た無関係なConfig.resourcesの差分は含めていません)。テスト
packages/sente:bun test test/session/btw.test.ts test/server/session-btw.test.ts→ 12 passpackages/tui:bun test test/util/btw.test.ts→ 8 pass、パッケージ全体 467 pass / 0 failbun run typecheck: sente・tui とも通過(pre-push の全パッケージ typecheck も通過)packages/sente全体: 4042 pass / 26 fail。26件は base(headless-model-fallback fc902f4)でも同じ26件が失敗(差分なし・既存失敗。skill の .claude/skills 探索、session.llm.stream の payload、audit bash deny、loop 系、webfetch 204/205、CLI help スナップショット 等)実機確認
隔離DB(
SENTE_DB=btw-dev-test.db)でソースから TUI を起動し、teai/auto で長い回答を生成させている最中に/btw 今なにをしている?一言でを実行。未対応
🤖 Generated with Claude Code