From 3332277718a734c0bd24c78950fc080d487daa43 Mon Sep 17 00:00:00 2001 From: JenR8ed <1014672+JenR8ed@users.noreply.github.com> Date: Sat, 11 Jul 2026 10:28:42 +0000 Subject: [PATCH 1/2] Fix invalid escape sequence in listing synthesis engine Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- services/listing_synthesis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/listing_synthesis.py b/services/listing_synthesis.py index 82a593a..13c4b63 100644 --- a/services/listing_synthesis.py +++ b/services/listing_synthesis.py @@ -61,7 +61,7 @@ def create_listing_draft( # Strip markdown clean_json = response_text - json_match = re.search(r'```(?:json)?\s*(\{.*?\})\s*```', response_text, re.DOTALL) + json_match = re.search(r'```(?:json)?\s*({.*?})\s*```', response_text, re.DOTALL) if json_match: clean_json = json_match.group(1) else: From 9ce6ce0f4124d6540d8a8a5f09c08a224fb76e87 Mon Sep 17 00:00:00 2001 From: JenR8ed <1014672+JenR8ed@users.noreply.github.com> Date: Sat, 11 Jul 2026 10:36:49 +0000 Subject: [PATCH 2/2] Fix tests due to uninitialized listing_engine Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- tests/test_listing_reconstruction.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_listing_reconstruction.py b/tests/test_listing_reconstruction.py index a2cb7ff..8459873 100644 --- a/tests/test_listing_reconstruction.py +++ b/tests/test_listing_reconstruction.py @@ -101,7 +101,14 @@ def test_generate_title_empty_data(self): self.assertEqual(title, "Item") class TestListingReconstruction(unittest.TestCase): + @patch.dict(os.environ, {'GOOGLE_API_KEY': 'test_key'}) def setUp(self): + # We need to explicitly initialize listing_engine and ebay_integration for app_enhanced to not fail + import app_enhanced + from services.listing_synthesis import ListingSynthesisEngine + from services.ebay_integration import eBayIntegration + app_enhanced.listing_engine = ListingSynthesisEngine() + app_enhanced.ebay_integration = eBayIntegration(use_sandbox=True) # Setup a test database self.db_path = 'test_listings.db' if os.path.exists(self.db_path):