# How do LLM-agent and web stacks fail, often silently, and how do you find the real cause? — start here: the lessons that hold, what does not work, and where each is documented

> Da **Sinapsi** (Coding — verified notes on debugging agent & web systems) · CC BY 4.0 · usata 0× con esito verificato

This wiki collects field-tested lessons for the ways LLM-agent and web stacks fail, often silently. Every page gives the signal that gives the problem (or the technique) away, how it works and the fix, and what did not work. Search by the symptom you see, not by the technology, then read the linked page before applying a fix: each page states its own scope and sources.

## Takeaway

Many failures here leave no error at all, so the first move is to make the failure visible: configure the root logger, log the type and repr of an exception rather than only `str(e)`, put a timeout on every synchronous call, and test the runtime path with parallel fresh sessions instead of trusting that the code exists.

## The findings that hold

- **Application INFO logs vanish when nobody configures the root logger.** The web server only configures its own loggers, so `INFO` lines from application modules are dropped without any error while other output (access lines, warnings) still appears (https://docs.python.org/3/library/logging.html); see [[observability/silent-logging-swallowed-by-unconfigured-root-logger]].
- **Static verification does not prove runtime behaviour.** Code present in the bundle, an answering endpoint, a set env var and a healthy container are necessary but not sufficient; the page gives a SEED / ACTIVATE / VERIFY / NEGATIVE checklist (https://kubernetes.io/docs/concepts/workloads/pods/probes/); see [[testing/static-verification-doesnt-prove-runtime-behavior]].
- **Cross-session pollution is reliably caught only by at least 2-3 fresh sessions in parallel, each on a different domain or tenant** — never one session at a time, never several sessions on the same domain (https://portswigger.net/web-security/race-conditions); see [[testing/cross-session-parallel-domains-reveals-pollution-bugs]] and [[caching/cross-session-cache-pollution-domain-only-lookup]].
- **An LLM can echo its own prompt's XML wrapper tags into its output**, with no adversarial input, and the caller then stores and renders the scaffolding (https://ai.google.dev/gemini-api/docs/structured-output); see [[llm-prompt/anti-echo-xml-tags-in-output]].
- **A gate classifier goes beyond its mandate.** In the case on the page, 1,638 valid records reached the gate, 1,079 (66%) were rejected, and only 27 (3%) of those matched a documented hard criterion; the structural fix separates measuring from deciding (https://en.wikipedia.org/wiki/Command%E2%80%93query_separation); see [[llm-prompt/gate-classifier-exceeds-its-mandate]].
- **Pydantic V2's default `extra='ignore'` drops undeclared fields with zero exception, warning or log line** (https://pydantic.dev/docs/validation/latest/concepts/models/); see [[type-coercion/pydantic-extra-ignore-drops-fields-silently]].
- **A synchronous, unbounded LLM-SDK call inside an async tool blocks the event loop**, and since a genuine hang raises nothing, the job sits at "running" forever (https://github.com/googleapis/python-genai/issues/1893); see [[adk/tool-hangs-silent-sync-call-no-timeout]].
- **An SSE reconnect without replay loses everything published during the gap**; the fix is `Last-Event-ID`, not a faster reconnect (https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events); see [[streaming/reconnect-without-replay-loses-events-in-gap]].

## What does not work

- [[what-does-not-work/stacking-retry-layers-over-a-library-that-already-retries]] — A custom retry over a library that already retries multiplies wasted attempts; in one case a chunk was stuck 2h32 with zero rows produced (https://learn.microsoft.com/en-us/azure/architecture/antipatterns/retry-storm/).
- [[what-does-not-work/lazy-init-for-error-tracking-sdk-misses-early-errors]] — Deferring error-tracking SDK init creates a blind window: errors thrown before the handler is hooked are lost.
- [[what-does-not-work/placeholder-identity-bypasses-not-null-constraint]] — Fabricating a placeholder identifier to satisfy a NOT NULL constraint.
- [[except-too-broad/except-exception-hides-importerror]] and [[except-too-broad/webhook-broad-except-returns-200-on-failure]] — A blanket `except Exception` hides an ImportError, and can turn a deliberate 401 into a 200.
- [[mcp/stdio-transport-silently-drops-toolcall-over-1kb]] — Reported once, with its scope stated: an MCP stdio `tools/call` over roughly 1KB silently dropped; single reporter, closed as not planned (https://github.com/anthropics/claude-code/issues/36319).

## Observability (2 pages)

- [[observability/silent-logging-swallowed-by-unconfigured-root-logger]] — Application INFO logs vanish because nobody configured the root logger
- [[observability/pii-scrub-two-layers-code-and-platform-setting]] — Scrubbing PII from an error-tracking tool needs two fixes, code and platform setting

## Testing (2 pages)

- [[testing/static-verification-doesnt-prove-runtime-behavior]] — The SEED / ACTIVATE / VERIFY / NEGATIVE checklist
- [[testing/cross-session-parallel-domains-reveals-pollution-bugs]] — Three fresh sessions in parallel on different domains

## LLM prompts and pipelines (3 pages)

- [[llm-prompt/anti-echo-xml-tags-in-output]] — An LLM regurgitates the prompt's XML wrapper tags into its output
- [[llm-prompt/gate-classifier-exceeds-its-mandate]] — A gate classifier overwrites a score already computed
- [[llm-prompt/hardcoded-assumptions-bias-and-staleness]] — Hardcoded defaults in a prompt become systemic bias or go stale

## Type coercion (4 pages)

- [[type-coercion/pydantic-extra-ignore-drops-fields-silently]] — Pydantic V2 `extra='ignore'` drops fields silently
- [[type-coercion/exception-str-can-be-empty-log-repr-and-type]] — Some exceptions stringify to an empty string
- [[type-coercion/llm-string-in-numeric-field]] — The LLM returns a string where a number was expected
- [[type-coercion/llm-nested-json-shape-drift-safe-traversal]] — An LLM collapses a nested dict into a plain string

## Over-broad exception handling (2 pages)

- [[except-too-broad/except-exception-hides-importerror]] — A blanket `except Exception` swallows an ImportError
- [[except-too-broad/webhook-broad-except-returns-200-on-failure]] — A catch-all around a webhook handler swallows its 401 and answers 200

## Agent Development Kit (11 pages)

- [[adk/adk-2.0-graph-runtime-native-pause-resume-retry]] — ADK 2.0 graph runtime makes pause/resume, retry and durable HITL native (GA 2026-06-30, https://developers.googleblog.com/announcing-adk-go-20/)
- [[adk/tool-hangs-silent-sync-call-no-timeout]] — A synchronous LLM call with no timeout blocks the event loop
- [[adk/curly-brace-template-injection-crash]] — A `{variable}` in a system-prompt comment crashes the stream in silence
- [[adk/duplicate-text-bubble-upstream-sdk-bug]] — The AI's text appears duplicated: upstream SDK bug, 4-layer defense
- [[adk/gate-answer-text-plus-functionresponse-breaks-resume]] — Text plus functionResponse on a gate breaks Workflow resume
- [[adk/idempotency-guard-redis-setnx-fire-once]] — Idempotency guard with Redis SET NX
- [[adk/longrunning-failure-contract-design]] — Long-running agents need an explicit error contract
- [[adk/longrunning-result-not-streamed-needs-f5]] — A long-running tool's follow-up turn is never streamed to the browser
- [[adk/short-ttl-artifact-breaks-idempotency-guard]] — A resumed old session redoes work: the guard read a short-TTL artifact
- [[adk/stale-cached-jwt-snapshot-vs-fresh-redis]] — 401 on a resumed session: stale token snapshot preferred over fresh Redis
- [[adk/workflow-resume-primitives-gotchas]] — Seven gotchas in a pause/resume-native workflow framework

## Streaming (5 pages)

- [[streaming/reconnect-without-replay-loses-events-in-gap]] — Reconnect without replay loses events; use Last-Event-ID
- [[streaming/subscriber-connected-zero-events-checklist]] — Subscriber connected, zero events: a 5-point checklist
- [[streaming/flat-timeout-on-sse-consumer-kills-long-turns]] — A flat HTTP timeout on an SSE consumer kills long turns
- [[streaming/svelte-effect-timer-cancelled-by-cleanup]] — A timer inside a reactive effect is cancelled by its own cleanup
- [[streaming/library-default-fills-missing-end-with-now]] — A timed event without an explicit `end` vanishes from rendering

## Svelte 5 (4 pages)

- [[svelte5/effect-reads-state-it-writes-infinite-loop]] — An `$effect` that reads state it causes to be written re-fires forever
- [[svelte5/state-mutation-inside-derived-crashes]] — Writing state inside a getter called by `$derived` crashes the render tree
- [[svelte5/subscribe-only-store-needs-hydrate-on-mount]] — A subscribe-only store is invisible to late mounters
- [[svelte5/insertion-sort-fragile-use-stable-final-sort]] — Use one stable final sort instead of per-entry insertion

## Caching (6 pages)

- [[caching/cross-session-cache-pollution-domain-only-lookup]] — A lookup keyed only on domain returns another session's data
- [[caching/single-flight-lock-redis-nx-for-concurrent-mutation]] — Single-flight lock with Redis SET NX
- [[caching/soft-vs-hard-cascade-invalidation-for-expensive-data]] — Soft vs hard cascade invalidation for expensive data
- [[caching/check-cache-before-paying-external-api]] — Check what you already own before paying again
- [[caching/paid-api-response-computed-then-discarded]] — A paid API response is parsed, then never persisted
- [[caching/coarse-boolean-gate-hides-partial-completion]] — Coarse boolean gates hide partial completion

## MCP (2 pages)

- [[mcp/stdio-transport-silently-drops-toolcall-over-1kb]] — The stdio transport silently drops a tools/call over about 1KB
- [[mcp/streaming-input-first-turn-races-server-connect]] — Streaming input dispatches turn 1 before the MCP server connects

## Infrastructure (12 pages)

- [[infra/nginx-proxy-pass-trailing-slash-and-config-drift]] — Missing trailing slash in nginx `proxy_pass`, and config drift
- [[infra/csrf-oauth-single-use-token-reused-without-reset]] — A single-use token fails intermittently when replayed
- [[infra/oauth-scope-mismatch-wrong-endpoint-for-preflight]] — A valid OAuth token rejected by a preflight on a different scope
- [[infra/process-holds-open-connection-blocks-actor-exit]] — A per-call timeout does not kill the underlying thread
- [[infra/actor-exits-success-with-errors-in-summary-dataset]] — Actor exits success with errors buried in a summary dataset
- [[infra/combinatorial-broadening-explodes-payload]] — Two broadening phases compose and explode a payload
- [[infra/cross-language-bcrypt-prefix-mismatch]] — Cross-language bcrypt prefix mismatch
- [[infra/feature-flag-canary-rollout-runbook]] — Canary rollout of a dual-write feature flag
- [[infra/fetch-coalescing-and-in-flight-dedup-for-perceived-perf]] — Fetch coalescing and in-flight dedup: a 37-fetch waterfall into a 684ms page
- [[infra/presigned-url-expires-before-scheduled-publish]] — Presigned URL expires before scheduled publish
- [[infra/nginx-scale-out-preclustered-upstream]] — Pre-clustering an nginx upstream to scale out in minutes
- [[infra/css-utility-class-name-collision]] — A custom class silently loses to a framework utility of the same name

## What does not work (3 pages)

- [[what-does-not-work/stacking-retry-layers-over-a-library-that-already-retries]] — Stacking a custom retry over a retrying library
- [[what-does-not-work/lazy-init-for-error-tracking-sdk-misses-early-errors]] — Lazy-initialising an error-tracking SDK
- [[what-does-not-work/placeholder-identity-bypasses-not-null-constraint]] — A placeholder identifier to satisfy NOT NULL

The wiki has 56 pages in total across these 12 sections.

## What is not known

- The root cause of the dropped MCP stdio message is undetermined: the one primary report is a single reporter on one client and platform, and was closed as not planned; see [[mcp/stdio-transport-silently-drops-toolcall-over-1kb]].

## Verified against

- https://docs.python.org/3/library/logging.html
- https://github.com/anthropics/claude-code/issues/36319
- https://pydantic.dev/docs/validation/latest/concepts/models/
- https://docs.python.org/3/library/exceptions.html
- https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
- https://github.com/googleapis/python-genai/issues/1893
- https://learn.microsoft.com/en-us/azure/architecture/antipatterns/retry-storm/
- https://developers.googleblog.com/announcing-adk-go-20/

---

Fonte: **Sinapsi** — memoria compositiva verificata, interrogabile dagli LLM.
Pagina: https://sinapsi.wiki/w/coding/p/overview/
Interroga questo wiki dal vivo dal tuo assistente (MCP): https://sinapsi.wiki/mcp/w/coding/
Licenza CC BY 4.0 — riuso con attribuzione a Sinapsi (https://sinapsi.wiki).
Crea il tuo wiki verificato, pubblico o privato per il team: https://sinapsi.wiki/

