Improve proxy-side tool instructions so models more reliably emit structured tool actions, and add focused tests covering prompt guidance and default action limits.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Expose capability discovery plus admin-only config and request inspection endpoints so clients and operators can understand gateway behavior without reading code.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Avoid replaying buffered text at the end of OpenAI streams so text-only responses are emitted once while forced tool fallback behavior stays intact.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Align TOOL_FORWARD_ENABLED docs with the current default and add count_tokens/auth/backpressure regressions so Anthropic compatibility stays stable.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Lock the current Anthropic streaming asymmetry so future refactors do not silently synthesize tool blocks. Align schema and docs with the actual support level to avoid over-promising forced-tool fallback.
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>
Ensure /v1/responses streams always terminate with response.completed and normalize Lingma tool_code fallbacks into structured tool calls, including single-argument forms.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ensure /v1/responses streaming always emits completion frames on upstream EOF, errors, and cancellation, and add targeted diagnostics for interrupted Lingma streams.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Stabilize cross-protocol ask-mode/streaming behavior and reduce session-reuse branch collisions, then add focused docs/tests for multimodal normalization and pool/stats/config paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Emit a fallback response.completed and [DONE] when upstream SSE closes early so OpenAI /v1/responses clients do not fail on incomplete streams.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Implement a thin responses layer that reuses existing chat/completions execution so auth, pooling, streaming, tool passthrough, and error semantics stay aligned across APIs.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Force OpenAI tooling-context requests into agent mode and align Lingma ask payload fields for agent requests so server-side tool path matches VSCode semantics.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Forward tool/call/sync and tool/invoke events to Lingma with auto-approve and invokeResult so tool calls can complete end-to-end.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Use agent ask_mode for Anthropic messages with tooling context so tool/write flows are executed, and add regression coverage plus docs/env updates for TOOL_FORWARD_ENABLED.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ensure session reuse is disabled for tooling contexts, include tool config in cache keys, and stabilize tool event merge/routing with expanded bridge tests.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Handle tool/invokeResult and richer tool/call/sync payloads in the client,
and document/retest the verified VSCode monitoring workflow for tool events.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add structured tool event propagation from Lingma stream/finish metadata and map it to OpenAI tool_calls and Anthropic tool_use/tool_result in both streaming and non-streaming responses. Add focused bridge tests and update docs/design notes to match current behavior.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>