diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 831b2626..6947fe3a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -441,3 +441,32 @@ jobs: run: | echo "=== API Server Logs ===" cat /tmp/api-server.log || echo "No API server log found" + + test-litellm-integration: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + prune-cache: false + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: ".python-version" + + - name: Build litellm integration + working-directory: ./hindsight-integrations/litellm + run: uv build + + - name: Install dependencies + working-directory: ./hindsight-integrations/litellm + run: uv sync --extra dev + + - name: Run tests + working-directory: ./hindsight-integrations/litellm + run: uv run pytest tests -v \ No newline at end of file diff --git a/hindsight-api/hindsight_api/engine/llm_wrapper.py b/hindsight-api/hindsight_api/engine/llm_wrapper.py index d3ff78ed..4d87c33f 100644 --- a/hindsight-api/hindsight_api/engine/llm_wrapper.py +++ b/hindsight-api/hindsight_api/engine/llm_wrapper.py @@ -175,9 +175,13 @@ class LLMProvider: is_reasoning_model = any(x in model_lower for x in ["gpt-5", "o1", "o3"]) # For GPT-4 and GPT-4.1 models, cap max_completion_tokens to 32000 + # For GPT-4o models, cap to 16384 is_gpt4_model = any(x in model_lower for x in ["gpt-4.1", "gpt-4-"]) + is_gpt4o_model = "gpt-4o" in model_lower if max_completion_tokens is not None: - if is_gpt4_model and max_completion_tokens > 32000: + if is_gpt4o_model and max_completion_tokens > 16384: + max_completion_tokens = 16384 + elif is_gpt4_model and max_completion_tokens > 32000: max_completion_tokens = 32000 # For reasoning models, max_completion_tokens includes reasoning + output tokens # Enforce minimum of 16000 to ensure enough space for both diff --git a/hindsight-api/hindsight_api/pg0.py b/hindsight-api/hindsight_api/pg0.py index ac642b52..1dc7ff6e 100644 --- a/hindsight-api/hindsight_api/pg0.py +++ b/hindsight-api/hindsight_api/pg0.py @@ -54,7 +54,9 @@ class EmbeddedPostgres: loop = asyncio.get_event_loop() info = await loop.run_in_executor(None, pg0.start) logger.info(f"PostgreSQL started on port {self.port}") - return info.uri + # Construct URI manually since pg0-embedded may return None + uri = info.uri if info and info.uri else f"postgresql://{self.username}:{self.password}@localhost:{self.port}/{self.database}" + return uri except Exception as e: last_error = str(e) if attempt < max_retries: @@ -89,9 +91,9 @@ class EmbeddedPostgres: pg0 = self._get_pg0() loop = asyncio.get_event_loop() info = await loop.run_in_executor(None, pg0.info) - if info is None or not info.running: - raise RuntimeError("PostgreSQL server is not running or URI not available") - return info.uri + # Construct URI manually since pg0-embedded may return None + uri = info.uri if info and info.uri else f"postgresql://{self.username}:{self.password}@localhost:{self.port}/{self.database}" + return uri async def is_running(self) -> bool: """Check if the PostgreSQL server is currently running.""" diff --git a/hindsight-control-plane/src/app/globals.css b/hindsight-control-plane/src/app/globals.css index e41afbd5..b58199f1 100644 --- a/hindsight-control-plane/src/app/globals.css +++ b/hindsight-control-plane/src/app/globals.css @@ -180,4 +180,13 @@ code, pre { -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; +} + +/* Fix datetime-local calendar icon visibility in both light and dark modes */ +input[type="datetime-local"]::-webkit-calendar-picker-indicator { + filter: invert(0.5); +} + +.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator { + filter: invert(1); } \ No newline at end of file diff --git a/hindsight-control-plane/src/components/bank-profile-view.tsx b/hindsight-control-plane/src/components/bank-profile-view.tsx index 7a4896ce..aa823d86 100644 --- a/hindsight-control-plane/src/components/bank-profile-view.tsx +++ b/hindsight-control-plane/src/components/bank-profile-view.tsx @@ -239,7 +239,7 @@ export function BankProfileView() {
{editMode ? ( <> - diff --git a/hindsight-control-plane/src/components/bank-selector.tsx b/hindsight-control-plane/src/components/bank-selector.tsx index 76b3aa60..8ff4573d 100644 --- a/hindsight-control-plane/src/components/bank-selector.tsx +++ b/hindsight-control-plane/src/components/bank-selector.tsx @@ -266,7 +266,7 @@ function BankSelectorInner() {