Skip to main content

Add a manual fallback when an AI service is unavailable

2026-11-11 16:36:34.587980+00:00
Add a manual fallback when an AI service is unavailable

An unavailable drafting model should not prevent a user from creating an ordinary task manually. Keep the editable form as a complete workflow and treat an AI suggestion as one optional source of initial text.

In a synthetic task screen, the user can enter a title and description without contacting a provider. A "Suggest draft" action temporarily loads a suggestion. If that request fails, show a concise message and leave the form usable with its existing values.

The React state-structure guide discusses avoiding contradictory state. Represent the suggestion request separately from the user-owned draft so a provider error does not erase valid form data.

An optional suggestion request preserves user edits and leaves the ordinary validated save path available.

Protect edits that happen during a request

A user may begin typing while the suggestion is still loading. When the response arrives, replacing the entire form can destroy that work. Either ask before applying the suggestion or populate only fields that remain unchanged since the request began.

For a simple policy, store a draft revision when requesting a suggestion. Apply the result automatically only if that revision still matches. Otherwise show a preview with an explicit apply action. Keep the model response separate until the user accepts it.

If record navigation resets the form, use a stable record identity and ignore late responses belonging to the previous record. React's state-preservation documentation explains component identity; request identity needs its own stale-response protection.

Exercise the unavailable path

Use a local provider stub that times out, rejects and returns malformed data. In each case, verify that the title input still accepts typing, validation still runs and the ordinary save action still works. Also check that a retry does not duplicate the task or overwrite a saved draft.

Avoid an indefinite spinner. Give the suggestion request a bounded lifetime and an accessible status message. A failure message should identify that the suggestion could not be loaded while making the next action clear.

Keep manual and assisted saves under the same server validation and authorization. An AI-generated draft does not deserve broader privileges, and a manual fallback should not bypass required fields merely because the provider is unavailable.

If the application truly requires a provider-derived result to proceed, a blank form is not an equivalent fallback. Explain the blocked step and preserve work until service returns. This article's design applies where a person can legitimately provide the same task content themselves.

The workflow is a proposed fixture, not a statement about an existing deployed screen. Test both availability and recovery paths before describing the feature as resilient to a real provider outage.