feat: made program reset LLM #39

Merged
8464960 merged 4 commits from feat/program-reset-llm into dev 2026-01-02 15:13:07 +00:00
8464960 commented 2025-12-16 09:10:15 +00:00 (Migrated from git.science.uu.nl)

Implemented the feature where the LLM history is cleared whenever the program is run (meaning a program is sent via the UI).

For testing, after you pulled this branch, in src/control_backend/agents/llm_agent.py
temporarily replace the elif statement at line 55 with this one:

elif msg.sender == settings.agent_settings.bdi_program_manager_name:
if msg.body == "clear_history":
self.logger.debug("Clearing conversation history as requested by Program Manager.")
self.logger.debug(self.history)
self.history.clear()
self.logger.debug(self.history)

Manual testing (best if you have some (L)LM available:

  • Start this cb
  • Start ri and UI (dev)
  • Talk with the (L)LM to create some history
  • in the UI, go to editor and press "run program"
  • observe the logs (either in UI or in terminal of cb)
  • If your (L)LM has some history acquired you should see the history logged and then after an empty list
    - if you don't have a (L)LM running, both lists will be empty

Further verifications:

  • Style checks pass
  • Pipeline (tests) pass
  • Documentation is up to date
  • Tests are up to date (new code is covered)
    - bdi_program_manager is only 88% covered, but this was 86% before (wrote tests only for the newly added code)
Implemented the feature where the LLM history is cleared whenever the program is run (meaning a program is sent via the UI). For testing, after you pulled this branch, in src/control_backend/agents/llm_agent.py temporarily replace the elif statement at line 55 with this one: elif msg.sender == settings.agent_settings.bdi_program_manager_name: if msg.body == "clear_history": self.logger.debug("Clearing conversation history as requested by Program Manager.") self.logger.debug(self.history) self.history.clear() self.logger.debug(self.history) Manual testing (best if you have some (L)LM available: - [x] Start this cb - [x] Start ri and UI (dev) - [x] Talk with the (L)LM to create some history - [x] in the UI, go to editor and press "run program" - [x] observe the logs (either in UI or in terminal of cb) - [x] If your (L)LM has some history acquired you should see the history logged and then after an empty list - if you don't have a (L)LM running, both lists will be empty Further verifications: - [x] Style checks pass - [x] Pipeline (tests) pass - [x] Documentation is up to date - [x] Tests are up to date (new code is covered) - bdi_program_manager is only 88% covered, but this was 86% before (wrote tests only for the newly added code)
8464960 commented 2025-12-16 09:11:36 +00:00 (Migrated from git.science.uu.nl)

assigned to @8464960

assigned to @8464960
s.o.h.luijkx commented 2025-12-22 14:11:22 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Start this cb as completed

marked the checklist item **Start this cb** as completed
s.o.h.luijkx commented 2025-12-22 14:11:23 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Start ri and UI (dev) as completed

marked the checklist item **Start ri and UI (dev)** as completed
s.o.h.luijkx commented 2025-12-22 14:11:25 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Talk with the (L)LM to create some history as completed

marked the checklist item **Talk with the (L)LM to create some history** as completed
s.o.h.luijkx commented 2025-12-22 14:11:27 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item in the UI, go to editor and press "run program" as completed

marked the checklist item **in the UI, go to editor and press "run program"** as completed
s.o.h.luijkx commented 2025-12-22 14:11:28 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item observe the logs (either in UI or in terminal of cb) as completed

marked the checklist item **observe the logs (either in UI or in terminal of cb)** as completed
s.o.h.luijkx commented 2025-12-22 14:11:31 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item If your (L)LM has some history acquired you should see the history logged and then after an empty list as completed

marked the checklist item **If your (L)LM has some history acquired you should see the history logged and then after an empty list** as completed
s.o.h.luijkx commented 2025-12-22 14:12:42 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Style checks pass as completed

marked the checklist item **Style checks pass** as completed
s.o.h.luijkx commented 2025-12-22 14:12:42 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Pipeline (tests) pass as completed

marked the checklist item **Pipeline (tests) pass** as completed
s.o.h.luijkx commented 2025-12-22 14:12:43 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Documentation is up to date as completed

marked the checklist item **Documentation is up to date** as completed
s.o.h.luijkx commented 2025-12-22 14:13:17 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Tests are up to date (new code is covered) as completed

marked the checklist item **Tests are up to date (new code is covered)** as completed
s.o.h.luijkx commented 2025-12-22 14:19:28 +00:00 (Migrated from git.science.uu.nl)

This description is a bit ambiguous. Now it sounds like it sends an empty string or empty list to replace the current history. I would recommend something like "Sends a message to the LLM Agent instructing it to clear its history."

This description is a bit ambiguous. Now it sounds like it sends an empty string or empty list to replace the current history. I would recommend something like "Sends a message to the LLM Agent instructing it to clear its history."
s.o.h.luijkx commented 2025-12-22 14:19:28 +00:00 (Migrated from git.science.uu.nl)

approved this merge request

approved this merge request
2584433 commented 2025-12-29 14:00:22 +00:00 (Migrated from git.science.uu.nl)

requested review from @s.o.h.luijkx

requested review from @s.o.h.luijkx
2584433 commented 2025-12-29 14:46:51 +00:00 (Migrated from git.science.uu.nl)

approved this merge request

approved this merge request
8464960 commented 2026-01-02 15:10:02 +00:00 (Migrated from git.science.uu.nl)

Good catch, should be good now!

Good catch, should be good now!
8464960 commented 2026-01-02 15:10:03 +00:00 (Migrated from git.science.uu.nl)

resolved all threads

resolved all threads
8464960 (Migrated from git.science.uu.nl) merged commit 4c20656c75 into dev 2026-01-02 15:13:08 +00:00
8464960 commented 2026-01-02 15:15:59 +00:00 (Migrated from git.science.uu.nl)

mentioned in commit 4c20656c75

mentioned in commit 4c20656c75ba23f95d7989d32c567ac8aeef1fcf
s.o.h.luijkx (Migrated from git.science.uu.nl) approved these changes 2026-02-02 13:29:05 +00:00
2584433 (Migrated from git.science.uu.nl) approved these changes 2026-02-02 13:29:05 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pepperplus/pepperplus-cb#39