Add a proxy-side tool emulation layer so Lingma requests can surface stable OpenAI tool_calls and Anthropic tool_use blocks even when upstream tool events are missing or inconsistent.
Constraint: Keep native Lingma tool event bridging as the first path and layer emulation as a fallback
Rejected: Depend exclusively on Lingma native tool/invoke events | tool visibility remains inconsistent across models and transports
Confidence: high
Scope-risk: moderate
Deduplicate allowlist filtering and forced-tool fallback parsing across the OpenAI and Anthropic non-stream bridge paths while preserving existing wire behavior.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Keep the current tool-call bridge contract stable while extracting shared
execution setup and tightening Anthropic forwarding regressions.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move tool bridge and responses adapter helpers out of app.main so the main entrypoint can shrink without changing route orchestration behavior.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>