[PR #7965] [MERGED] feat(review): let a Dottore model use the OpenAI Responses endpoint #8029

Closed
opened 2026-10-24 04:09:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7965
Author: @Promansis
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @Promansis

Base: staging ← Head: feature(review)/7961-dottore-responses-api


📝 Commits (10+)

  • e6ece4b feat(review): let a Dottore model use the OpenAI Responses endpoint
  • 26ae54c Merge remote-tracking branch 'upstream/staging' into feature(review)/7961-dottore-responses-api
  • ed9f20f fix(review): treat cut-off Responses replies as capped and retry only transient failures
  • 48b3f76 Merge remote-tracking branch 'upstream/staging' into feature(review)/7961-dottore-responses-api
  • 8b3f88a Merge branch 'staging' into feature(review)/7961-dottore-responses-api
  • a775470 fix(review): retry a capped keep reply instead of returning an empty list
  • 9b62e00 Merge remote-tracking branch 'upstream/staging' into feature(review)/7961-dottore-responses-api
  • 8a7815e Merge branch 'staging' into feature(review)/7961-dottore-responses-api
  • 9e8a961 Merge branch 'staging' into feature(review)/7961-dottore-responses-api
  • 5fb58ac Merge branch 'staging' into feature(review)/7961-dottore-responses-api

📊 Changes

2 files changed (+146 additions, -21 deletions)

View changed files

📝 .github/dottore-review/README.md (+10 -6)
📝 .github/dottore-review/dottore_review.py (+136 -15)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7961

Why this change

  • Dottore can only call its two models through OpenAI's Chat Completions format or Claude's Messages format. Some providers serve GPT models only on the Responses endpoint (/v1/responses), or accept tool calls with reasoning only there. On those providers a GPT model cannot be Dottore's small or large model at all, and the team wants to use GPT models there.

What changed

  • DOTTORE_SMALL_API and DOTTORE_LARGE_API accept a third value, responses. A model set to it is called through OpenAI's Responses format, with the same key and base URL settings as openai.
  • 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.
  • A failed response reported inside the reply stream waits and retries only for a rate limit, a server error or a failure without an error code. Any other code fails at once.
  • A reply the provider cut short, by its output cap or a filter, drops its tool calls and is marked capped, as a Claude reply at its token cap is. A role that then has no tool call retries once at a lower effort.
  • In the shared agent loop, a reply cut off at its output cap now retries once at a lower effort for every role. Before, the scout, the one role that collects a list, ended its run with no places instead. This applies to Claude replies too. A cap that cannot be retried still fails the role, except that a scout that already kept places ends with them, as at its other limits.
  • A failed response without an error message now says so in the log, instead of printing the SDK object.
  • The Dottore README documents the new value and when to use it.
  • Existing openai and anthropic settings behave as before.
 chat(role)
-  reply = claude_reply if api == "anthropic" else openai_reply
+  reply = claude_reply    if api == "anthropic"
+          responses_reply if api == "responses"
+          openai_reply    otherwise
+
+responses_reply
+  responses_input(messages)   # system -> instructions, tool calls -> function_call items,
+                              # kept reasoning items resent ahead of each assistant turn
+  responses.create(store=False, include=[reasoning.encrypted_content], stream=True)
+  final response -> Chat Completions-shaped message and usage   # cost limit and telemetry unchanged
+  response.incomplete -> capped, tool calls dropped              # as claude_reply at max_tokens
+  response.failed / error -> ResponseFailed(code)                # retried only for rate limit, server error or no code

 run_agent(role, keep)
-  keep submission returned, then capped checked
+  capped checked first: retry once at lower effort; if no retry is left, raise, or return the places kept so far

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands run on 9b62e002d (the pushed head), except the first offline proof and the live probe. Those ran on ed9f20fd2, and the Responses provider code has not changed since apart from one log message:

Check Result
pnpm check exit 0; only existing lint warnings
python -m py_compile .github/dottore-review/dottore_review.py exit 0
git diff --check upstream/staging...HEAD exit 0
Offline proof, a temporary script outside the repo ALL PASS
Capped-reply proof, a temporary script outside the repo ALL PASS (7 cases); 5 of them fail on 8b3f88a5d, before the repair
Live probe, a temporary script outside the repo PASS, under $0.00001
  • Offline proof: it checks model_slot accepting responses, and the input conversion: item order, matching call_ids, resent reasoning and system text as instructions. It checks the request shape: store=False, include, effort, prompt_cache_key, tools only when present, and auto, required and named tool choice. It also covers the completed and incomplete final events, the usage mapping, failed responses backing off 15 s then 45 s, stalls and timeouts, and the stream counters. After Dottore's review it also checks that an incomplete response drops its tool call and sets capped, and that invalid_prompt fails at once while rate_limit_exceeded, server_error and a codeless failure retry.
  • Capped-reply proof: it drives run_agent through chat and the Responses provider with a stubbed stream and the pinned SDKs. A scout reply cut off mid-call retries once at the next lower effort and returns the retried places, including when the submit tool was forced. A second cap raises when nothing was kept, and returns the earlier places when some were. A scout already at the lowest effort raises at once. A real empty submission still returns an empty list without a retry, and the non-scout path is unchanged. A failure without a message reads the response failed: the provider gave no message.
  • Live probe: three turns through the new provider against LinkAPI (https://linkapi.ai/v1, gpt-6-luna, effort high). Turn 1 made a forced tool call. Turn 2 answered from the tool result with reasoning. Turn 3 resent turn 2's encrypted reasoning item, and the provider accepted it and answered correctly.
  • Local review: the CodeRabbit CLI is not installed on this machine and needs an interactive login, so it did not run. One read-only local review pass ran instead. It found one Medium, now repaired: a failed in-stream response retried at once and could trip the role's failure limit under a rate limit. Two Lows introduced by the diff were repaired.
  • Dottore Review on 26ae54c19: one Medium and one Low, both repaired in ed9f20fd2 (see the threads), and a README nitpick about /v1, also fixed.
  • Dottore Review on 48b3f7699: one Medium, a capped scout reply returned as an empty list, repaired in a77547087. Of its two nitpicks, the failure message is fixed. The retryable codes stay inline, where the comment beside them explains each one.

Manual verification notes

  • Manually verify a full Dottore review on a pull request with known findings, with one model set to DOTTORE_<SLOT>_API=responses. The Dottore roles: log line should show responses, the review should complete, and the cost line should be non-zero.
  • Manually verify a non-reasoning model on responses, if one will be used. Every request asks for reasoning.encrypted_content, and only reasoning models were tested.

Known limits:

  • There is no regression test in the repository, because Dottore has no Python test harness. The proofs above were temporary scripts.
  • Claude Code repairs still require DOTTORE_SMALL_API=anthropic.

Merge Danger

Door: two-way

The Responses provider changes nothing until a repository sets responses. The cap change in the agent loop applies to every provider: a scout reply cut off at its output cap now retries once at a lower effort instead of returning no places. Reverting the commits restores the old behavior.

Blast Radius: Dottore-only

Only the Dottore review tooling under .github/dottore-review/ changes. Marinara-Agents pins its wrapper to an Engine commit, so it picks this up only after a separate pin PR.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

The only doc change is .github/dottore-review/README.md, which is not under docs/, so no translated pack follows it.

UI evidence (if applicable)

Not applicable: no UI change.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7965 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature(review)/7961-dottore-responses-api` --- ### 📝 Commits (10+) - [`e6ece4b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e6ece4be04ed770315f90b9f9f058bc5404f165e) feat(review): let a Dottore model use the OpenAI Responses endpoint - [`26ae54c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26ae54c1967df94c0f6b4a4ba62e5f116a55133b) Merge remote-tracking branch 'upstream/staging' into feature(review)/7961-dottore-responses-api - [`ed9f20f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ed9f20fd28fe62e18c3876dd281597c747d25806) fix(review): treat cut-off Responses replies as capped and retry only transient failures - [`48b3f76`](https://github.com/Pasta-Devs/Marinara-Engine/commit/48b3f7699e4ca96588afb4b013b536388e44766d) Merge remote-tracking branch 'upstream/staging' into feature(review)/7961-dottore-responses-api - [`8b3f88a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8b3f88a5d5ae92f271f853f8b817624ffe543693) Merge branch 'staging' into feature(review)/7961-dottore-responses-api - [`a775470`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a7754708765a5c8ab38540828795a8fd88f5cd75) fix(review): retry a capped keep reply instead of returning an empty list - [`9b62e00`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9b62e002db0bfa8e7ff44316cf067656c65185e1) Merge remote-tracking branch 'upstream/staging' into feature(review)/7961-dottore-responses-api - [`8a7815e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8a7815ebb53b0be088c347c3584f220055fb45c8) Merge branch 'staging' into feature(review)/7961-dottore-responses-api - [`9e8a961`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9e8a9613235377df516a89149ab3f90fd033adc7) Merge branch 'staging' into feature(review)/7961-dottore-responses-api - [`5fb58ac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5fb58ac3b51b9caf5235c4c8e9efa054d4fd3c83) Merge branch 'staging' into feature(review)/7961-dottore-responses-api ### 📊 Changes **2 files changed** (+146 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `.github/dottore-review/README.md` (+10 -6) 📝 `.github/dottore-review/dottore_review.py` (+136 -15) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7961 ## Why this change - Dottore can only call its two models through OpenAI's Chat Completions format or Claude's Messages format. Some providers serve GPT models only on the Responses endpoint (`/v1/responses`), or accept tool calls with reasoning only there. On those providers a GPT model cannot be Dottore's small or large model at all, and the team wants to use GPT models there. ## What changed - `DOTTORE_SMALL_API` and `DOTTORE_LARGE_API` accept a third value, `responses`. A model set to it is called through OpenAI's Responses format, with the same key and base URL settings as `openai`. - 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. - A failed response reported inside the reply stream waits and retries only for a rate limit, a server error or a failure without an error code. Any other code fails at once. - A reply the provider cut short, by its output cap or a filter, drops its tool calls and is marked capped, as a Claude reply at its token cap is. A role that then has no tool call retries once at a lower effort. - In the shared agent loop, a reply cut off at its output cap now retries once at a lower effort for every role. Before, the scout, the one role that collects a list, ended its run with no places instead. This applies to Claude replies too. A cap that cannot be retried still fails the role, except that a scout that already kept places ends with them, as at its other limits. - A failed response without an error message now says so in the log, instead of printing the SDK object. - The Dottore README documents the new value and when to use it. - Existing `openai` and `anthropic` settings behave as before. ```diff chat(role) - reply = claude_reply if api == "anthropic" else openai_reply + reply = claude_reply if api == "anthropic" + responses_reply if api == "responses" + openai_reply otherwise + +responses_reply + responses_input(messages) # system -> instructions, tool calls -> function_call items, + # kept reasoning items resent ahead of each assistant turn + responses.create(store=False, include=[reasoning.encrypted_content], stream=True) + final response -> Chat Completions-shaped message and usage # cost limit and telemetry unchanged + response.incomplete -> capped, tool calls dropped # as claude_reply at max_tokens + response.failed / error -> ResponseFailed(code) # retried only for rate limit, server error or no code run_agent(role, keep) - keep submission returned, then capped checked + capped checked first: retry once at lower effort; if no retry is left, raise, or return the places kept so far ``` ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Commands run on 9b62e002d (the pushed head), except the first offline proof and the live probe. Those ran on ed9f20fd2, and the Responses provider code has not changed since apart from one log message: | Check | Result | | --- | --- | | `pnpm check` | exit 0; only existing lint warnings | | `python -m py_compile .github/dottore-review/dottore_review.py` | exit 0 | | `git diff --check upstream/staging...HEAD` | exit 0 | | Offline proof, a temporary script outside the repo | `ALL PASS` | | Capped-reply proof, a temporary script outside the repo | `ALL PASS` (7 cases); 5 of them fail on 8b3f88a5d, before the repair | | Live probe, a temporary script outside the repo | `PASS`, under $0.00001 | - **Offline proof:** it checks `model_slot` accepting `responses`, and the input conversion: item order, matching `call_id`s, resent reasoning and system text as `instructions`. It checks the request shape: `store=False`, `include`, effort, `prompt_cache_key`, tools only when present, and `auto`, `required` and named tool choice. It also covers the completed and incomplete final events, the usage mapping, failed responses backing off 15 s then 45 s, stalls and timeouts, and the stream counters. After Dottore's review it also checks that an incomplete response drops its tool call and sets `capped`, and that `invalid_prompt` fails at once while `rate_limit_exceeded`, `server_error` and a codeless failure retry. - **Capped-reply proof:** it drives `run_agent` through `chat` and the Responses provider with a stubbed stream and the pinned SDKs. A scout reply cut off mid-call retries once at the next lower effort and returns the retried places, including when the submit tool was forced. A second cap raises when nothing was kept, and returns the earlier places when some were. A scout already at the lowest effort raises at once. A real empty submission still returns an empty list without a retry, and the non-scout path is unchanged. A failure without a message reads `the response failed: the provider gave no message`. - **Live probe:** three turns through the new provider against LinkAPI (`https://linkapi.ai/v1`, `gpt-6-luna`, effort `high`). Turn 1 made a forced tool call. Turn 2 answered from the tool result with reasoning. Turn 3 resent turn 2's encrypted reasoning item, and the provider accepted it and answered correctly. - **Local review:** the CodeRabbit CLI is not installed on this machine and needs an interactive login, so it did not run. One read-only local review pass ran instead. It found one Medium, now repaired: a failed in-stream response retried at once and could trip the role's failure limit under a rate limit. Two Lows introduced by the diff were repaired. - **Dottore Review on 26ae54c19:** one Medium and one Low, both repaired in ed9f20fd2 (see the threads), and a README nitpick about `/v1`, also fixed. - **Dottore Review on 48b3f7699:** one Medium, a capped scout reply returned as an empty list, repaired in a77547087. Of its two nitpicks, the failure message is fixed. The retryable codes stay inline, where the comment beside them explains each one. ### Manual verification notes - Manually verify a full Dottore review on a pull request with known findings, with one model set to `DOTTORE_<SLOT>_API=responses`. The `Dottore roles:` log line should show `responses`, the review should complete, and the cost line should be non-zero. - Manually verify a non-reasoning model on `responses`, if one will be used. Every request asks for `reasoning.encrypted_content`, and only reasoning models were tested. Known limits: - There is no regression test in the repository, because Dottore has no Python test harness. The proofs above were temporary scripts. - Claude Code repairs still require `DOTTORE_SMALL_API=anthropic`. ## Merge Danger **Door:** two-way The Responses provider changes nothing until a repository sets `responses`. The cap change in the agent loop applies to every provider: a scout reply cut off at its output cap now retries once at a lower effort instead of returning no places. Reverting the commits restores the old behavior. **Blast Radius:** Dottore-only Only the Dottore review tooling under `.github/dottore-review/` changes. Marinara-Agents pins its wrapper to an Engine commit, so it picks this up only after a separate pin PR. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) The only doc change is `.github/dottore-review/README.md`, which is not under `docs/`, so no translated pack follows it. ## UI evidence (if applicable) Not applicable: no UI change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:47 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8029
No description provided.