[PR #1434] [MERGED] Fix remote provider stream error copy #5084

Closed
opened 2026-10-22 04:13:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1434
Author: @cha1latte
Created: 5/27/2026
Status: ✅ Merged
Merged: 5/27/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1428-provider-error-copy


📝 Commits (2)

  • 6cc9355 Fix remote provider stream error copy
  • 9438e65 Merge remote-tracking branch 'upstream/refactor' into fix/issue-1428-provider-error-copy

📊 Changes

2 files changed (+94 additions, -2 deletions)

View changed files

📝 src/shared/api/remote-runtime.test.ts (+63 -1)
📝 src/shared/api/remote-runtime.ts (+31 -1)

📄 Description

Linked issue

Closes #1428

Why this change

  • Remote runtime provider failures could still lose the provider's error copy during streamed generation. The hostable runtime emits SSE error events with a message field, but the browser remote-stream adapter only read text or data, so Conversation recovery copy could show [object Object] instead of the actionable provider message.

What changed

  • Preserve remote stream error message, code, and provider status when /api/llm/stream emits type: "error".
  • Throw an ApiError for remote stream failures so 500/429 provider details survive into the existing Conversation failure notice/toast path.
  • Added regression coverage for 500, 429, legacy text, legacy string data, and existing remote cancellation behavior.

Refactor impact

Primary owner:

shared API / remote runtime

Impact areas reviewed:

  • src/shared/api/remote-runtime.ts
  • src/features/runtime/generation/hooks/use-generate.ts
  • src-tauri/src/http_server.rs

Boundary notes:

  • Product copy remains in the existing runtime generation failure-notice path.
  • The shared API adapter now preserves hostable runtime SSE error fields without importing feature code or changing engine behavior.
  • No schema, dependency, auth, storage, prompt-pipeline, or Rust behavior changes.

Pressure points touched:

  • Remote runtime LLM streaming adapter only.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Codex reproduced the bug before the fix with pnpm exec vitest run src/shared/api/remote-runtime.test.ts: the new 500/429 rows failed because the thrown message was [object Object] instead of fake provider 500 / fake provider 429.
  • Codex verified the fix with pnpm exec vitest run src/shared/api/remote-runtime.test.ts --reporter verbose: 9 tests passed, including 500, 429, legacy text, legacy string data, and remote cancellation rows.
  • Codex ran pnpm check: passed check:architecture, check:frontend, check:rust, and check:docs.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json: passed.
  • Bunny review pass completed before opening the PR.
  • graphify update . could not run because graphify is not available on PATH in this Codex session. This does not block the core claim.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A: this is an adapter-level remote stream error propagation bug. The provider copy path is proven with the remote-runtime regression harness; no direct app UI state exists without a configured fake provider/runtime.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved remote LLM stream error handling to provide more structured and consistent error information from Server-Sent Events, with enhanced support for provider errors (HTTP 500/429) and legacy error formats to ensure reliable error recovery and reporting.

Review Change Stack


🔄 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/1434 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/27/2026 **Status:** ✅ Merged **Merged:** 5/27/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1428-provider-error-copy` --- ### 📝 Commits (2) - [`6cc9355`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6cc93557774222f6616a78972defe54360dc0710) Fix remote provider stream error copy - [`9438e65`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9438e65b3d811320439abb5ce5344bd145319947) Merge remote-tracking branch 'upstream/refactor' into fix/issue-1428-provider-error-copy ### 📊 Changes **2 files changed** (+94 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/shared/api/remote-runtime.test.ts` (+63 -1) 📝 `src/shared/api/remote-runtime.ts` (+31 -1) </details> ### 📄 Description ## Linked issue Closes #1428 ## Why this change - Remote runtime provider failures could still lose the provider's error copy during streamed generation. The hostable runtime emits SSE error events with a `message` field, but the browser remote-stream adapter only read `text` or `data`, so Conversation recovery copy could show `[object Object]` instead of the actionable provider message. ## What changed - Preserve remote stream error `message`, `code`, and provider status when `/api/llm/stream` emits `type: "error"`. - Throw an `ApiError` for remote stream failures so 500/429 provider details survive into the existing Conversation failure notice/toast path. - Added regression coverage for 500, 429, legacy `text`, legacy string `data`, and existing remote cancellation behavior. ## Refactor impact Primary owner: shared API / remote runtime Impact areas reviewed: - `src/shared/api/remote-runtime.ts` - `src/features/runtime/generation/hooks/use-generate.ts` - `src-tauri/src/http_server.rs` Boundary notes: - Product copy remains in the existing runtime generation failure-notice path. - The shared API adapter now preserves hostable runtime SSE error fields without importing feature code or changing engine behavior. - No schema, dependency, auth, storage, prompt-pipeline, or Rust behavior changes. Pressure points touched: - Remote runtime LLM streaming adapter only. ## Validation - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - Codex reproduced the bug before the fix with `pnpm exec vitest run src/shared/api/remote-runtime.test.ts`: the new 500/429 rows failed because the thrown message was `[object Object]` instead of `fake provider 500` / `fake provider 429`. - Codex verified the fix with `pnpm exec vitest run src/shared/api/remote-runtime.test.ts --reporter verbose`: 9 tests passed, including 500, 429, legacy `text`, legacy string `data`, and remote cancellation rows. - Codex ran `pnpm check`: passed `check:architecture`, `check:frontend`, `check:rust`, and `check:docs`. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json`: passed. - Bunny review pass completed before opening the PR. - `graphify update .` could not run because `graphify` is not available on PATH in this Codex session. This does not block the core claim. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A: this is an adapter-level remote stream error propagation bug. The provider copy path is proven with the remote-runtime regression harness; no direct app UI state exists without a configured fake provider/runtime. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Improved remote LLM stream error handling to provide more structured and consistent error information from Server-Sent Events, with enhanced support for provider errors (HTTP 500/429) and legacy error formats to ensure reliable error recovery and reporting. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1434?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:13:04 +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#5084
No description provided.