A recording that ends at its maxDurationSec cap never gets a durationSec

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

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

まだ誰も着手していません。

評価

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

調査の方向性

src/utils/recorder.ts の attachExitHandler 周辺を読み、終了した録画の長さがどのように決まるかを追ってください。分割録画の経路と通常のファイルの経路を比較してください。src/tools/stopRecording.ts と src/cli.ts が durationSec をどのように使うかを確認し、npm test を実行してください。上限に達した録画の長さが stop_recording と get_session を通じて報告され、CLI --last が GIF を指定された時間範囲に制限すれば完了です。

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

説明

bug effort: small priority: medium

Summary

When capture exits on its own (cap reached, window closed), attachExitHandler writes the end status but probes the file only for segmented recordings or ones with a webcam. An ordinary recording keeps durationSec undefined, so stop_recording returns durationSec: null and the CLI's --last window is lost.

Where

  • src/utils/recorder.ts:129-140 (attachExitHandler)
  • src/tools/stopRecording.ts:115 (durationSec: record.durationSec ?? null)
  • src/cli.ts:296-297, 512, 547, 642-656 (tailWindow(null, lastSec) returns {})

Impact

  • Agents calling stop_recording after the cap get a null duration, and get_session never shows one, although the tool promises "returns the path and duration".
  • screencast-mcp record -- <cmd> in the case it warns about (the run outlived the cap) makes the evidence GIF and the OCR error scan cover the whole recording (up to the cap) instead of the last --last seconds.

Steps to reproduce

  1. start_recording {"target":"region:0,0,64,64","maxDurationSec":2}, then wait 5 s.
  2. stop_recording returns {status:"stopped", endReason:"max_duration", durationSec:null}.

Suggested fix

On every unrequested exit that leaves a file, probe record.outputPath and patch durationSec (a small async finalizeEnded() that either joins segments or just probes). Alternatively, have stop_recording's not-active branch probe the file when durationSec is missing.

Acceptance criteria

  • A capped recording reports its duration from stop_recording and get_session.
  • CLI --last limits the GIF on a capped run.

Getting started

  • Relevant files: src/utils/recorder.ts, src/tools/stopRecording.ts, src/cli.ts
  • How to run tests: npm test

Filed by repo-audit/full-audit at b9b94fa. Severity: medium. Effort: S. audit-key: bug|src/utils/recorder.ts|attachExitHandler

主要言語
TypeScript
スター
1
フォーク
4
平均マージ
14時間 8分
マージ済み PR(30日)
48

環境構築

はじめの一歩

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

TMHSDigital/screencast-mcp のほかの issue

TMHSDigital/screencast-mcp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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