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>
Switch TOOL_FORWARD_ENABLED default to true in runtime config and .env.example,
and add regression tests covering default-on and explicit false behavior.
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>
Add focused unittest coverage for auth/concurrency, schema normalization, and session-cache tooling behavior, and ignore local .gitnexus index artifacts.
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>