[GH-ISSUE #935] [Feature]: Provider Fallback Decoupling & Viability Floors #490

Closed
opened 2026-10-20 17:28:01 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Sep 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/935

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Long-Term Memory extraction currently couples provider compatibility fallbacks and can invoke providers with fitted output budgets that are too small to produce an operational response. Structured provider errors and transient transport failures also need distinct handling so fallback and retry behavior remains bounded and abortable.

Proposed package or change

Update the long-term-memory server extraction path in packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/:

  • Track response-format and reasoning compatibility fallbacks independently. When reasoning is rejected, omit or change the reasoning effort instead of retrying the rejected setting.
  • Enforce a calculated minimum viable fitted output allocation during preflight. Fail before the host model call when the provider-capped or reduced budget cannot produce an operational response, and report requested, capped, and reduced values in diagnostics.
  • Classify structured provider errors using their codes, parameters, and HTTP status before string fallbacks. Keep permanent configuration/quota failures out of retry loops, coordinate transient transport retry ownership with the host runtime, and stop backoff immediately on abort.

This issue covers code and synthetic regression fixtures only. Prompt changes, private incident data, live-vault changes, generated bundles, catalog entries, archives, hashes, and package version changes are out of scope.

Why should this be optional?

This is package-owned Long-Term Memory behavior and belongs in the downloadable package rather than the lightweight Engine core because it changes extraction fallback, viability, and retry semantics specific to the package's server implementation.

Alternatives considered

  • Keep one shared fallback flag: rejected because independent provider constraints can require sequential, bounded fallbacks.
  • Let the provider reject unusable fitted budgets: rejected because the package can fail before a model call with a clearer, actionable diagnostic.
  • Match errors only by message text: rejected because structured error metadata and HTTP status provide more stable classification.

Additional context

This is Phase 5, "Provider Fallback Decoupling & Viability Floors," from the local LTM extraction reliability implementation plan. It covers I07, I10, and I11.

Acceptance criteria:

  • A provider rejecting both schema response formats and reasoning parameters completes extraction through sequential bounded fallbacks.
  • Unusable fitted budgets fail fast with a clear diagnostic before invoking the host language model.
  • Structured provider errors trigger only the appropriate fallback or retry path; permanent configuration and quota failures are not retried.
  • Abort signals terminate backoff retry loops cleanly.
  • Existing extraction behavior remains covered by the focused Long-Term Memory regression suite.

Use entirely synthetic fixtures and preserve existing identity, evidence, scope, graph, and source-state invariants.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Sep 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/935 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Long-Term Memory extraction currently couples provider compatibility fallbacks and can invoke providers with fitted output budgets that are too small to produce an operational response. Structured provider errors and transient transport failures also need distinct handling so fallback and retry behavior remains bounded and abortable. ## Proposed package or change Update the `long-term-memory` server extraction path in `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/`: - Track response-format and reasoning compatibility fallbacks independently. When reasoning is rejected, omit or change the reasoning effort instead of retrying the rejected setting. - Enforce a calculated minimum viable fitted output allocation during preflight. Fail before the host model call when the provider-capped or reduced budget cannot produce an operational response, and report requested, capped, and reduced values in diagnostics. - Classify structured provider errors using their codes, parameters, and HTTP status before string fallbacks. Keep permanent configuration/quota failures out of retry loops, coordinate transient transport retry ownership with the host runtime, and stop backoff immediately on abort. This issue covers code and synthetic regression fixtures only. Prompt changes, private incident data, live-vault changes, generated bundles, catalog entries, archives, hashes, and package version changes are out of scope. ## Why should this be optional? This is package-owned Long-Term Memory behavior and belongs in the downloadable package rather than the lightweight Engine core because it changes extraction fallback, viability, and retry semantics specific to the package's server implementation. ## Alternatives considered - Keep one shared fallback flag: rejected because independent provider constraints can require sequential, bounded fallbacks. - Let the provider reject unusable fitted budgets: rejected because the package can fail before a model call with a clearer, actionable diagnostic. - Match errors only by message text: rejected because structured error metadata and HTTP status provide more stable classification. ## Additional context This is Phase 5, "Provider Fallback Decoupling & Viability Floors," from the local LTM extraction reliability implementation plan. It covers I07, I10, and I11. Acceptance criteria: - A provider rejecting both schema response formats and reasoning parameters completes extraction through sequential bounded fallbacks. - Unusable fitted budgets fail fast with a clear diagnostic before invoking the host language model. - Structured provider errors trigger only the appropriate fallback or retry path; permanent configuration and quota failures are not retried. - Abort signals terminate backoff retry loops cleanly. - Existing extraction behavior remains covered by the focused Long-Term Memory regression suite. Use entirely synthetic fixtures and preserve existing identity, evidence, scope, graph, and source-state invariants. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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-Agents#490
No description provided.