INNER CODE UNIT · Python
enforce_completion
concierge-hq/concierge · __init__.py:190
def enforce_completion(self) -> bool:
"""If True, instruct LLM that it must continue until reaching a terminal stage."""
return self._enforce_completion
@enforce_completion.setter
def enforce_completion(self, value: bool):
self._enforce_completion = value
def _is_terminal_stage(self, stage: str) -> bool:
"""A stage is terminal if it has no outgoing transitions."""
return not self._transitions.get(stage, [])
def _get_session_stage(self, session_id: Optional[str]) -> str:
"""Get current stage for a session. Returns default stage for new/unknown sessions."""
if session_id:
stage = self._state.get_session_stage(session_id)
if stage:
return stage