From ea7fadd76b628e411cf5bf689f2c21297a7dea5d Mon Sep 17 00:00:00 2001 From: retoor Date: Sun, 9 Nov 2025 04:12:27 +0100 Subject: [PATCH] fix: deduplicate identical messages in autonomous mode feat: enable autonomous mode by default maintenance: bump version to 1.49.0 --- CHANGELOG.md | 18 ++++++++++++++++++ pyproject.toml | 2 +- rp/autonomous/mode.py | 8 ++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6d6596..3204665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog + +## Version 1.48.1 - 2025-11-09 + +### Fixed +- **Duplicate Messages**: Fixed issue where identical messages were printed multiple times at the end of autonomous execution + - Added deduplication logic in `run_autonomous_mode()` to track and skip duplicate results + - Messages are now only printed once even if multiple autonomous iterations return the same response + +**Changes:** 1 file, 7 lines +**Languages:** Python (7 lines) + +## Version 1.48.0 - 2025-11-09 + +Autonomous mode is now enabled by default, simplifying usage. Several improvements were made to background processes and thread safety, resulting in more reliable operation. + +**Changes:** 14 files, 233 lines +**Languages:** Markdown (24 lines), Python (207 lines), TOML (2 lines) + ## Version 1.47.1 - 2025-11-09 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index 41e8678..3dfbc4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rp" -version = "1.47.1" +version = "1.48.1" description = "R python edition. The ultimate autonomous AI CLI." readme = "README.md" requires-python = ">=3.10" diff --git a/rp/autonomous/mode.py b/rp/autonomous/mode.py index 2fb1761..64e01b0 100644 --- a/rp/autonomous/mode.py +++ b/rp/autonomous/mode.py @@ -27,6 +27,7 @@ def sanitize_for_json(obj): def run_autonomous_mode(assistant, task): assistant.autonomous_mode = True assistant.autonomous_iterations = 0 + last_printed_result = None logger.debug("=== AUTONOMOUS MODE START ===") logger.debug(f"Task: {task}") from rp.core.knowledge_context import inject_knowledge_context @@ -60,14 +61,17 @@ def run_autonomous_mode(assistant, task): logger.debug(f"Task completion check: {is_complete}") if is_complete: result = process_response_autonomous(assistant, response) - print(f"\n{Colors.GREEN}r:{Colors.RESET} {result}\n") + if result != last_printed_result: + print(f"\n{Colors.GREEN}r:{Colors.RESET} {result}\n") + last_printed_result = result logger.debug(f"=== AUTONOMOUS MODE COMPLETE ===") logger.debug(f"Total iterations: {assistant.autonomous_iterations}") logger.debug(f"Final message count: {len(assistant.messages)}") break result = process_response_autonomous(assistant, response) - if result: + if result and result != last_printed_result: print(f"\n{Colors.GREEN}r:{Colors.RESET} {result}\n") + last_printed_result = result time.sleep(0.5) except KeyboardInterrupt: logger.debug("Autonomous mode interrupted by user")