You are right, and I (and claude) addressed these issues.
1. Secrets redaction (proxy.ts):
- Add per-part offset tracking to prevent partial secret leaks
- Filter and adjust redaction positions for each text part
- Fixes issue where 'sk-proj-' prefix could remain visible
2. PII masking (masking.ts):
- Actually mask array content instead of returning original
- Add per-part offset tracking for accurate entity positions
- Properly handle multimodal arrays with text and images
3. Tests:
- Add content.test.ts for text extraction utilities
- Add multimodal.test.ts with integration tests