Skip to content
mentoor

Topic 2 of 4 · 4 min read

Showing partial and uncertain results

Goal: Choose what the interface shows while a response is in progress or incomplete, and when to hold back an unfinished answer.

Decide for each kind of output whether a partial version is safe to show, label it as in progress while it is, and hold back anything that would mislead or trigger an action before it is complete. Streaming makes every answer visible early, but not every answer is useful, or safe, early.

Check yourself · 1 of 3

An assistant streams a JSON object that your code parses to fill a form. When should the form fields update?

Choose one answer

Why it matters

Prose is forgiving: half a paragraph still reads as half a paragraph. Other output is not. A half-finished JSON object cannot be parsed. A table with three of seven rows looks like a complete table. A yes or no verdict can flip in the final sentence ("This is safe to deploy... unless the migration runs first"). Showing these early can make people act on something that is not the answer yet.

How to do it

  1. Classify the output. Free text can stream. Structured data, totals, verdicts, citations and anything feeding a button usually should not appear until it is complete and validated.
  2. Show the phase, not just a spinner. Name what is happening: "Searching your documents", "Reading 4 files", "Writing the answer". Each phase has its own state so a long tool call does not look like a hang. Response-time research (see the Nielsen Norman Group reference) says users need some feedback past one second and a real progress cue by ten.
  3. Mark partial content as partial. A blinking cursor, a "Writing..." label or a muted style tells the reader the text may still change. Remove the marker when the stream ends.
  4. Disable actions until done. Copy, Apply, Send and Run stay inactive on a partial answer. Enabling them early invites a copy of half a command.
  5. Skeletons for structure. If you know a result will be a table of seven rows, render the frame with placeholders instead of letting it grow and push content down.
  6. Handle an answer that ends early. If the stream stops without a finish signal, show the partial text with a clear "response was cut off" note and a retry. Never present it as complete.

Before and after

Weak: a code assistant streams a shell command into a box with a live Run button. The user clicks Run after two lines and executes a truncated rm -rf ./build that was meant to end with /cache.

Better: the command streams into the box but the Run button stays disabled, labelled "Waiting for the full command", and enables only after the finish signal and a check that the text is complete. The same tokens, a safer interface.

What goes wrong

  • A spinner for thirty seconds with no phase. Users cancel, retry and double the cost.
  • Partial structured output rendered as final. A chart or total that updates as numbers arrive looks authoritative at every step.
  • Hiding everything until the end. For long prose this throws away the main benefit of streaming. Hold back only what cannot be read early.
  • No marker on a truncated answer. The reader assumes the model chose to stop there.

Examples

Phases for a document question

A user asks a question about a 40-page contract. The status line moves through: "Finding relevant sections", then "Reading 3 sections", then "Writing the answer". The answer text streams under the last status. If the search step takes eight seconds, the user still sees that the work is progressing, and the status makes clear that nothing has been written yet.

Holding back a verdict

A review assistant streams: "Approved. The change is safe..." and then, a sentence later, "...provided the index is created first." The interface keeps the status badge neutral ("Reviewing") while the text streams, and shows Approved or Needs changes only after the final message and a parsed result field. The reader never sees a green badge that the last sentence contradicts.

Key points

  • Free-form prose can stream, but structured data, verdicts and anything that drives an action should appear only when complete.
  • Name the current phase of work instead of showing an anonymous spinner during long steps.
  • Mark in-progress text as in progress and remove the marker when the finish signal arrives.
  • Keep Copy, Apply and Run disabled until the response is complete and passes validation.
  • Show a stream that ended without a finish signal as cut off, with a retry, never as a finished answer.

Common mistakes

  • Using one generic loading spinner for every phase, including multi-step tool use that takes many seconds.
  • Enabling Copy or Run buttons on text that is still arriving.
  • Rendering a partial table, total or chart as if it were final.
  • Treating a dropped connection as a normal end of answer.

Check yourself · 2 of 3

A request that searches files then writes an answer takes about 25 seconds. Which status design serves the user best?

Choose one answer

Check yourself · 3 of 3

A stream dropped midway. The interface shows the first two thirds of the answer with no other change. What is the main problem?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic