Skip to content

refactor: reduce complexity of codebase#44

Merged
pythoninthegrass merged 4 commits into
mainfrom
gnhf/reduce-complexity-of-856a4f
Apr 23, 2026
Merged

refactor: reduce complexity of codebase#44
pythoninthegrass merged 4 commits into
mainfrom
gnhf/reduce-complexity-of-856a4f

Conversation

@pythoninthegrass
Copy link
Copy Markdown
Collaborator

Summary

This branch eliminates ~800 lines of duplicated boilerplate across the Rust backend and JavaScript frontend by extracting shared helpers and removing unnecessary wrapper functions.

Changes

Backend (Rust)

  • Extracted tool_def() helper in agent/tools.rs, eliminating 8 duplicated ToolDefinition blocks
  • Removed an unnecessary wrapper function in commands/audio.rs
  • Throttled model pull progress logging from real-time streaming to 10-second intervals with percentage status (e.g., 26% - pulling dec52a44569a)

Frontend (JavaScript)

  • Extracted tauriInvoke() helper in shared.js
  • Refactored all 10 API modules to use the shared helper, eliminating ~800 lines of duplicated try/catch/if(invoke) boilerplate

Testing

  • Full test suite passes: 797 Rust tests + 481 JS unit tests

pythoninthegrass and others added 4 commits April 23, 2026 05:23
…in agent/tools.rs (eliminating 8 duplicated ToolDefinition blocks) and removing an unnecessary wrapper function in commands/audio.rs
…ll 10 API modules to eliminate ~800 lines of duplicated try/catch/if(invoke) boilerplate
The `debug!`/`warn!` macros are only used in `safe_list_output_devices_subprocess`,
which is `#[cfg(not(test))]`. Without the matching gate on the import, `cargo test`
fails with `-D warnings` due to unused imports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pythoninthegrass pythoninthegrass merged commit 4ba8be8 into main Apr 23, 2026
7 of 8 checks passed
@pythoninthegrass pythoninthegrass deleted the gnhf/reduce-complexity-of-856a4f branch April 23, 2026 20:29
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