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

Aperta Adatta ai principianti
#344 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend, cli

Direzione di ricerca

Leggi in src/utils/recorder.ts la sezione intorno a attachExitHandler e segui come le registrazioni terminate ottengono la loro durata; confronta il percorso di registrazione segmentata con quello del file ordinario. Verifica come src/tools/stopRecording.ts e src/cli.ts usano durationSec, poi esegui npm test. Il lavoro è completato quando una registrazione limitata riporta la propria durata tramite stop_recording e get_session, e CLI --last limita la GIF alla finestra richiesta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
1
Fork
4
Merge medio
14h 8m
PR unite (30g)
48

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/screencast-mcp

Tutte le issue di TMHSDigital/screencast-mcp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.