mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2420] [Issue]: 11-PROV-CONTRACT-tool-call-roundtrip drops OpenAI Responses tool roundtrip shape #1185
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#1185
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/2420
Originally assigned to: @SpicyMarinara on GitHub.
Summary
11-PROV-CONTRACT-tool-call-roundtripgap: OpenAI Responses tool-call transport does not preserve streamed tool calls and follow-up tool-result messages in the same provider-native shape legacy used.Linked target: #2410.
Expected behavior
Legacy OpenAI Responses transport maps assistant
tool_callsto Responsesfunction_callitems, maps tool messages tofunction_call_output, and accumulates streamed function-call deltas before returning final tool-call objects.Actual behavior
Refactor Responses input maps
toolmessages to plain user messages and ignores assistanttool_callswhen building Responses input. Refactor Responses streaming emits rawresponse.function_call_arguments.deltaevents astool_call; the engine normalizer requires a tool name/function shape, so streamed Responses tool calls can be dropped before execution/follow-up.Steps to reproduce
11-PROV-CONTRACT-tool-call-roundtripin #2410.main:packages/server/src/services/llm/providers/openai.provider.tsResponses tool input/stream handling with refactorsrc-tauri/crates/llm/src/lib.rs.function_call/function_call_outputhistory mapping and emits Responses argument deltas before they are final tool-call objects.Impact area
Environment
refactor@09923989Logs, screenshots, or video
Proof:
main:packages/server/src/services/llm/base-provider.ts:42main:packages/server/src/services/llm/providers/openai.provider.ts:685toolmessages tofunction_call_outputand assistanttool_callstofunction_call:main:packages/server/src/services/llm/providers/openai.provider.ts:1245main:packages/server/src/services/llm/providers/openai.provider.ts:1727tool_call_id,tool_calls, andtools:src-tauri/crates/llm/src/lib.rs:34src-tauri/src/commands/storage/llm.rs:51userand does not special-case tool history:src-tauri/crates/llm/src/lib.rs:1953tool_call:src-tauri/crates/llm/src/lib.rs:2196src/engine/generation/tools-runtime.ts:63Regression notes
Legacy
mainpreserved Responses tool roundtrip shape for follow-up tool-result messages and streamed function-call deltas. Refactor provider transport regresses that shape for OpenAI Responses.Additional context
Acceptance criteria:
11-PROV-CONTRACT-tool-call-roundtrippreserves assistanttool_callsand tool-result messages for OpenAI Responses using provider-nativefunction_call/function_call_outputinput items.id,function.name, andfunction.arguments.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 6fbaad26.\n\nWhat changed:\n- OpenAI Responses request input now preserves assistant tool_calls as provider-native function_call items.\n- Tool result messages now become function_call_output items.\n- Non-fc tool call IDs are mapped consistently to fc_mapped_N so function_call and function_call_output share the same Responses-valid ID.\n- Responses streaming now accumulates output_item.added, function_call_arguments.delta/done, and output_item.done/completed payloads, then emits final normalized tool_call chunks with stable id, function.name, and function.arguments.\n- Chat Completions/OpenAI-compatible tool-call accumulation was left intact.\n\nVerification:\n- cargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm openai_responses -- --nocapture\n- cargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm openai_chat_stream_accumulates_tool_call_deltas -- --nocapture\n- cargo check --manifest-path src-tauri/Cargo.toml --workspace\n- pnpm check:architecture