mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7961] [Feature]: Dottore: let a model use the OpenAI Responses endpoint #4370
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#4370
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 (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7961
Originally assigned to: @Promansis on GitHub.
What problem does this solve?
Dottore calls each of its two models in one of two formats: OpenAI's Chat Completions (
DOTTORE_<SLOT>_API=openai) or Claude's Messages (anthropic). Some providers serve GPT models only on the Responses endpoint (/v1/responses), or accept tool calls with reasoning only there. During the fork trial, for example, LinkAPI refused function tools with reasoning forgpt-6-lunaon Chat Completions.On such a provider, a GPT model cannot be Dottore's small or large model at all, and the team wants to be able to use GPT models there.
Proposed solution
Add a third API value,
responses, forDOTTORE_SMALL_APIandDOTTORE_LARGE_API. A model set to it is called through the OpenAI SDK's Responses API, with the same key and base URL settings asopenai.Calls stay stateless. Nothing is stored at the provider, and each turn's encrypted reasoning is sent back with the next turn, so the model keeps its reasoning between tool calls. The reply is converted to the Chat Completions shape the agent loop already uses, so the rest of the review is unchanged.
A working version of this provider was prototyped on the fork's lab branches in Promansis/Marinara-Engine@8b82196750, before Dottore moved to the two-model settings. It needs porting, not redesign.
Minimal fix
Files:
.github/dottore-review/dottore_review.pyand.github/dottore-review/README.md. No workflow change is needed, becausedottore-review.ymlalready passesDOTTORE_SMALL_APIandDOTTORE_LARGE_APIthrough unchanged.In
dottore_review.py:APIS: add"responses"and update its comment.model_slotthen accepts the value with no other change.review_clients: build theOpenAIclient forresponsesas well as foropenai.responses_input(messages): system messages becomeinstructions. User turns stay messages. An assistant turn resends its keptreasoning_items, then its text, then each tool call as afunction_callitem. Atoolmessage becomes afunction_call_outputitem with the samecall_id.responses_reply(...), with the same signature asopenai_reply:ctx.clients[settings["slot"]].responses.createwithstore=False,include=["reasoning.encrypted_content"],reasoning={"effort": ...}when an effort is set, and the call'scache_keyasprompt_cache_keythroughextra_body, asopenai_replydoes.{"type": "function", "strict": False, **tool["function"]}, only when there are tools.tool_choicevalues"auto"and"required"through unchanged, and convert only the named form to{"type": "function", "name": ...}. The lab version converted every value other than"auto", which fails on the"required"thatrun_agentnow sends.response.completedorresponse.incompleteevent. RaiseStreamStalledonresponse.failedorerror, on a stream that ends without a final response, and on httpx timeouts, asopenai_replydoes.SimpleNamespacewithcontent,tool_callsandreasoning_items. Map usage toprompt_tokens,completion_tokens,prompt_tokens_details.cached_tokensandcompletion_tokens_details.reasoning_tokens, socall_cost_usdand the telemetry lines need no change.chat: dispatchresponsestoresponses_reply.assistant_turn: keepreasoning_itemsin history next toclaude_blocks.watched: count Responses delta events for text, function-call arguments and reasoning. Theirdeltais a plain string, so today a stalled Responses stream would report zero streamed characters.In
README.md, listresponsesin the Models table'sAPIrow. Under "Switching a model", add a line saying to useresponseswhen the provider serves the model only on/v1/responses, with the same base URL form asopenai(ending in/v1).Out of scope: Claude Code repairs still require
DOTTORE_SMALL_API=anthropic. There is no change torun_agent, the prompts, the price table or the two-model design.Regression case: Dottore has no test harness in the repository, so the proof is a temporary script outside the repository, deleted afterwards. It feeds
responses_inputa recorded history of system, user, an assistant turn with reasoning items and one tool call, and the tool result. It asserts the item order, the matchingcall_ids and the resent reasoning. One live review on a pull request with known findings then runs with one model set toresponses, and checks theDottore roles:log line, a completed review and a non-zero cost line.Alternatives considered
Additional context
openaiandanthropicformats only.store=Falsewith encrypted reasoning) keeps reviews from leaving conversation state at the provider.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: