Skip to content

fix(vendor): prevent None agent_notes writing literal string to DB#267

Open
sshekhar-04 wants to merge 3 commits intoGenAI-Security-Project:mainfrom
sshekhar-04:fix/bug-041-agent-notes-none-vendor
Open

fix(vendor): prevent None agent_notes writing literal string to DB#267
sshekhar-04 wants to merge 3 commits intoGenAI-Security-Project:mainfrom
sshekhar-04:fix/bug-041-agent-notes-none-vendor

Conversation

@sshekhar-04
Copy link

Problem

Fixes #143

When update_vendor_status and update_vendor_agent_notes are
called with agent_notes=None, f-string interpolation writes the
literal string "\n\nNone" into the vendor audit trail.

Fix

Added or '' guard with .strip() on agent_notes in both functions.

Before:

new_notes = f"{existing_notes}\n\n{agent_notes}"

After:

new_notes = f"{existing_notes}\n\n{agent_notes or ''}".strip()

Files Changed

  • finbot/tools/data/vendor.py — fixed 2 occurrences
  • tests/unit/tools/test_vendor.py — added 6 tests

Tests ✅

All 6 passing.

Closes #143

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.

Bug_041_MUST_FIX : Test Case VND-UPD-008 — update_vendor_status with agent_notes=None writes literal "None" into notes

1 participant