feat(audio-transcribe): skill manifest + fix empty-file race in bridge result_watchers#1874
Open
bassilkhilo-ag2 wants to merge 3 commits into
Open
Conversation
Adds manifest.json (version 1.0.0, free tier) so the skill is discoverable by the skill-installer. Adds frontmatter to SKILL.md for consistency with other skills that expose name/description metadata. Also adds tests/bridge-result-race-guard.test.py — structural regression test confirming all 3 bridges (slack/discord/telegram) guard against the empty-file race where a bridge polls a result file before the write completes and archives it empty, permanently losing the reply. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a result file is written via shell redirect (> file), the OS creates the file empty before the process writes content. The bridge result_watcher polls every ~2s; if it fires during that window it reads an empty string, skips the send, but still pops pending_replies and archives the file — permanently losing the reply with no error logged. Fix: add `if not reply_text: continue` after read_text().strip() and BEFORE the irreversible .pop() in all three bridge result_watcher loops (slack-bridge.py, telegram-bridge.py, discord-bridge.py). Regression test: tests/bridge-result-race-guard.test.py (structural check added in preceding commit) verifies the guard is present and ordered correctly in all 3 bridges. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXQJogmVSdYrKtYX1LwzwT
Contributor
|
@cla-assistant check |
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.
What
Three changes in two commits:
skills/audio-transcribe/manifest.json— adds skill manifest (version: 1.0.0,tierRequired: free) so the skill is discoverable by the skill-installer.skills/audio-transcribe/SKILL.md— adds YAML frontmatter (name,description) for consistency with other skills.src/slack-bridge.py,src/discord-bridge.py,src/telegram-bridge.py) — addsif not reply_text: continueguard in each bridge'sresult_watcherloop, before the irreversible.pop()onpending_replies.The race bug (commit 3)
When a result file is written via shell redirect (
> file), the OS creates it empty before content is written. The bridge polls every ~2s; if it fires during that window:reply_text = result_file.read_text().strip()→""pending_replies.pop(task_id)→ removes the mapping (irreversible)Fix: add
if not reply_text: continueBEFORE.pop(). The file stays; the next poll (2s later) finds it non-empty and sends.Bug surface: active since at least PR #1453 (voice note bridging). Highest-risk path: Slack and Telegram where long Gemini responses can lag the redirect.
Test
tests/bridge-result-race-guard.test.py— structural regression test added as part of this PR. Checks all 3 bridges for the guard in the correct position (after read, before pop).Checklist
continuenotreturn(stays in the watcher loop)🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KXQJogmVSdYrKtYX1LwzwT