Skip to content

Bug_094_MUST_FIX — VND-NOTES-010: update_vendor_agent_notes accepts tab-only notes #241

@steadhac

Description

@steadhac

Component: finbot/tools/data/vendor.py → update_vendor_agent_notes
Root cause:

# No content check — "\t" passes through
new_notes = f"{existing_notes}\n\n{agent_notes}"   # ← produces "\n\n\t"

Steps to reproduce:

  1. Create a vendor
  2. Call update_vendor_agent_notes(vendor.id, "\t", session)

Expected behavior: ValueError raised — tab-only notes carry no meaningful content
Actual behavior: Tab character appended to vendor notes

How to execute:

pytest tests/unit/tools/test_vendor.py::TestUpdateVendorAgentNotes::test_vnd_notes_010_tab_only_notes_accepted_without_validation -v

Proposed fix:

if not agent_notes or not agent_notes.strip():
    raise ValueError("agent_notes must not be empty or whitespace-only")

Impact:
Confirms the whitespace guard must use .strip() (which catches tabs) rather than only checking for space characters.

Acceptance criteria:

  • "\t", "\t\t" raise ValueError
  • "Vendor reviewed" is accepted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions