mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2414] [Issue]: 11-PROV-CONTRACT-llm-request-gateway / 11-PROV-RUNTIME-llm-complete-provider-fanout drops rich completion result #1182
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1182
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2414
Originally assigned to: @SpicyMarinara on GitHub.
Summary
11-PROV-CONTRACT-llm-request-gateway and 11-PROV-RUNTIME-llm-complete-provider-fanout are not on par: refactor public non-stream LLM completion returns only a string, so rich provider result fields such as tool calls, finish reason, usage, and provider metadata are not exposed through the gateway.
Linked tracker: #2410
Expected behavior
Legacy
mainexposes a provider-neutral request/response contract where non-stream completions can return assistant text plus tool calls, finish reason, usage, and provider metadata. The provider fanout routes OpenAI-compatible, Responses API, Anthropic, Google/Vertex, Claude Subscription, ChatGPT local auth, Cohere, and local-compatible/custom providers through that richer shape.Acceptance criteria:
11-PROV-CONTRACT-llm-request-gatewayexposes a rich non-stream completion result at the shared gateway/API boundary, not onlystring.11-PROV-RUNTIME-llm-complete-provider-fanoutpreserves text plus tool calls, finish reason, usage, and provider metadata where providers return them.Actual behavior
Refactor
LlmGateway.completereturnsPromise<string>,llmApi.completeinvokesllm_complete, Taurillm_completereturnsValue::String, and Rustcomplete()discardscomplete_rich()fields. Rust has internal rich parsing for some providers, but the public non-stream command/gateway drops it, and Anthropic, Google/Vertex, and Claude Subscription are currently mapped to text-only rich results with empty tool calls.Steps to reproduce
llm_completeonrefactor.mainprovider contract andprovider.chatCompletegeneration use.Impact area
Environment
refactorparityscan, compared with legacymainLogs, screenshots, or video
Proof used: static trace only.
Legacy proof:
main:packages/server/src/services/llm/base-provider.ts:42,:75,:143defineChatMessage,ChatOptions, and richChatCompletionResult.main:packages/server/src/services/llm/provider-registry.ts:46-105fans out provider construction.main:packages/server/src/routes/generate.routes.ts:7437,:7487,:7505,:7510consumesprovider.chatComplete, usage, tool calls, and provider metadata.Refactor proof:
src/engine/capabilities/llm.ts:16-23,:39-43definesLlmRequestand string-onlycomplete.src/shared/api/llm-api.ts:35-39invokesllm_completewithout a rich wrapper.src-tauri/src/commands/storage/llm.rs:41-91builds the request and returnsValue::Stringforllm_complete.src-tauri/crates/llm/src/lib.rs:72-105defines internalLlmCompletionand provider fanout.src-tauri/crates/llm/src/lib.rs:79-80discardscomplete_rich()fields incomplete().src-tauri/crates/llm/src/lib.rs:1957-2013,:4236-4295parse tool calls for some OpenAI/Responses-compatible results.src-tauri/crates/llm/src/lib.rs:85-101,:3486-3498,:3883-3898map Anthropic, Google/Vertex, and Claude Subscription to text-only rich results.Regression notes
Confirmed parity gap from Target 11 Batch 1 Text LLM Gateway parityscan. No live provider calls were run.
Additional context
Surfaces:
11-PROV-CONTRACT-llm-request-gateway11-PROV-RUNTIME-llm-complete-provider-fanoutFollow-ups not chased in this issue: streaming/cancel/remote route proof, provider diagnostics, embeddings, image, TTS, translation, and broader Target 11 rows.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 6, 2026):
Fixed on refactor in 3067a9c7.\n\nWhat changed:\n- The shared LLM capability now exposes LlmCompletion and optional completeRich while keeping complete as the string-only compatibility helper.\n- llmApi.completeRich normalizes both rich objects and legacy string responses; llmApi.complete returns only content as before.\n- Tauri llm_complete now returns the serialized rich completion result from marinara_llm::complete_rich.\n- Rust LlmCompletion now carries content, toolCalls, finishReason, usage, and providerMetadata.\n- OpenAI-compatible/custom/local-compatible, OpenAI Responses/ChatGPT local auth, Cohere, Anthropic, Google/Vertex, and Claude Subscription now route through rich completion results where their current non-stream responses expose those fields. Anthropic/Google/Claude remain no-tool-call non-stream paths unless their provider response includes tool calls in a parser we support.\n\nVerification:\n- cargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm rich -- --nocapture\n- pnpm typecheck\n- cargo check --manifest-path src-tauri/Cargo.toml --workspace\n- pnpm check:architecture