Advice generation failed
This issue occurs when SotsAI could not generate a valid behavioral reasoning output.
These errors are rare, non-deterministic, and usually recoverable.
They should be treated as temporary reasoning failures, not system outages.
What this means
Section titled “What this means”SotsAI attempted to generate behavioral reasoning, but the process failed.
This can happen due to:
- internal reasoning timeouts
- upstream LLM provider issues
- malformed intermediate outputs
- unexpected internal processing errors
Common error codes include:
ADVICE_GENERATION_FAILEDADVICE_GENERATION_TIMEOUTADVICE_GENERATION_INTERNAL_ERRORADVICE_MALFORMED
Typical symptoms
Section titled “Typical symptoms”You may observe:
/v1/advicereturns a 5xx error- intermittent failures for similar requests
- success on retry without code changes
- no clear pattern related to payload size or content
These failures are not caused by invalid input.
Why this happens
Section titled “Why this happens”1) Internal reasoning timeout
Section titled “1) Internal reasoning timeout”Behavioral reasoning involves multiple internal steps.
In rare cases:
- timeouts occur
- internal safety checks trigger
- reasoning cannot be completed in time
2) Upstream LLM instability
Section titled “2) Upstream LLM instability”SotsAI relies on LLM infrastructure internally.
Failures may propagate from:
- provider outages
- degraded model performance
- transient response malformation
3) Defensive validation failure
Section titled “3) Defensive validation failure”Even if generation succeeds, SotsAI may reject its own output if:
- structure is malformed
- safety guarantees are not met
- reasoning confidence is too low
This is a feature, not a bug.
How to handle it (recommended behavior)
Section titled “How to handle it (recommended behavior)”Rule #1: Retry safely (once or twice)
Section titled “Rule #1: Retry safely (once or twice)”Unlike quota or validation errors, advice generation failures are safe to retry.
Recommended strategy:
- retry 1–2 times
- exponential backoff
- short delay (e.g. 300–800 ms)
Most failures resolve on the first retry.
Rule #2: Always have a fallback
Section titled “Rule #2: Always have a fallback”If retries fail:
- skip SotsAI for this interaction
- let your LLM handle the request autonomously
- avoid blocking the user flow
This ensures continuity.
Rule #3: Do not surface errors to users
Section titled “Rule #3: Do not surface errors to users”End users should never see:
- “Advice generation failed”
- “LLM timeout”
- “Internal error”
Instead, they should receive:
- a normal (but less personalized) response
- no mention of internal failures
Recommended orchestration pattern
Section titled “Recommended orchestration pattern”Call SotsAI↓IF success: apply behavioral reasoningELSE IF advice-generation error: retry (1–2 times, backoff) IF still failing: fallback to LLM-only response log failureELSE: handle according to error categoryThis pattern maximizes resilience.
What NOT to do
Section titled “What NOT to do”Avoid these anti-patterns:
- ❌ infinite retries
- ❌ blocking the entire feature
- ❌ exposing internal errors to users
- ❌ retrying without backoff
- ❌ assuming input is invalid
These failures are not user errors.
Occasional failures are normal.
Investigate only if you see:
- sustained failure rates
- failures across all requests
- failures correlated with specific payload patterns
- repeated failures after retries
In those cases:
- check provider status
- review recent deployment changes
- contact SotsAI support