Skip to content

[Bug] knowledge _update_content silently bails when content row missing #7754

@Goodnight77

Description

@Goodnight77

Description

Knowledge._update_content and Knowledge._aupdate_content in libs/agno/agno/knowledge/knowledge.py perform aget_knowledge_content lookup before upserting. when the row is missing, both methods log a warning ("Content row not found for id: ..., cannot update status") and return None instead of letting the backend upsert insert the new row. the field-merge logic between the sync and async variants is also duplicated

Steps to Reproduce

  1. create a Knowledge instance with a SqliteDb (or any BaseDb) attached as contents_db
  2. build a Content with an id that does not exist in the contents table
  3. call knowledge._update_content(content)
  4. observe the warning log and None return value, the row is never written

Agent Configuration (if applicable)

No response

Expected Behavior

the call should produce a row for the given id by trusting the backend upsert_knowledge_content. on a missing row this means insert; on an existing row it means partial update with metadata merge preserved

Actual Behavior

on a missing row the method logs "Content row not found for id: ..., cannot update status" and returns None. nothing is written. the same code path exists in _aupdate_content

Screenshots or Logs (if applicable)

No response

Environment

- OS: Windows 11
- Python: 3.13.7

Possible Solutions (optional)

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions