Testing Non-Deterministic LLM Agent Pipelines with Property-Based Assertions

Repulsive_Sugar_5252 · reddit · 2026-09-18

The author builds hospilot, where an LLM dynamically decides which agents form a pipeline and in what order based on the goal text — the core feature that makes it useful for tasks no one predefined.

The problem: near-identical prompts return a different agent graph on each run. Both are usually valid, just different — fine when a human is watching, but it breaks traditional testing's determinism assumption (same input, same output) when you want to assert 'given this goal, the pipeline should look like X.'

Current workaround: property-based assertions instead of exact-match — does the graph include the agents required for this goal type, respect the constraints passed in, and avoid out-of-scope stuff? Weaker than exact matching, but it tests something real rather than 'did the output match last Tuesday.'

The author asks if anyone has found something better: testing LLM decisions that are allowed to vary but not allowed to be wrong feels like its own discipline, and most conventional testing advice doesn't map onto it.

Original post →

More from coding & agent

coding & agent channel →