Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 7, 2026

Summary

  • t145: Make sed -i portable across macOS and Linux. Added sed_inplace() wrapper function to shared-constants.sh and 6 active scripts. macOS requires sed -i '' while GNU/Linux requires sed -i (no argument).
  • t141: Improve speech-to-speech-helper.sh stop reliability (polling loop instead of fixed sleep) and NLTK download error handling (visible warnings instead of silent suppression).

Changes

Commit Scope Description
34c7899 scripts sed_inplace() in 7 scripts, replace all sed -i '' calls
5b4eaef speech-to-speech Graceful stop polling, NLTK error handling

Scripts Modified (t145)

  • shared-constants.sh - canonical sed_inplace() definition
  • agent-test-helper.sh - replaced fallback pattern
  • privacy-filter-helper.sh - replaced direct call
  • quality-fix.sh - replaced 2 direct calls
  • security-helper.sh - replaced 3 direct calls
  • supervisor-helper.sh - replaced 3 platform-specific blocks
  • version-manager.sh - replaced 2 direct calls (function already existed)

Quality

  • ShellCheck: zero violations on all modified files
  • Archived scripts (_archive/) left as-is

Closes #440, closes #445

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error handling for speech module initialization with graceful failure recovery.
    • Improved shutdown sequence with extended timeout to allow graceful process termination before force-kill.
  • Chores

    • Improved cross-platform compatibility across build and helper scripts.

Add sed_inplace() function to shared-constants.sh and each script that uses
sed -i. macOS requires 'sed -i ""' while GNU/Linux requires 'sed -i'. The
wrapper detects the platform and uses the correct syntax.

Scripts fixed: agent-test-helper.sh, privacy-filter-helper.sh, quality-fix.sh,
security-helper.sh, supervisor-helper.sh, version-manager.sh.

Archived scripts left as-is (not actively used).
ShellCheck: zero new violations.
…g (t141)

cmd_stop: Replace fixed sleep 2 with polling loop (up to 5s) that checks
process termination every 0.5s before force-killing.

cmd_setup: Wrap nltk.download in error check so failures are visible
instead of silently suppressed. Non-fatal warning since not all TTS
engines require NLTK data.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 54 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

The PR resolves cross-platform sed portability issues by introducing a sed_inplace() helper function across multiple shell scripts to handle BSD (macOS) vs GNU (Linux) syntax differences. Additionally, speech-to-speech-helper.sh strengthens error handling for NLTK downloads and improves process termination logic.

Changes

Cohort / File(s) Summary
Cross-Platform sed Helper Functions
shared-constants.sh, agent-test-helper.sh, privacy-filter-helper.sh, quality-fix.sh, security-helper.sh, supervisor-helper.sh
Added sed_inplace() wrapper function to each script handling macOS Darwin (sed -i '') vs GNU/Linux (sed -i) differences. Replaced all direct in-place sed calls with unified helper invocations.
Version Manager Refactoring
version-manager.sh
Updated auto_mark_tasks_complete() to use sed_inplace() helper for checkbox toggling and timestamp appending operations.
Speech-to-Speech Enhancements
speech-to-speech-helper.sh
Modified setup flow to emit non-fatal warning on NLTK download failure instead of silent suppression. Extended stop flow with 5-second graceful shutdown wait (0.5s intervals) before force-termination, with updated messaging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐚 BSD and GNU at last unite,
sed_inplace brings portability to light,
Darwin and Linux now play as one,
Cross-platform harmony—the battle won! 🎯
NLTK waits gracefully, then takes its bow. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly summarizes the two main changes: sed portability across platforms and speech-to-speech reliability improvements, with linked issue references.
Linked Issues check ✅ Passed Pull request fully addresses both linked issues: #440 implements portable sed_inplace wrapper across scripts, and #445 improves speech-to-speech reliability with polling and error handling.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the two linked issues; no extraneous modifications detected beyond sed portability and speech-to-speech robustness fixes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/quick-fixes-t145-t141

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the robustness and cross-platform compatibility of the project's shell scripts. It standardizes sed in-place editing operations across different operating systems by introducing a dedicated wrapper function, eliminating platform-specific conditional logic. Additionally, it improves the stability of the speech-to-speech functionality by refining process termination and providing clearer feedback during NLTK data downloads.

Highlights

  • Cross-platform sed portability: A new sed_inplace() wrapper function has been introduced to abstract away the differences in sed -i syntax between macOS (which requires sed -i '') and GNU/Linux (which requires sed -i). This function is now defined and utilized across multiple shell scripts to ensure consistent in-place editing behavior.
  • Speech-to-speech reliability improvements: The speech-to-speech-helper.sh script has been enhanced for greater reliability. This includes a more robust process stopping mechanism using a polling loop for graceful shutdowns and improved error handling for NLTK data downloads, providing visible warnings instead of silent failures.
Changelog
  • .agents/scripts/agent-test-helper.sh
    • Added the sed_inplace() function definition for cross-platform sed -i operations.
    • Replaced a direct sed -i call with the new sed_inplace() function.
  • .agents/scripts/privacy-filter-helper.sh
    • Added the sed_inplace() function definition for cross-platform sed -i operations.
    • Replaced a direct sed -i call with the new sed_inplace() function.
  • .agents/scripts/quality-fix.sh
    • Added the sed_inplace() function definition for cross-platform sed -i operations.
    • Replaced two direct sed -i calls with the new sed_inplace() function.
  • .agents/scripts/security-helper.sh
    • Added the sed_inplace() function definition for cross-platform sed -i operations.
    • Replaced three direct sed -i calls with the new sed_inplace() function.
  • .agents/scripts/shared-constants.sh
    • Added the canonical sed_inplace() function definition, providing a centralized implementation for cross-platform sed -i operations.
  • .agents/scripts/speech-to-speech-helper.sh
    • Modified NLTK data download to display a warning if the download fails, rather than silently suppressing errors.
    • Updated the cmd_stop function to use a polling loop, waiting up to 5 seconds for graceful process termination before resorting to a force kill.
  • .agents/scripts/supervisor-helper.sh
    • Added the sed_inplace() function definition for cross-platform sed -i operations.
    • Replaced three platform-specific sed -i blocks with calls to the new sed_inplace() function.
  • .agents/scripts/version-manager.sh
    • Replaced two direct sed -i calls with the sed_inplace() function.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 26 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 17:06:21 UTC 2026: Code review monitoring started
Sat Feb 7 17:06:22 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 26
Sat Feb 7 17:06:22 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 17:06:24 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 26
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 17:06:24 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a portable sed_inplace wrapper function to handle differences between macOS and Linux sed, and refactors several scripts to use it. It also improves the reliability of the speech-to-speech-helper.sh script. The review identifies a few areas for improvement related to the refactoring: code duplication of the new function, a case of redundant code, and an instance where the new abstraction is used inappropriately. The changes to speech-to-speech-helper.sh are solid improvements.

Comment on lines 3887 to 3892
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' "${line_num}a\\
sed_inplace "${line_num}a\\
${notes_line}" "$todo_file"
else
sed -i "${line_num}a\\${notes_line}" "$todo_file"
sed_inplace "${line_num}a\\${notes_line}" "$todo_file"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using sed_inplace here is not ideal because the arguments to sed for the append (a) command are themselves platform-dependent (BSD vs. GNU sed have different syntax for newlines). The sed_inplace function only abstracts the -i flag. This leads to a redundant outer uname check and makes the code more complex than necessary. It would be clearer to revert this specific change to use sed -i '' and sed -i directly within the if/else block as it was before, since the abstraction doesn't fully cover this use case.

Suggested change
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' "${line_num}a\\
sed_inplace "${line_num}a\\
${notes_line}" "$todo_file"
else
sed -i "${line_num}a\\${notes_line}" "$todo_file"
sed_inplace "${line_num}a\\${notes_line}" "$todo_file"
fi
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' "${line_num}a\
${notes_line}" "$todo_file"
else
sed -i "${line_num}a\\${notes_line}" "$todo_file"
fi

log_header() { echo -e "${PURPLE}${BOLD}$*${NC}"; }

# Cross-platform sed in-place edit (macOS vs GNU/Linux)
sed_inplace() { if [[ "$(uname)" == "Darwin" ]]; then sed -i '' "$@"; else sed -i "$@"; fi; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This sed_inplace function is duplicated across multiple scripts in this PR (agent-test-helper.sh, privacy-filter-helper.sh, quality-fix.sh, security-helper.sh, supervisor-helper.sh). To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider having these scripts source shared-constants.sh to use the canonical function defined there. This would centralize the logic and make future updates easier.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged but intentionally deferred. These scripts are standalone (none source shared-constants.sh). Adding a source dependency to each would be a larger refactor with its own risks (path resolution, circular sourcing, etc.). The inline one-liner is self-contained and grep-able. A future refactor to consolidate via sourcing is tracked but not in scope for this bugfix PR.

# Apply redaction
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' -E "s/$pattern/[REDACTED]/g" "$file"
sed_inplace -E "s/$pattern/[REDACTED]/g" "$file"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While using sed_inplace is a good step towards portability, the surrounding if [[ "$(uname)" == "Darwin" ]] is now redundant because sed_inplace performs the same OS check internally. To simplify the code and avoid this redundant check, the entire if/else block should be replaced with a single call: sed_inplace -E "s/$pattern/[REDACTED]/g" "$file".

- privacy-filter-helper.sh: remove redundant uname check around sed_inplace
- supervisor-helper.sh: use direct sed -i for append command (syntax differs
  between BSD/GNU beyond just the -i flag, so sed_inplace can't abstract it)
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 26 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 17:14:19 UTC 2026: Code review monitoring started
Sat Feb 7 17:14:20 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 26
Sat Feb 7 17:14:20 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 17:14:22 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 26
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 17:14:22 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

@marcusquinn marcusquinn merged commit 6718f19 into main Feb 7, 2026
15 checks passed
@marcusquinn marcusquinn deleted the bugfix/quick-fixes-t145-t141 branch February 7, 2026 17:50
marcusquinn added a commit that referenced this pull request Feb 7, 2026
- Fix CPU-only auto-detect falling back to cuda (crashes on CPU hosts)
  Now defaults to --server mode with warning
- Add docker guard to cmd_stop (consistent with cmd_docker_start/cmd_status)
- Replace || exit with || return 1 in docker functions (proper set -e handling)
- Replace hardcoded 192.168.1.100 with <server-ip> placeholder in help
- Fix PyTorch version typo: 2.10+ -> 2.4+ (matches upstream torch>=2.4.0)
- Add API key storage guidance for OpenAI API usage

Already fixed in prior PRs (replied with evidence):
- nltk stderr suppression (PR #447)
- cmd_stop fixed sleep 2 -> polling loop (PR #447)
- transcribe command docs removed (commit fd2aa84)
- detect_gpu stderr no longer suppressed
- shift pattern refactored to explicit if/shift
- README Voice section already condensed

ShellCheck: zero violations.
marcusquinn added a commit that referenced this pull request Feb 7, 2026
- Fix CPU-only auto-detect falling back to cuda (crashes on CPU hosts)
  Now defaults to --server mode with warning
- Add docker guard to cmd_stop (consistent with cmd_docker_start/cmd_status)
- Replace || exit with || return 1 in docker functions (proper set -e handling)
- Replace hardcoded 192.168.1.100 with <server-ip> placeholder in help
- Fix PyTorch version typo: 2.10+ -> 2.4+ (matches upstream torch>=2.4.0)
- Add API key storage guidance for OpenAI API usage

Already fixed in prior PRs (replied with evidence):
- nltk stderr suppression (PR #447)
- cmd_stop fixed sleep 2 -> polling loop (PR #447)
- transcribe command docs removed (commit fd2aa84)
- detect_gpu stderr no longer suppressed
- shift pattern refactored to explicit if/shift
- README Voice section already condensed

ShellCheck: zero violations.
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.

t141: bug: speech-to-speech-helper.sh documents commands that don't exist t145: bug: sed -i '' is macOS-only, breaks on Linux/CI

1 participant