Skip to content

fix(graph-tools): sanitize exception logging and output in knowledge graph traversal - #19790

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
xyz-is-best:fix/graph-tools-sanitization-clean
Sep 29, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
xyz-is-best:fix/graph-tools-sanitization-clean

Conversation

@xyz-is-best

@xyz-is-best xyz-is-best commented Sep 29, 2026 •

Copy link
Copy Markdown

Summary

Sanitizes internal exception logging and prevents raw exception leakage to the caller in traverse_knowledge_graph_tool.

Changes

  • Imported sanitize from utils.log_sanitizer
  • Sanitized exception formatting in logger.exception
  • Returned generic safe error message "Error traversing knowledge graph: Unable to complete traversal." instead of raw {exc}
  • Added hermetic unit test in backend/tests/unit/test_graph_tools_sanitization.py

Failure-Class: new

Review in cubic

…graph traversal

Prevent internal exceptions from leaking into tool response strings and sanitize logger outputs.

Failure-Class: new

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanitizes exception leakage in knowledge-graph traversal, root cause clear, test added, CI green.

@kodjima33
kodjima33 merged commit 8405e67 into BasedHardware:main Sep 29, 2026
91 of 94 checks passed
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