feat(bg_remover): harden skill to v0.2.0#266
Open
AyushSrivastava1818 wants to merge 8 commits into
Open
Conversation
Contributor
|
Thanks for picking this up @AyushSrivastava1818, the hardening direction looks right (session cache, validation, size limits, v0.2.0). Before I can review the code, the branch history needs a clean reset.
What to do
git fetch upstream
git checkout main
git pull upstream main
git checkout -b feat/bg-remover-hardening-v0.2-clean
git push -u origin feat/bg-remover-hardening-v0.2-cleanScope check vs #257Keep this PR to: session reuse, input/path/size validation + distinct error codes, docs/tests/manifest Once the diff is only v0.1 → v0.2 on top of current |
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.
Description
This PR upgrades the
creative/bg_removerskill to v0.2.0 by improving performance, robustness, and documentation.Changes
Cache
rembginference sessions to avoid repeated session creation.Add comprehensive input validation:
Enforce a maximum input size of 25 MB.
Automatically create parent directories for
output_path.Update skill documentation and usage guidance.
Bump the skill version to 0.2.0.
Expand tests to cover the new validation and caching behavior.
Type of Change
Checklist (all PRs)
Fixes #257)python -m black --check .andflake8pass locally (or CI-equivalent subset)pytest skills/andpytest tests/pass locally when relevantCHANGELOG.mdupdated under[Unreleased]when user-visible behavior changesexamples/README.mdupdated if this PR adds, renames, or removes a runnable script (not applicable)pytest tests/test_registry_docs.pywhen skills, examples index, or agent-loops matrix changed (not applicable)New or updated skill
Bundle and metadata
skills/<category>/<skill_name>/manifest.yamlupdated with version and metadataLogic, cognition, tests
skill.pyinstructions.mdupdatedcard.jsonissuer matches manifest (unchanged)test_skill.pyupdated to cover new behaviorDocumentation and catalog
docs/skills/bg_remover.mdupdatedConstitution and safety (skills only)
The skill performs all processing locally using
rembg. It validates inputs before processing, rejects invalid or oversized inputs, and does not make external network requests after the initial model download.Related Issues
Fixes #257