Skip to content

fix(transcribe): preserve saved output on write failure - #755

Open
rudycelekli wants to merge 1 commit into
Panniantong:mainfrom
rudycelekli:fix/xiaoyuzhou-output-commit-20261002
Open

rudycelekli wants to merge 1 commit into
Panniantong:mainfrom
rudycelekli:fix/xiaoyuzhou-output-commit-20261002

Conversation

@rudycelekli

Copy link
Copy Markdown

Problem

Both transcript output paths truncate the destination before writing: the CLI uses Path.write_text, and the standalone podcast script redirects its final report directly to the output. A mid-write failure returns nonzero but destroys a previously complete transcript.

A native OS file-size ceiling reproduces this in both paths, including an output symlink: the old complete output becomes partial data. Upfront path failures already return nonzero; this fix addresses loss of existing output after writing starts.

Changes

  • Assemble/write the complete transcript before replacing the destination, using a temporary file beside the resolved target.
  • Follow existing output symlinks to their target while preserving the link and existing regular-file permissions.
  • Keep previous data intact when staging, flushing or replacement fails, clean temporary files, and report a nonzero failure.
  • Require regular-file output targets so devices/FIFOs/directories are preserved rather than replaced.

The managed shell script remains standalone; it uses only the existing Python dependency. API, media, interpreter and polish behavior are unchanged. Atomic replacement creates a new file inode, so hard-link/owner metadata is not preserved; this does not promise recovery from every crash/power-loss scenario or directory fsync durability.

Validation

  • Before:4 failing native file-limit cases,4 successful-save controls; both CLI and shell paths and symlink targets covered.
  • After:11 focused cases pass, including portable UTF8 file replacement, permission preservation on POSIX, failed replacement cleanup, FIFO preservation/nonblocking refusal and staging cleanup.
  • Full suite:618passed.
  • Ruff all passed; bash syntax/diff checks clean.
  • mypy: same3 pre-existing MCP SDK2.2 diagnostics.
  • Format: same54 existing files, no additional failures.

No real podcast/Groq requests. The exact failure is a process file-size ceiling; a full-disk failure is an inference from the same write-error class, not a separate reproduction.

AI assistance: prepared with Codex and reviewed before submission.

Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
hbui290 added a commit to hbui290/Agent-Reach that referenced this pull request Oct 4, 2026
…g#747 Panniantong#589 Panniantong#762 Panniantong#717 Panniantong#754 + 10 low) (#14)

* fix(transcribe): keep ffmpeg off stdin and pass absolute paths (upstream Panniantong#769 Panniantong#770)

ffmpeg read the caller's stdin, so a 'q' there silently truncated the
audio. Relative names with ':' or a leading '-' were parsed as protocols
or options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(uninstall): exit nonzero on failed cleanup, cover OPENCLAW_HOME and dangling links (upstream Panniantong#746 Panniantong#747)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(skill): don't quote multi-word gh repo searches (upstream Panniantong#589)

A quoted multi-word query becomes an exact phrase and often returns 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(mcporter): accept comments and trailing commas in JSONC configs (upstream Panniantong#762)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(doctor): warn on undecodable cookies, ignore commented js-runtimes, honor HOME for yt-dlp config (upstream Panniantong#748 Panniantong#715 Panniantong#689)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(doctor): xiaoyuzhou checks ffprobe/curl/perl/python the script needs (upstream Panniantong#753)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(watch): report a failed update check instead of claiming latest (upstream Panniantong#653)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cli): read piped stdin as UTF-8 on Windows (upstream Panniantong#754)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(transcribe.sh): skip Python stubs that exist but cannot run (upstream Panniantong#717)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(boss): keep Windows profile path with spaces as one Chrome argument (upstream Panniantong#771)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(transcribe): write transcripts atomically and keep the text on write failure (upstream Panniantong#755)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cli): import Path for the atomic transcript writer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(test.sh): install the checkout via relative path for Windows pip (upstream Panniantong#607)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: 0xharry <0xharry@0xharrys-MacBook-Pro.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant