← All glossary terms
Glossary

Stop Predicate

GlossaryBy OpenCharts TeamPublished

A stop predicate is the rule that decides when Theo should end a multi-step generation — e.g. stop after the calendar tool runs, or after N tool calls in research mode.

In depth

Stop predicates are how OpenCharts keeps long-running modes scoped without truncating useful work. Each mode declares its own predicate: smart (default), video (stop after a video tool), calendar (stop after Phase A then resume on follow-up).

They’re defined once in src/lib/ai/stopPredicates.ts and shared across web chat, Telegram, and the Theo Desk loop so behavior stays consistent everywhere Theo runs.

Examples

  • Stop after start_calendar_code in social mode
  • Stop after the first video tool in video mode

Also known as

stopWhentermination rule

Want to put this concept to work in OpenCharts?

Read more

Related terms