From ae0a43109f7d1cf4df8e8ac811ed5523b5bc2c14 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 26 Jun 2026 16:34:25 -0400 Subject: [PATCH] =?UTF-8?q?fix(ci):=20unblock=20main=20=E2=80=94=20ruff=20?= =?UTF-8?q?format=20drift=20+=20CLI=20refresh=5Fcron=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two pre-existing failures on main were blocking every open PR: - verify-generated-files: ruff-format drift in test_chunking.py and test_retain_append_mode.py (trailing whitespace + json.dumps reflow). Fixed by running lint.sh. - test-doc-examples (cli): hindsight-cli/src/commands/mental_model.rs no longer compiled after refresh_cron was added to MentalModelTriggerInput. Set refresh_cron: None in both trigger initializers (create + update). --- hindsight-api-slim/tests/test_chunking.py | 1 - .../tests/test_retain_append_mode.py | 31 +++++++++++-------- hindsight-cli/src/commands/mental_model.rs | 2 ++ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/hindsight-api-slim/tests/test_chunking.py b/hindsight-api-slim/tests/test_chunking.py index ea69a4656..e6e40f610 100644 --- a/hindsight-api-slim/tests/test_chunking.py +++ b/hindsight-api-slim/tests/test_chunking.py @@ -455,4 +455,3 @@ def test_merged_json_array_routes_to_conversation_chunking(): assert isinstance(parsed, list), f"Chunk must be a JSON array: {chunk[:60]}" assert all(isinstance(e, dict) for e in parsed), f"Every element must be a dict: {chunk[:60]}" assert all("role" in e for e in parsed), f"Every element must have a role key: {chunk[:60]}" - diff --git a/hindsight-api-slim/tests/test_retain_append_mode.py b/hindsight-api-slim/tests/test_retain_append_mode.py index d02b65b35..44060a2ee 100644 --- a/hindsight-api-slim/tests/test_retain_append_mode.py +++ b/hindsight-api-slim/tests/test_retain_append_mode.py @@ -254,10 +254,12 @@ async def test_append_mode_conversation_arrays_produce_valid_json(memory, reques try: # First retain - JSON conversation array - turn1 = json.dumps([ - {"role": "user", "content": "Hello"}, - {"role": "assistant", "content": "Hi there"}, - ]) + turn1 = json.dumps( + [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there"}, + ] + ) await memory.retain_batch_async( bank_id=bank_id, contents=[ @@ -271,10 +273,12 @@ async def test_append_mode_conversation_arrays_produce_valid_json(memory, reques ) # Second retain - append more turns - turn2 = json.dumps([ - {"role": "user", "content": "How are you"}, - {"role": "assistant", "content": "Doing well"}, - ]) + turn2 = json.dumps( + [ + {"role": "user", "content": "How are you"}, + {"role": "assistant", "content": "Doing well"}, + ] + ) await memory.retain_batch_async( bank_id=bank_id, contents=[ @@ -300,10 +304,12 @@ async def test_append_mode_conversation_arrays_produce_valid_json(memory, reques assert len(parsed) == 4, "Should contain all 4 messages from both retains" # Third retain - append again, verify no degradation - turn3 = json.dumps([ - {"role": "user", "content": "What is new"}, - {"role": "assistant", "content": "Not much"}, - ]) + turn3 = json.dumps( + [ + {"role": "user", "content": "What is new"}, + {"role": "assistant", "content": "Not much"}, + ] + ) await memory.retain_batch_async( bank_id=bank_id, contents=[ @@ -329,4 +335,3 @@ async def test_append_mode_conversation_arrays_produce_valid_json(memory, reques finally: await memory.delete_bank(bank_id, request_context=request_context) - diff --git a/hindsight-cli/src/commands/mental_model.rs b/hindsight-cli/src/commands/mental_model.rs index 656eafef5..068b14a52 100644 --- a/hindsight-cli/src/commands/mental_model.rs +++ b/hindsight-cli/src/commands/mental_model.rs @@ -120,6 +120,7 @@ pub fn create( Some(types::MentalModelTriggerInput { mode: types::Mode::Full, refresh_after_consolidation: true, + refresh_cron: None, exclude_mental_models: false, exclude_mental_model_ids: None, fact_types: None, @@ -198,6 +199,7 @@ pub fn update( let trigger = trigger_refresh_after_consolidation.map(|refresh| types::MentalModelTriggerInput { mode: types::Mode::Full, refresh_after_consolidation: refresh, + refresh_cron: None, exclude_mental_models: false, exclude_mental_model_ids: None, fact_types: None,