[PR #7941] [MERGED] feat: support ToAPIs through existing media connections #8016

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

📋 Pull Request Information

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

Base: staging ← Head: codex/7922-toapis-media


📝 Commits (10+)

  • 8f12e3e chore: start ToAPIs media compatibility work
  • e0b96f9 feat: support ToAPIs through existing media connections
  • d47b478 fix: honor ToAPIs paid-task boundaries and verified video preset
  • 3dcbf73 test: name inferred custom connection deadline proof precisely
  • bc6f88d fix: honor configured response limits for ToAPIs output
  • 2b83395 Merge branch 'staging' into codex/7922-toapis-media
  • d6921e3 fix: scope ToAPIs deadlines and sanitize rejection details
  • 59f0aa6 fix: redact decoded ToAPIs errors before display truncation
  • f5d14b4 fix: redact normalized ToAPIs credentials in errors
  • 686039b fix: arm ToAPIs deadline guard at task submission

📊 Changes

5 files changed (+1300 additions, -4 deletions)

View changed files

📝 packages/server/src/lib/logger.ts (+34 -0)
📝 packages/server/src/services/image/image-generation.ts (+27 -4)
➕ packages/server/src/services/media/toapis-media.ts (+397 -0)
📝 packages/server/src/services/video/video-generation.ts (+3 -0)
➕ scripts/regressions/toapis-media.regression.ts (+839 -0)

📄 Description

Linked issue

Closes #7922

Why this change

ToAPIs text already works through Custom (OAI-Compatible), but changing the media base URL alone fails: its image API returns an asynchronous task, and its video API uses a different request and polling contract. This adds the compatibility requested by @SpicyMarinara without another branded provider or service choice.

What changed

  • Reuse Image Generation → OpenAI (DALL-E) and Video Generation → Seedance 2.0 with https://toapis.com/v1 or https://toapis.cn/v1, the user's API key, and a manually entered model ID. Provider and service catalogs are unchanged; text remains on Custom (OAI-Compatible).
  • Map asynchronous submission, reference-image upload, status polling and output retrieval for ordinary gpt-image-2 and seedance-2-mini. Image scope is one 1k image, Auto quality, at most one reference, and the common 1:1, 16:9, 9:16, 3:2 and 2:3 ratios. Video scope is text or one first frame, exactly 4 seconds, 480p, 16:9 and audio off. Unsupported settings fail before buying a task.
  • Restrict the adapter to the exact HTTPS ToAPIs origins. Validate uploads and media bytes, honor existing image/video response-byte ceilings, bound API responses, propagate cancellation, and download output without forwarding API credentials. API redirects cannot replay a paid POST. A narrow symbol opt-in on ToAPIs errors protects standard Error, err/error and formatted-Error log calls at info and above, including cause wrappers and Gallery; unmarked errors retain the existing Pino behavior. The useful HTTP reason remains on the thrown/UI error and one capped, sanitized debug diagnostic. Non-HTTP polling transport faults retain their original diagnostic at debug, with cancellation excluded. Known local receipt UUIDs remain in marked wrapper metadata without reintroducing provider text above debug. This covers standard logging arguments and cycle-safe finite cause chains, not arbitrary nested containers or provider text already interpolated into a raw string. Definite submission rejections retain their HTTP status and a capped, sanitized reason with keys, current task IDs and URLs redacted; transient polling GET errors have bounded retries.
  • Preserve private task receipts without keys or prompts. Once a paid task might exist, failures and local deadlines cannot buy an automatic replacement through Engine fallback. The guard starts at the generation submission boundary. A reference-upload deadline can still use the configured fallback before any generation POST; an abort while saving its initial receipt records not_submitted and permits the same unpaid fallback, and ordinary Gemini chat-image fallback on the same base URL is preserved. They also expose a stable retryable: false contract for package retry loops; the related Marinara-Agents safety follow-up covers Noodle 1.5.9 and Slurp 0.3.53, including delayed automatic post/artwork retries. This companion PR has merged and published to Marinara-Agents staging as Noodle 1.5.9 and Slurp 0.3.53; installed consumers must update before using ToAPIs automation. Publication verification matched all 14 raw files, every ZIP payload and all three catalog lanes to the reviewed source, without claiming a main release or upgrades of existing installations. Pre-submission validation/rejection can still use an existing fallback. Receipts support manual reconciliation, without adding a resume UI.

The adapter and integration proof were adapted from the linked AGPL-3.0 community reference and independently reviewed and validated. Existing OpenAI and Seedance contracts retain their original paths.

Validation

Human checklist, intentionally unchecked:

  • 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
  • Read and followed CONTRIBUTING.md

Completed local evidence:

  • pnpm install and pnpm check: passed. The existing HomeProfessorMariChat.tsx hook dependency warning remains.
  • node scripts/run-regressions.mjs --filter scripts/regressions/toapis-media.regression.ts: 45 integration checks passed, including real connection save/masking, Test Image/Test Video, Gallery image/file and first-frame video routes. Only provider HTTP/DNS is mocked. Negative controls cover legacy services, invalid inputs, private output URLs, cancellation, deadline races, transient/permanent polling failure, receipt permissions, configured image/video download ceilings, nonretryable markers including explicit OpenAI and inferred custom-connection deadline paths, and no paid POST replay or fallback. New controls cover reference-upload deadline fallback with no task/receipt, Gemini chat-image deadline fallback, HTTP reasons, HTML stripping, escaped, nested JSON and whitespace-normalized credentials, partial-key truncation and encoded task-ID redaction, unknown JSON metadata omission, and oversized error-body rejection. The stalled transport control also verifies the real deadline abort reason and that its emergency guard never fired. Four additional checks retain all prior 39 cases while covering the held receipt-save deadline, actual shared-Pino JSON serialization for marked direct/wrapped/field/formatted/child errors and unmarked cause/cycle controls and 40 ordinary wrappers around a marked error, rate-limited polling and both media fallback warnings, and the real Gallery rejection route with its useful UI reason preserved.
  • Neighboring image-edit-reference, image-result-url-security and image-generation-timeout regressions passed.
  • pnpm smoke:ui: 7/7 desktop Chromium checks passed.
  • Native Gallery image → Animate → Review Video Prompt → Generate → persisted Gallery video → playback passed on desktop Chromium, mobile Chromium and mobile WebKit, with no page errors (3/3). This used actual app routes, mocked external provider HTTP, a mocked prompt-preview response, an installed-Illustrator catalog fixture for the existing Gallery control, and the community's already-public MP4 as the output fixture. The updated proof configures the exact 4s/480p/16:9 preset and asserts it at the mocked provider boundary. It proves routing, saving and browser playback; it is not a fresh paid ToAPIs generation or live Illustrator package installation/execution. Temporary browser harness and screenshots remain outside the application diff; retained backend regression covers the contract.
  • Local CodeRabbit found three valid issues initially; all were fixed. Its substantive review of the initial implementation covered all four changed files and completed with zero findings. Hosted review then identified the defensive default-compatible deadline guard, package retry contract and settings scope; the Engine fixes are included here and the package fix is merged and published to Agents staging in the companion PR. An independent review also identified a download-cap bypass; the adapter now receives the existing image/video limits from its callers. Independent before/after proof through the real image/video entry points confirms configured 16-byte ceilings reject the same 70-byte PNG and 24-byte MP4, retain retryable: false, and submit only one task each. After the shared included-review quota reset, a fresh local CodeRabbit review of implementation head bc6f88da70063afc654d16a8f26b20248f12b939 completed across all four changed files with zero new findings. No billing changes were made. The storage-format suggestion was traced and rejected: optional task-receipt sidecars do not change the canonical storage/manifest.json or table layout.

Manual verification notes

  • Manually configure a real ToAPIs image and video connection, then generate an image, edit with one reference, and animate a first frame using live credits.
  • Manually verify interrupted-task reconciliation from the private receipts before retrying a paid task.

No fresh live API task, billing settlement or physical-device behavior is claimed. The earlier full hosted CodeRabbit review covered implementation bc6f88da70063afc654d16a8f26b20248f12b939; source identity was preserved by GitHub update-branch head 2b8339566ad218802e4a4b700d4e2a97e6aae83c. A genuine Dottore examination of 2b833956 then found two valid issues: URL-only deadline classification and missing HTTP rejection details. The current follow-up fixes both with the focused before/after proof above. Receipts remain intentionally durable for manual reconciliation: automatic pruning could discard the identity of an uncertain paid task. Splitting the small upload/task response type is a readability suggestion, with existing runtime validation retained; neither suggestion changes this compatibility fix.

Current follow-up head: 8fabd679eec6b11df662a03c04c96a7105b5943e. Full pnpm check, all 45 offline integration checks, formatting/diff checks and independent source/security audits pass. The independent combined staging candidate also passed all 39 checks, full pnpm check and URL-security regression; this is local integration proof, not a claim that pending hosted checks have passed.

Local review found a deadline-proof weakness and a nested-JSON privacy edge; both are fixed. Its later claim that the padded-key control bypassed ToAPIs was rejected: generateOpenAI dispatches this exact origin directly to the adapter, native Headers normalizes the trailing space, and both the real-entry regression and direct-adapter negative control observe that behavior. The final redactor compares the stored and normalized key. The final local CodeRabbit review of 59f0aa6b41ad029397db66d71c2ba6d7ab63cfb2 through 686039b327e205973ef11c4b8d47ba28d68950c5 covered all three follow-up files and completed with zero new findings. The only subsequent change moves the byte-identical OpenAI/default dispatch block to the switch end, preserving the existing static backend-coverage regression; source identity was proved and the unchanged reference, timeout and 39-check regressions, full pnpm check, format and diff checks passed after the move. This does not claim that local review covered the later relocation commit.

Genuine hosted Dottore review of 59f0aa6b returned one LOW finding: a deadline during reference upload was marked nonretryable before generation submission. The final private callback arms the deadline guard only after the initial receipt save and an abort check, immediately before the generation API call. The new upload control reproduces the old failure and now proves one ordinary fallback, zero ToAPIs generation POSTs and no new receipt; existing explicit/default post-submission and Gemini controls remain. The post-save abort race is independently code-traced: an already-aborted worker cannot arm the guard or submit late after fallback.

The sanitizer nit is intentionally declined: the response is already capped at 2 MiB; decoding must finish before complete-value redaction and the final 300-character display limit, as the nested/partial-key controls prove. Dottore's test UNKNOWN was an evidence-bundle limitation; the retained regression source and actual 39-check runs cover HTTP reasons, oversized errors and upload deadlines. This does not claim that Dottore ran those tests or returned a Viable verdict.

Genuine hosted Dottore review of 9b48cc12 completed with two LOW findings, one comment nit and two proof warnings; its success status means examination completed, not a Viable verdict. Both LOWs are fixed here: a known unpaid abort best-effort persists not_submitted before rethrowing the original error, and the native Pino hook protects marked ToAPIs errors before Pino can copy a bare error message or flatten its cause into non-debug output. The standard serializer-only approach was rejected after installed-Pino proof showed that implicit msg would still leak. Independent review also reproduced a 40-wrapper leak in an initial depth-limited prototype; the arbitrary cap was removed, and the existing cycle set safely walks finite cause chains. The expanded original check now fails on that prototype and passes on the final code. The error reason remains useful in Gallery's HTTP 502 response and at debug. Repeated poll warnings use the existing rate limiter with operational metadata only; media download failure remains status-only without adding an error-body read. The abort comment now describes the full guarded boundary.

Both findings have negative proof: untouched 9b48 left a submitting receipt with no task ID and zero paid POSTs while allowing one fallback, and its warning contained provider text; a native-Pino no-hook control also fails the serialized-private-text assertion. The repaired owning suite passes 43/43, including actual shared-Pino JSON and real Gallery route controls. Full pnpm check and independent peer source/proof review pass. The final local integration candidate also passed full pnpm check, all 43 media checks plus the existing logging-failure-lines and logging-request-trail regressions; this is local combined-source proof, not hosted or staging-green proof. Fresh local CodeRabbit review of 9b48cc1213c4179046c01f54272d2628b2c87bb8 through exact final head 65c87c80d425b24f6ce983d83e91aa960814d038 completed across the three follow-up files with zero new findings. The superseded depth-limited review was stopped without a completion claim; the final review covers the corrected finite-chain implementation.

The proof warnings are answered by the retained executable source and observed runs, not by claiming Dottore executed tests. Post-submission no-replay controls remain intact. A deadline can surface without a provider task ID or the existing local receipt identifier in its message; the receipt remains durable and must be found manually. This reconciliation usability limit is disclosed, not classified as a retry/safety failure or claimed fixed. The video race hypothesis is not reproduced or asserted fixed: the adapter still wraps its actual paid video submission and existing video cancellation/no-replay controls pass.

Genuine hosted Dottore review of 65c87c80 completed with two LOWs, two nits and one WARN/one UNKNOWN; the success status means examination completed, not a Viable verdict. The two LOWs are fixed in this final follow-up: the three existing runTask wrapper sites supply their known local UUID as metadata, and non-HTTP/non-aborted polling errors retain a debug diagnostic before the terminal retry check. UI messages and retry behavior are unchanged; the shared logger and output/outer-deadline interfaces are unchanged. The diagnostic naming nit and pre-existing untyped receipt vocabulary are declined as style/typing scope, with HTTP status and metadata type already available.

Both regressions have independent before controls: untouched 65 fails the real serialized-log transport-debug assertion; after only that fix, the real Gallery uncertain-task control independently fails because its warning lacks the UUID already in the UI message and saved receipt. The final suite passes 45/45 with all previous 43 assertions retained. It verifies both uncertain/missing-ID Gallery warnings resolve to their actual saved receipts, distinct task pointers, and one paid POST with bounded 30 poll GETs, one metadata warning and available debug diagnostics for a network failure. Peer source/proof review passes. The final combined candidate with latest staging also passes full pnpm check and all 45 offline checks. Fresh local CodeRabbit review of exact 8fabd679eec6b11df662a03c04c96a7105b5943e against 65c87c80d425b24f6ce983d83e91aa960814d038 completed across both changed files with zero new findings.

The final WARN/UNKNOWN are review-bundle limits: the retained held-save test proves fallback succeeds with no paid POST and a not_submitted receipt. runTask is awaited before the download-only wrapping catch, so that catch does not relabel the unpaid abort. This is observed local proof, not a claim that Dottore executed the tests. The disclosed outer-deadline/download receipt-pointer usability limit remains; no new state plumbing or public receipt API was added.

Original-code controls reproduced the blocked Gemini fallback and failed the missing-reason assertion; the initial stalled-fixture lifecycle was corrected before recording the valid control. Current-head required CI and substantive hosted Dottore review remain merge gates; companion Agents staging publication has been verified. Hosted container checks supply container proof. No live task, billing settlement or physical-device proof is claimed.

Docs and release impact

  • No docs changes needed
  • Translated docs updated, or a follow-up issue opened if needed
  • Version/release files updated, if needed

Setup is documented above. For video, save 4 seconds, 480p and 16:9 in the existing connection Video Generation Defaults before using Test Video or Gallery. No user-guide, release metadata or changelog changes.


🔄 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/7941 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/7922-toapis-media` --- ### 📝 Commits (10+) - [`8f12e3e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8f12e3e2e64715025fa21a6ac21b37ba67206c8f) chore: start ToAPIs media compatibility work - [`e0b96f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e0b96f9c51baab904df1bdab88c3f3c8d05fbe8f) feat: support ToAPIs through existing media connections - [`d47b478`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d47b4780bef6ec6fe4ee5f71c01b604c69195830) fix: honor ToAPIs paid-task boundaries and verified video preset - [`3dcbf73`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3dcbf735db363176392c012e6a1bf82826afa7e4) test: name inferred custom connection deadline proof precisely - [`bc6f88d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc6f88da70063afc654d16a8f26b20248f12b939) fix: honor configured response limits for ToAPIs output - [`2b83395`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2b8339566ad218802e4a4b700d4e2a97e6aae83c) Merge branch 'staging' into codex/7922-toapis-media - [`d6921e3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d6921e3b2e1795d2fa99598d8255571865b5fd70) fix: scope ToAPIs deadlines and sanitize rejection details - [`59f0aa6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/59f0aa6b41ad029397db66d71c2ba6d7ab63cfb2) fix: redact decoded ToAPIs errors before display truncation - [`f5d14b4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f5d14b460d61c7f6507ac141ac545c52c31759e6) fix: redact normalized ToAPIs credentials in errors - [`686039b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/686039b327e205973ef11c4b8d47ba28d68950c5) fix: arm ToAPIs deadline guard at task submission ### 📊 Changes **5 files changed** (+1300 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/lib/logger.ts` (+34 -0) 📝 `packages/server/src/services/image/image-generation.ts` (+27 -4) ➕ `packages/server/src/services/media/toapis-media.ts` (+397 -0) 📝 `packages/server/src/services/video/video-generation.ts` (+3 -0) ➕ `scripts/regressions/toapis-media.regression.ts` (+839 -0) </details> ### 📄 Description ## Linked issue Closes #7922 ## Why this change ToAPIs text already works through Custom (OAI-Compatible), but changing the media base URL alone fails: its image API returns an asynchronous task, and its video API uses a different request and polling contract. This adds the compatibility requested by @SpicyMarinara without another branded provider or service choice. ## What changed - Reuse **Image Generation → OpenAI (DALL-E)** and **Video Generation → Seedance 2.0** with `https://toapis.com/v1` or `https://toapis.cn/v1`, the user's API key, and a manually entered model ID. Provider and service catalogs are unchanged; text remains on Custom (OAI-Compatible). - Map asynchronous submission, reference-image upload, status polling and output retrieval for ordinary `gpt-image-2` and `seedance-2-mini`. Image scope is one 1k image, Auto quality, at most one reference, and the common 1:1, 16:9, 9:16, 3:2 and 2:3 ratios. Video scope is text or one first frame, exactly 4 seconds, 480p, 16:9 and audio off. Unsupported settings fail before buying a task. - Restrict the adapter to the exact HTTPS ToAPIs origins. Validate uploads and media bytes, honor existing image/video response-byte ceilings, bound API responses, propagate cancellation, and download output without forwarding API credentials. API redirects cannot replay a paid POST. A narrow symbol opt-in on ToAPIs errors protects standard Error, `err`/`error` and formatted-Error log calls at info and above, including cause wrappers and Gallery; unmarked errors retain the existing Pino behavior. The useful HTTP reason remains on the thrown/UI error and one capped, sanitized debug diagnostic. Non-HTTP polling transport faults retain their original diagnostic at debug, with cancellation excluded. Known local receipt UUIDs remain in marked wrapper metadata without reintroducing provider text above debug. This covers standard logging arguments and cycle-safe finite cause chains, not arbitrary nested containers or provider text already interpolated into a raw string. Definite submission rejections retain their HTTP status and a capped, sanitized reason with keys, current task IDs and URLs redacted; transient polling GET errors have bounded retries. - Preserve private task receipts without keys or prompts. Once a paid task might exist, failures and local deadlines cannot buy an automatic replacement through Engine fallback. The guard starts at the generation submission boundary. A reference-upload deadline can still use the configured fallback before any generation POST; an abort while saving its initial receipt records `not_submitted` and permits the same unpaid fallback, and ordinary Gemini chat-image fallback on the same base URL is preserved. They also expose a stable `retryable: false` contract for package retry loops; the related [Marinara-Agents safety follow-up](https://github.com/Pasta-Devs/Marinara-Agents/pull/1530) covers Noodle 1.5.9 and Slurp 0.3.53, including delayed automatic post/artwork retries. This companion PR has merged and published to Marinara-Agents staging as Noodle 1.5.9 and Slurp 0.3.53; installed consumers must update before using ToAPIs automation. Publication verification matched all 14 raw files, every ZIP payload and all three catalog lanes to the reviewed source, without claiming a main release or upgrades of existing installations. Pre-submission validation/rejection can still use an existing fallback. Receipts support manual reconciliation, without adding a resume UI. The adapter and integration proof were adapted from the linked AGPL-3.0 community reference and independently reviewed and validated. Existing OpenAI and Seedance contracts retain their original paths. ## Validation Human checklist, intentionally unchecked: - [ ] `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 - [ ] Read and followed `CONTRIBUTING.md` Completed local evidence: - `pnpm install` and `pnpm check`: passed. The existing `HomeProfessorMariChat.tsx` hook dependency warning remains. - `node scripts/run-regressions.mjs --filter scripts/regressions/toapis-media.regression.ts`: 45 integration checks passed, including real connection save/masking, Test Image/Test Video, Gallery image/file and first-frame video routes. Only provider HTTP/DNS is mocked. Negative controls cover legacy services, invalid inputs, private output URLs, cancellation, deadline races, transient/permanent polling failure, receipt permissions, configured image/video download ceilings, nonretryable markers including explicit OpenAI and inferred custom-connection deadline paths, and no paid POST replay or fallback. New controls cover reference-upload deadline fallback with no task/receipt, Gemini chat-image deadline fallback, HTTP reasons, HTML stripping, escaped, nested JSON and whitespace-normalized credentials, partial-key truncation and encoded task-ID redaction, unknown JSON metadata omission, and oversized error-body rejection. The stalled transport control also verifies the real deadline abort reason and that its emergency guard never fired. Four additional checks retain all prior 39 cases while covering the held receipt-save deadline, actual shared-Pino JSON serialization for marked direct/wrapped/field/formatted/child errors and unmarked cause/cycle controls and 40 ordinary wrappers around a marked error, rate-limited polling and both media fallback warnings, and the real Gallery rejection route with its useful UI reason preserved. - Neighboring image-edit-reference, image-result-url-security and image-generation-timeout regressions passed. - `pnpm smoke:ui`: 7/7 desktop Chromium checks passed. - Native Gallery image → Animate → Review Video Prompt → Generate → persisted Gallery video → playback passed on desktop Chromium, mobile Chromium and mobile WebKit, with no page errors (3/3). This used actual app routes, mocked external provider HTTP, a mocked prompt-preview response, an installed-Illustrator catalog fixture for the existing Gallery control, and the community's already-public MP4 as the output fixture. The updated proof configures the exact 4s/480p/16:9 preset and asserts it at the mocked provider boundary. It proves routing, saving and browser playback; it is not a fresh paid ToAPIs generation or live Illustrator package installation/execution. Temporary browser harness and screenshots remain outside the application diff; retained backend regression covers the contract. - Local CodeRabbit found three valid issues initially; all were fixed. Its substantive review of the initial implementation covered all four changed files and completed with zero findings. Hosted review then identified the defensive default-compatible deadline guard, package retry contract and settings scope; the Engine fixes are included here and the package fix is merged and published to Agents staging in the companion PR. An independent review also identified a download-cap bypass; the adapter now receives the existing image/video limits from its callers. Independent before/after proof through the real image/video entry points confirms configured 16-byte ceilings reject the same 70-byte PNG and 24-byte MP4, retain `retryable: false`, and submit only one task each. After the shared included-review quota reset, a fresh local CodeRabbit review of implementation head `bc6f88da70063afc654d16a8f26b20248f12b939` completed across all four changed files with zero new findings. No billing changes were made. The storage-format suggestion was traced and rejected: optional task-receipt sidecars do not change the canonical `storage/manifest.json` or table layout. ### Manual verification notes - [ ] Manually configure a real ToAPIs image and video connection, then generate an image, edit with one reference, and animate a first frame using live credits. - [ ] Manually verify interrupted-task reconciliation from the private receipts before retrying a paid task. No fresh live API task, billing settlement or physical-device behavior is claimed. The earlier full hosted CodeRabbit review covered implementation `bc6f88da70063afc654d16a8f26b20248f12b939`; source identity was preserved by GitHub update-branch head `2b8339566ad218802e4a4b700d4e2a97e6aae83c`. A genuine Dottore examination of `2b833956` then found two valid issues: URL-only deadline classification and missing HTTP rejection details. The current follow-up fixes both with the focused before/after proof above. Receipts remain intentionally durable for manual reconciliation: automatic pruning could discard the identity of an uncertain paid task. Splitting the small upload/task response type is a readability suggestion, with existing runtime validation retained; neither suggestion changes this compatibility fix. Current follow-up head: `8fabd679eec6b11df662a03c04c96a7105b5943e`. Full `pnpm check`, all 45 offline integration checks, formatting/diff checks and independent source/security audits pass. The independent combined staging candidate also passed all 39 checks, full `pnpm check` and URL-security regression; this is local integration proof, not a claim that pending hosted checks have passed. Local review found a deadline-proof weakness and a nested-JSON privacy edge; both are fixed. Its later claim that the padded-key control bypassed ToAPIs was rejected: `generateOpenAI` dispatches this exact origin directly to the adapter, native `Headers` normalizes the trailing space, and both the real-entry regression and direct-adapter negative control observe that behavior. The final redactor compares the stored and normalized key. The final local CodeRabbit review of `59f0aa6b41ad029397db66d71c2ba6d7ab63cfb2` through `686039b327e205973ef11c4b8d47ba28d68950c5` covered all three follow-up files and completed with zero new findings. The only subsequent change moves the byte-identical OpenAI/default dispatch block to the switch end, preserving the existing static backend-coverage regression; source identity was proved and the unchanged reference, timeout and 39-check regressions, full `pnpm check`, format and diff checks passed after the move. This does not claim that local review covered the later relocation commit. Genuine hosted Dottore review of `59f0aa6b` returned one LOW finding: a deadline during reference upload was marked nonretryable before generation submission. The final private callback arms the deadline guard only after the initial receipt save and an abort check, immediately before the generation API call. The new upload control reproduces the old failure and now proves one ordinary fallback, zero ToAPIs generation POSTs and no new receipt; existing explicit/default post-submission and Gemini controls remain. The post-save abort race is independently code-traced: an already-aborted worker cannot arm the guard or submit late after fallback. The sanitizer nit is intentionally declined: the response is already capped at 2 MiB; decoding must finish before complete-value redaction and the final 300-character display limit, as the nested/partial-key controls prove. Dottore's test UNKNOWN was an evidence-bundle limitation; the retained regression source and actual 39-check runs cover HTTP reasons, oversized errors and upload deadlines. This does not claim that Dottore ran those tests or returned a Viable verdict. Genuine hosted Dottore review of `9b48cc12` completed with two LOW findings, one comment nit and two proof warnings; its success status means examination completed, not a Viable verdict. Both LOWs are fixed here: a known unpaid abort best-effort persists `not_submitted` before rethrowing the original error, and the native Pino hook protects marked ToAPIs errors before Pino can copy a bare error message or flatten its cause into non-debug output. The standard serializer-only approach was rejected after installed-Pino proof showed that implicit `msg` would still leak. Independent review also reproduced a 40-wrapper leak in an initial depth-limited prototype; the arbitrary cap was removed, and the existing cycle set safely walks finite cause chains. The expanded original check now fails on that prototype and passes on the final code. The error reason remains useful in Gallery's HTTP 502 response and at debug. Repeated poll warnings use the existing rate limiter with operational metadata only; media download failure remains status-only without adding an error-body read. The abort comment now describes the full guarded boundary. Both findings have negative proof: untouched `9b48` left a `submitting` receipt with no task ID and zero paid POSTs while allowing one fallback, and its warning contained provider text; a native-Pino no-hook control also fails the serialized-private-text assertion. The repaired owning suite passes 43/43, including actual shared-Pino JSON and real Gallery route controls. Full `pnpm check` and independent peer source/proof review pass. The final local integration candidate also passed full `pnpm check`, all 43 media checks plus the existing logging-failure-lines and logging-request-trail regressions; this is local combined-source proof, not hosted or staging-green proof. Fresh local CodeRabbit review of `9b48cc1213c4179046c01f54272d2628b2c87bb8` through exact final head `65c87c80d425b24f6ce983d83e91aa960814d038` completed across the three follow-up files with zero new findings. The superseded depth-limited review was stopped without a completion claim; the final review covers the corrected finite-chain implementation. The proof warnings are answered by the retained executable source and observed runs, not by claiming Dottore executed tests. Post-submission no-replay controls remain intact. A deadline can surface without a provider task ID or the existing local receipt identifier in its message; the receipt remains durable and must be found manually. This reconciliation usability limit is disclosed, not classified as a retry/safety failure or claimed fixed. The video race hypothesis is not reproduced or asserted fixed: the adapter still wraps its actual paid video submission and existing video cancellation/no-replay controls pass. Genuine hosted Dottore review of `65c87c80` completed with two LOWs, two nits and one WARN/one UNKNOWN; the success status means examination completed, not a Viable verdict. The two LOWs are fixed in this final follow-up: the three existing `runTask` wrapper sites supply their known local UUID as metadata, and non-HTTP/non-aborted polling errors retain a debug diagnostic before the terminal retry check. UI messages and retry behavior are unchanged; the shared logger and output/outer-deadline interfaces are unchanged. The diagnostic naming nit and pre-existing untyped receipt vocabulary are declined as style/typing scope, with HTTP status and metadata type already available. Both regressions have independent before controls: untouched `65` fails the real serialized-log transport-debug assertion; after only that fix, the real Gallery uncertain-task control independently fails because its warning lacks the UUID already in the UI message and saved receipt. The final suite passes 45/45 with all previous 43 assertions retained. It verifies both uncertain/missing-ID Gallery warnings resolve to their actual saved receipts, distinct task pointers, and one paid POST with bounded 30 poll GETs, one metadata warning and available debug diagnostics for a network failure. Peer source/proof review passes. The final combined candidate with latest staging also passes full `pnpm check` and all 45 offline checks. Fresh local CodeRabbit review of exact `8fabd679eec6b11df662a03c04c96a7105b5943e` against `65c87c80d425b24f6ce983d83e91aa960814d038` completed across both changed files with zero new findings. The final WARN/UNKNOWN are review-bundle limits: the retained held-save test proves fallback succeeds with no paid POST and a `not_submitted` receipt. `runTask` is awaited before the download-only wrapping catch, so that catch does not relabel the unpaid abort. This is observed local proof, not a claim that Dottore executed the tests. The disclosed outer-deadline/download receipt-pointer usability limit remains; no new state plumbing or public receipt API was added. Original-code controls reproduced the blocked Gemini fallback and failed the missing-reason assertion; the initial stalled-fixture lifecycle was corrected before recording the valid control. Current-head required CI and substantive hosted Dottore review remain merge gates; companion Agents staging publication has been verified. Hosted container checks supply container proof. No live task, billing settlement or physical-device proof is claimed. ## Docs and release impact - [ ] No docs changes needed - [ ] Translated docs updated, or a follow-up issue opened if needed - [ ] Version/release files updated, if needed Setup is documented above. For video, save 4 seconds, 480p and 16:9 in the existing connection Video Generation Defaults before using Test Video or Gallery. No user-guide, release metadata or changelog changes. --- <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:40 +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#8016
No description provided.