Skip to content

fix: normalize receives list of params to drop#766

Merged
asclearuc merged 1 commit intodevelopfrom
fix/normalize_tool_input_pop_param
May 6, 2026
Merged

fix: normalize receives list of params to drop#766
asclearuc merged 1 commit intodevelopfrom
fix/normalize_tool_input_pop_param

Conversation

@asclearuc
Copy link
Copy Markdown
Collaborator

@asclearuc asclearuc commented May 6, 2026

Summary

Normalize receives list of params to drop

Type

fix

Testing

  • Tests added or updated
  • Tested locally
  • ./builder test passes

Checklist

  • Commit messages follow conventional commits
  • No secrets or credentials included
  • Wiki updated (if applicable)
  • Breaking changes documented (if applicable)

Linked Issue

Fixes #

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced configurable key stripping for tool input normalization, allowing users to specify which keys should be removed from inputs while maintaining backward compatibility with default behavior.
  • Tests

    • Expanded test coverage to validate key stripping behavior including default scenarios, custom configurations, multiple keys, and edge cases.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

The normalize_tool_input function in rocketlib-python's filters module now accepts a configurable strip_keys parameter (default: ('security_context',)), replacing the hard-coded removal of security_context with a generalized stripping mechanism. Function signature, docstring, and test suite are updated accordingly.

Changes

Key Stripping Parametrization

Layer / File(s) Summary
Function Signature & Documentation
packages/server/engine-lib/rocketlib-python/lib/rocketlib/filters.py (lines 108–139)
strip_keys parameter added to normalize_tool_input with default ('security_context',). Docstring expanded to document parameter behavior and usage examples.
Core Implementation
packages/server/engine-lib/rocketlib-python/lib/rocketlib/filters.py (lines 182–193)
Hard-coded security_context removal replaced with a generalized loop that removes all keys listed in strip_keys after envelope unwrapping. Related comment updated.
Test Coverage
packages/server/engine-lib/rocketlib-python/tests/test_tool_input_helpers.py (lines 93–135)
Previous narrowly-scoped tests replaced with expanded suite validating: default stripping behavior, envelope-nested stripping, empty strip_keys to disable stripping, custom key replacement, multi-key stripping, and silent handling of missing keys.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

builder

Suggested reviewers

  • jmaionchi
  • Rod-Christensen
  • stepmikhaylov

Poem

🐇 A filter grows flexible, keys now configurable—
No longer locked to security's stance,
Strip what you will, ignore what you must,
The rabbit hops forward with striping finesse! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: making the normalize_tool_input function accept a configurable list of parameters to drop (strip_keys) instead of just hard-coded security_context removal.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/normalize_tool_input_pop_param

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the module:server C++ engine and server components label May 6, 2026
@asclearuc asclearuc enabled auto-merge (squash) May 6, 2026 17:00
@asclearuc asclearuc merged commit 805f610 into develop May 6, 2026
22 of 24 checks passed
@asclearuc asclearuc deleted the fix/normalize_tool_input_pop_param branch May 6, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:server C++ engine and server components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants