Problem
Conversation coaching topics should support max_turns = 0 as unlimited end to end.
Today an admin can define max_turns: 0 on a topic such as goals, and the topic detail response still shows 0, but users can still get blocked after 10 turns. That means the value is not being preserved and interpreted consistently across the full topic -> session -> execution pipeline.
Required behavior
- If an admin defines
max_turns: 0, that exact value must be stored as 0.
- When creating a session,
0 must be preserved on the session and treated as unlimited turns.
- If
max_turns is undefined / None, the default should be 0.
- Code must explicitly distinguish between:
0 meaning unlimited
- missing /
None meaning use default
End-to-end paths to verify
Check the full flow and make sure 0 is handled correctly at every step:
- Topic definition / admin update
- Topic persistence in DynamoDB
additional_config
- Topic readback in admin/detail responses
- Session creation from topic config
- Session persistence in DynamoDB (
session.max_turns)
- Turn-limit enforcement during message handling
- Workflow/conversation decision logic so unlimited does not get converted into a hidden fallback cap
Notes
- The bug pattern here is treating
0 as falsy (for example, config.get("max_turns") or 10), which collapses explicit unlimited into a fallback limit.
- The fix should use key-presence /
None checks instead of truthiness checks.
Acceptance criteria
- Topic with
max_turns: 0 results in new sessions with max_turns: 0
- Users on those sessions are not blocked at 10 turns
- Missing
max_turns defaults to 0
- Unit tests cover explicit
0, missing, and None
Problem
Conversation coaching topics should support
max_turns = 0as unlimited end to end.Today an admin can define
max_turns: 0on a topic such asgoals, and the topic detail response still shows0, but users can still get blocked after 10 turns. That means the value is not being preserved and interpreted consistently across the full topic -> session -> execution pipeline.Required behavior
max_turns: 0, that exact value must be stored as0.0must be preserved on the session and treated as unlimited turns.max_turnsis undefined / None, the default should be0.0meaning unlimitedNonemeaning use defaultEnd-to-end paths to verify
Check the full flow and make sure
0is handled correctly at every step:additional_configsession.max_turns)Notes
0as falsy (for example,config.get("max_turns") or 10), which collapses explicit unlimited into a fallback limit.Nonechecks instead of truthiness checks.Acceptance criteria
max_turns: 0results in new sessions withmax_turns: 0max_turnsdefaults to00, missing, andNone