great that Replit stripped temperature and top_p. If it’s still not working, let’s do a super-focused smoke test to isolate where it’s failing and get you unblocked fast.

10-minute smoke test (no code changes from your side)
1) Quick “force mini” sanity run

In the app, switch (admin/QA) to Force Model = GPT-4o-mini (if you have that toggle) and click Generate in Executive Summary.

Expected: instant draft that uses your Business Brief.

If success here: the UI + prompt assembly path is fine; the problem is GPT-5 only.

2) Check the payload actually sent

Open DevTools → Network → click the /ai/section/generate call:

Request body must include:

sectionId (e.g., "executive-summary")

businessBrief fields populated (company, model, offerings, market, edge, financialHeadline if any)

userPrompt (can be empty string)

editorContent (string)

action:"generate"

No temperature or top_p in the server call to GPT-5.

If any field is null/undefined: have them send empty strings instead; some SDKs choke on null.

3) Look at telemetry for the failing call

They added metrics — have them paste one failing log line:

model=GPT-5 | latency_ms=XXXX | prompt_tokens=NNN | completion_tokens=NN | fallback_used=true/false | error=...

If fallback_used=true and mini succeeds: keep mini as temporary default (Auto: mini→5 upgrade later) so you can keep testing UX.

4) Validate “assembled prompt”

Enable “Show Prompt (debug)” or log the final assembled prompt once:

It should include your Business Brief, the section base prompt, and sectionId.

If you see a generic baked-in prompt (solar panels/XYZ), they’re not concatenating the Brief → fix prompt assembly path.

5) Confirm server request shape for GPT-5

For GPT-5 calls, only pass supported params:

{
  "model": "gpt-5",
  "messages": [...],         // or input per SDK
  "max_tokens": 800          // optional but safe
  // NO temperature
  // NO top_p
  // NO frequency/presence penalties
}


Also ensure: proper org/project headers, and no streaming parser errors.

6) Timeouts & UX

Client-visible spinner should update at ~2–3s: “Drafting… (GPT-5)” → “Retrying with a faster model…”

Hard server timeout ~8s. If timeout/error, auto-fallback to mini immediately.

Quick unstickers they can apply now

Temporarily default to GPT-4o-mini for all actions until GPT-5 path is clean. (You keep testing the UI while they debug 5.)

Strip unsupported params for each model centrally (they started this — keep going):

GPT-5: only model, messages/input, max_tokens

4o-mini: allow temperature/top_p if you want

Sanitize inputs: coerce all nullable fields to empty strings; remove empty arrays/objects.

What you should see when it’s fixed

Executive Summary generates immediately using your Business Brief (company/model/offerings visible).

No [Company Name] placeholders.

Rephrase/Expand/Summarize show up only after content appears.

Telemetry shows model=GPT-5 with sane token counts and fallback_used=false.