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

fix(cli): resolve duplicate assistant text printing after 'Done' in non-compact text mode

オープン 初心者向け
#3,258 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

2026年7月11日 から。

  • #3273 @nankingjing による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
rust
領域
cli

調査の方向性

rust/crates/rusty-claude-cli/src/main.rs の LiveCli::run_turn 内から始め、非コンパクトテキストモードで streamed text、final_assistant_text、spinner.finish がどのように相互作用するかを調べます。そのモードで応答を指定して claw を実行し、アシスタントのテキストが一度だけ表示されること、最後の行が保持されること、Done ステータスも引き続き表示されることを確認します。

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

説明

Description

When running claw in non-compact text mode, the entire assistant response is printed twice.

  1. First, the text chunks are streamed and printed in real-time during the API call.
  2. Second, after ✔ ✨ Done is printed, the full assistant text (final_text) is printed again.

This causes a large amount of redundant output in the console, especially for long responses.

Cause

In LiveCli::run_turn (inside main.rs), spinner.finish("✨ Done") is called right after the conversation stream finishes.
Because spinner.finish moves the cursor to column 0 and clears the current line, it would erase the last line of the streamed text if we do not print a newline first.
To prevent this, the previous commit introduced a secondary full-text reprint:

let final_text = final_assistant_text(&summary);
if !final_text.is_empty() {
    let renderer = TerminalRenderer::new();
    println!("{}", renderer.markdown_to_ansi(&final_text));
}

However, this reprints the entire assistant message instead of just protecting the last line, causing the duplicate response.

Solution
  1. Print a newline before spinner.finish if the final_text is not empty. This moves the cursor to a new line, ensuring the line-clearing operation in spinner.finish only clears the empty line and does not corrupt the last line of the streamed text.
  2. Remove the redundant final_text reprint logic in run_turn.

Here is the proposed diff in rust/crates/rusty-claude-cli/src/main.rs:

@@ -7763,15 +7763,15 @@
         match result {
             Ok(summary) => {
                 self.replace_runtime(runtime)?;
-                spinner.finish(
-                    "✨ Done",
-                    TerminalRenderer::new().color_theme(),
-                    &mut stdout,
-                )?;
                 let final_text = final_assistant_text(&summary);
                 if !final_text.is_empty() {
-                    let renderer = TerminalRenderer::new();
-                    println!("{}", renderer.markdown_to_ansi(&final_text));
-                }
+                    println!();
+                }
+                spinner.finish(
+                    "✨ Done",
+                    TerminalRenderer::new().color_theme(),
+                    &mut stdout,
+                )?;
                 println!();
                 if let Some(event) = summary.auto_compaction {
主要言語
Rust
スター
195k
フォーク
108k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

ultraworkers/claw-code のほかの issue

ultraworkers/claw-code の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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