Skip to content

Preserve all original tool input fields instead of whitelisting#17

Open
wjessup wants to merge 2 commits intopeteromallet:mainfrom
wjessup:preserve-tool-inputs
Open

Preserve all original tool input fields instead of whitelisting#17
wjessup wants to merge 2 commits intopeteromallet:mainfrom
wjessup:preserve-tool-inputs

Conversation

@wjessup
Copy link

@wjessup wjessup commented Mar 1, 2026

Summary

_parse_tool_input previously hardcoded a whitelist of known fields per tool, silently dropping any unrecognized parameters. For example, Read only kept file_path — if the original input had offset, limit, or any other field, those were lost. This made the exported data less useful for training and analysis, since the tool call signatures didn't match what was actually sent.

This PR replaces the per-tool whitelist approach with a single recursive anonymizer that preserves all original fields while still applying the correct anonymization:

  • Path keys (file_path, targetFile, cwd, workdir, etc.) → anonymizer.path()
  • Command keys (command, cmd) → redact_text() + anonymizer.text()
  • All other stringsanonymizer.text()
  • Nested dicts/lists → recursively anonymized

This is a net deletion of ~75 lines and passes all 301 existing tests unchanged (the previously tested fields still appear in output — extra fields are now additionally preserved).

What changes for exported data

  • Tool inputs now include all parameters the agent actually sent, not just a curated subset
  • No schema change — input is still a dict, just with more keys when the original had them
  • Privacy guarantees unchanged — all strings still go through anonymization/redaction

Made with Cursor

will added 2 commits February 28, 2026 12:36
Parses conversations from Cursor's local SQLite database (state.vscdb), extracting user/assistant messages, tool calls, thinking blocks, and token counts. Cursor-specific code lives in dataclaw/parsers/cursor.py with the main parser.py delegating to it. Includes 11 tests covering discovery, parsing, tool calls, MCP prefix stripping, thinking, and nested JSON unwrapping.

Made-with: Cursor
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