From c6cb883cd1dc787943e56587273b95e83a3bfcdf Mon Sep 17 00:00:00 2001 From: Twirre Meulenbelt <43213592+TwirreM@users.noreply.github.com> Date: Mon, 9 Feb 2026 17:06:35 +0100 Subject: [PATCH] fix: configurable ping endpoint frequency and better goal completion detection --- .env.example | 3 +++ .../agents/bdi/text_belief_extractor_agent.py | 5 ++--- src/control_backend/api/v1/endpoints/robot.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index a4ae63f..e4d7338 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,9 @@ # The hostname of the Robot Interface. Change if the Control Backend and Robot Interface are running on different computers. RI_HOST="localhost" +# The hostname of the User Interface. This is what the browser displays in the URL bar. Strangely, even if the UI is running on a different host than the backend, if the computer with the browser is also hosting the UI itself, this value should be http://localhost. +UI_HOST="http://localhost:5173" + # URL for the local LLM API. Must be an API that implements the OpenAI Chat Completions API, but most do. LLM_SETTINGS__LOCAL_LLM_URL="http://localhost:1234/v1/chat/completions" diff --git a/src/control_backend/agents/bdi/text_belief_extractor_agent.py b/src/control_backend/agents/bdi/text_belief_extractor_agent.py index f9c1883..649e200 100644 --- a/src/control_backend/agents/bdi/text_belief_extractor_agent.py +++ b/src/control_backend/agents/bdi/text_belief_extractor_agent.py @@ -538,10 +538,9 @@ class GoalAchievementInferrer(SemanticBeliefInferrer): async def _infer_goal(self, conversation: ChatHistory, goal: BaseGoal) -> bool: prompt = f"""{self._format_conversation(conversation)} -Given the above conversation, what has the following goal been achieved? +Given the above conversation, has the following goal been achieved? -The name of the goal: {goal.name} -Description of the goal: {goal.description} +Description of the goal: {goal.description or goal.name} Answer with literally only `true` or `false` (without backticks).""" diff --git a/src/control_backend/api/v1/endpoints/robot.py b/src/control_backend/api/v1/endpoints/robot.py index afe92f5..2ca8986 100644 --- a/src/control_backend/api/v1/endpoints/robot.py +++ b/src/control_backend/api/v1/endpoints/robot.py @@ -123,7 +123,7 @@ async def ping_stream(request: Request): sub_socket.setsockopt(zmq.SUBSCRIBE, b"ping") connected = False - ping_frequency = 2 + ping_frequency = settings.behaviour_settings.sleep_s + 1 # Even though its most likely the updates should alternate # (So, True - False - True - False for connectivity),