Skip to content

fix(tool): sanitize ScriptedTool callback errors#1239

Merged
chaliy merged 3 commits intomainfrom
fix/1172-scripted-tool-error-sanitize
Apr 12, 2026
Merged

fix(tool): sanitize ScriptedTool callback errors#1239
chaliy merged 3 commits intomainfrom
fix/1172-scripted-tool-error-sanitize

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 12, 2026

Summary\n\n- Add sanitize_errors option to ScriptedToolBuilder (default: true)\n- When enabled, callback Err(msg) is replaced with generic callback failed in tool output\n- Full error details logged at DEBUG level for operator visibility\n- Opt out via .sanitize_errors(false) for development/debugging\n\n## Test plan\n\n- [x] test_callback_error_sanitized_by_default — internal details stripped\n- [x] test_callback_error_unsanitized_when_disabled — full error preserved when opted out\n- [x] cargo clippy and cargo fmt clean\n\nCloses #1172

@chaliy chaliy force-pushed the fix/1172-scripted-tool-error-sanitize branch 2 times, most recently from 2d49c9b to df88d1a Compare April 12, 2026 10:00
Callback errors are now replaced with generic "callback failed" when
sanitize_errors is true (the default). Full error is logged at DEBUG
level. Opt out via `.sanitize_errors(false)`.

Closes #1172
@chaliy chaliy force-pushed the fix/1172-scripted-tool-error-sanitize branch from 1627986 to a276c78 Compare April 12, 2026 15:49
chaliy added 2 commits April 12, 2026 18:41
Tests were asserting raw error strings but the new sanitization
replaces them with generic "callback failed" messages.
@chaliy chaliy merged commit e5ab927 into main Apr 12, 2026
27 checks passed
@chaliy chaliy deleted the fix/1172-scripted-tool-error-sanitize branch April 12, 2026 21:13
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.

1 participant