Skip to content

Address all Copilot review comments on PR #68#69

Merged
davida-ps merged 1 commit intopr-67-abutbul-mainfrom
claude/explain-codebase-mlnit1low1h8d0o2-uetH4
Feb 15, 2026
Merged

Address all Copilot review comments on PR #68#69
davida-ps merged 1 commit intopr-67-abutbul-mainfrom
claude/explain-codebase-mlnit1low1h8d0o2-uetH4

Conversation

@davida-ps
Copy link
Copy Markdown
Collaborator

@davida-ps davida-ps commented Feb 15, 2026

User description

  • Fix ChromaDB persist() compatibility: wrap in try/except for 0.4.0+ which auto-persists with persist_directory
  • Replace fragile error string matching with specific exception types (ImportError, ConnectionError, ValueError, etc.)
  • Fix register_test decorator to return cls (was returning None)
  • Fix getter/setter inconsistency: embedding_provider and embedding_model setters now accept empty values matching getter defaults
  • Fix empty base_url passthrough: empty strings are now stripped from kwargs instead of passed to model constructors
  • Remove unused client variable assignments in test_chat_clients.py
  • Reorganize tests: move AppConfig, helper, and TestStatus tests out of test_is_response_list.py into dedicated test files

All 93 tests pass.

https://claude.ai/code/session_01CDFqeg5QhB4V7yQ3yVVBc9


Generated description

Below is a concise technical summary of the changes proposed in this PR:

graph LR
setup_poisoned_vector_database_("_setup_poisoned_vector_database"):::modified
CHROMADB_("CHROMADB"):::modified
run_("run"):::modified
HTTP_CLIENT_("HTTP_CLIENT"):::modified
ClientLangChain_init_("ClientLangChain.__init__"):::modified
OLLAMA_("OLLAMA"):::modified
OPENAI_("OPENAI"):::modified
setup_poisoned_vector_database_ -- "Calls persist but ignores AttributeError for auto-persist compatibility" --> CHROMADB_
run_ -- "Adds granular exception handling to report setup skips" --> HTTP_CLIENT_
ClientLangChain_init_ -- "Renames ollama_base_url to base_url if non-empty" --> OLLAMA_
ClientLangChain_init_ -- "Renames openai_base_url to base_url if non-empty" --> OPENAI_
classDef added stroke:#15AA7A
classDef removed stroke:#CD5270
classDef modified stroke:#EDAC4C
linkStyle default stroke:#CBD5E1,font-size:13px
Loading

Refines the application's core configuration and error handling logic to improve compatibility with external libraries like ChromaDB and LangChain. Reorganizes the test suite into dedicated modules and fixes several bugs in the attack registry and client parameter handling.

TopicDetails
Test Reorganization Reorganizes the test suite by moving AppConfig, TestStatus, and helper tests from test_is_response_list.py into dedicated files and cleans up unused variables.
Modified files (5)
  • tests/test_app_config.py
  • tests/test_chat_clients.py
  • tests/test_is_response_list.py
  • tests/test_prompt_injection_fuzzer_helpers.py
  • tests/test_test_status.py
Latest Contributors(1)
UserCommitDate
vitaly@prompt.securityInitial-commitApril 13, 2024
Core Logic Fixes Enhances robustness by replacing string-based error matching with specific exception types and ensuring AppConfig setters handle empty values consistently.
Modified files (4)
  • ps_fuzz/app_config.py
  • ps_fuzz/attack_registry.py
  • ps_fuzz/attacks/rag_poisoning.py
  • ps_fuzz/chat_clients.py
Latest Contributors(2)
UserCommitDate
guy@prompt.securityRemove-cache-for-cutom...July 29, 2024
vitaly@prompt.securityMake-debug-level-confi...April 16, 2024
This pull request is reviewed by Baz. Review like a pro on (Baz).

- Fix ChromaDB persist() compatibility: wrap in try/except for 0.4.0+
  which auto-persists with persist_directory
- Replace fragile error string matching with specific exception types
  (ImportError, ConnectionError, ValueError, etc.)
- Fix register_test decorator to return cls (was returning None)
- Fix getter/setter inconsistency: embedding_provider and
  embedding_model setters now accept empty values matching getter defaults
- Fix empty base_url passthrough: empty strings are now stripped from
  kwargs instead of passed to model constructors
- Remove unused client variable assignments in test_chat_clients.py
- Reorganize tests: move AppConfig, helper, and TestStatus tests out of
  test_is_response_list.py into dedicated test files

All 93 tests pass.

https://claude.ai/code/session_01CDFqeg5QhB4V7yQ3yVVBc9
@davida-ps davida-ps merged commit 6e1b65c into pr-67-abutbul-main Feb 15, 2026
4 checks passed
@davida-ps davida-ps deleted the claude/explain-codebase-mlnit1low1h8d0o2-uetH4 branch February 15, 2026 10:27
davida-ps added a commit that referenced this pull request Feb 15, 2026
* adding support for base_url with ollama and openai.
adding embedding
adding target temperature for embedding attacks
configuration. via file and menu
adding skipped test method
adding rag poisnoning attack
adding package creation dependencies via setup.py (oldschool)
adding uv package baseline
adding tests

* refactored provider and model prompts

* Disable bugged telemetry in RAG Poisoning test to prevent PostHog errors open-webui/open-webui#15624
+ add dependencies to base package

* restored comment

* configuration error should also skip

* Improve error handling for RAG poisoning attack  (these errors should be caught and warned)

* Update ps_fuzz/attacks/rag_poisoning.py

supress loggers

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update ps_fuzz/attacks/rag_poisoning.py

out of scope fail-safe

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update ps_fuzz/test_base.py

typo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update ps_fuzz/attacks/rag_poisoning.py

operator race condition

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/test_chat_clients.py

unused

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/test_chat_clients.py

redefined in #1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/test_chat_clients.py

unused

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update ps_fuzz/attacks/rag_poisoning.py

unused

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix tests, introduce claude.md

* Update README.md to include RAG & Vector Database Attacks section and enhance attack options

* Add Bandit configuration file and implement poisoned document creation in RAG poisoning attack

* Address all Copilot review comments on PR #68 (#69)

- Fix ChromaDB persist() compatibility: wrap in try/except for 0.4.0+
  which auto-persists with persist_directory
- Replace fragile error string matching with specific exception types
  (ImportError, ConnectionError, ValueError, etc.)
- Fix register_test decorator to return cls (was returning None)
- Fix getter/setter inconsistency: embedding_provider and
  embedding_model setters now accept empty values matching getter defaults
- Fix empty base_url passthrough: empty strings are now stripped from
  kwargs instead of passed to model constructors
- Remove unused client variable assignments in test_chat_clients.py
- Reorganize tests: move AppConfig, helper, and TestStatus tests out of
  test_is_response_list.py into dedicated test files

All 93 tests pass.

https://claude.ai/code/session_01CDFqeg5QhB4V7yQ3yVVBc9

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: David Abutbul <david@abutbul.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude <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.

2 participants