Expand description
Utility modules for AI API handling
These utilities provide robust handling for common AI API edge cases:
- Unicode sanitization for safe JSON serialization
- JSON parsing with repair for malformed streaming responses
- Context overflow detection across providers
- Tool call ID normalization for cross-provider compatibility
Modules§
- json_
parse - Robust JSON parsing utilities
- overflow
- Context overflow detection utilities
- sanitize_
unicode - Unicode sanitization utilities
- secret_
obfuscator - Secret obfuscator — ported from omp
packages/coding-agent/src/secrets/obfuscator.ts. - thinking_
loop - Thinking-loop detector — ported from omp
packages/ai/src/utils/thinking-loop.ts. - tool_
call_ loop - Cross-turn tool-call loop guard — ported from omp
packages/ai/src/utils/tool-call-loop-guard.ts.
Functions§
- normalize_
tool_ call_ id - Normalize a tool call ID for cross-provider compatibility.