Skip to content

Prevent redundant LLM queries in success detection #14

Open
divyashreepathihalli wants to merge 1 commit into
google-deepmind:mainfrom
divyashreepathihalli:main
Open

Prevent redundant LLM queries in success detection #14
divyashreepathihalli wants to merge 1 commit into
google-deepmind:mainfrom
divyashreepathihalli:main

Conversation

@divyashreepathihalli
Copy link
Copy Markdown

Fixed Redundant Success Detection API Calls success_detection.py

Previously, the success detection loop checked for success every sd_async_sd_interval_s by spawning an asynchronous query task. If the LLM query took longer than the spawn interval and no new images arrived from the robot, subsequent loops would fire additional identical API calls against the exact same camera timestamps, burning tokens, risking rate limits, and wasting compute.
This PR added an internal tracker (self._last_queried_image_timestamp). The background task now verifies that current_images_timestamp is strictly newer than the last queried state before dispatching the request to the Gemini LLM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant