Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ POSTGRES_PORT=5432
DATABASE_URL=postgresql+asyncpg://techwatch:techwatch@postgres:5432/techwatch
DATABASE_SYNC_URL=postgresql://techwatch:techwatch@postgres:5432/techwatch

# Redis
REDIS_URL=redis://redis:6379

# App exposure / admin
FRONTEND_URL=http://localhost:3000
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://localhost:5173,http://127.0.0.1:5173
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Frontend CI

on:
push:
branches: [main, master, dev, 'feat/**', 'fix/**', 'chore/**', 'hotfix/**']
paths:
- 'frontend/**'
- '.github/workflows/ci-frontend.yml'
pull_request:
branches: [main, master, dev]
paths:
- 'frontend/**'

env:
NODE_VERSION: '20'

jobs:
build:
name: Type-check & Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Type-check
run: npx tsc --noEmit

- name: Build
run: npm run build
env:
VITE_API_URL: http://localhost:8000
93 changes: 93 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Python CI

on:
push:
branches: [main, master, dev, 'feat/**', 'fix/**', 'chore/**', 'hotfix/**']
paths:
- 'app/**'
- 'tests/**'
- 'alembic/**'
- 'pyproject.toml'
- '.github/workflows/ci-python.yml'
pull_request:
branches: [main, master, dev]
paths:
- 'app/**'
- 'tests/**'
- 'alembic/**'
- 'pyproject.toml'

env:
PYTHON_VERSION: '3.11'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dev dependencies
run: |
uv venv .venv --python ${{ env.PYTHON_VERSION }}
uv pip install --python .venv/bin/python -e ".[dev]"
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH

- name: ruff check
run: ruff check .

test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: techwatch_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/techwatch_test
DATABASE_SYNC_URL: postgresql://postgres:postgres@localhost:5432/techwatch_test
ADMIN_API_TOKEN: ci-test-token
CONFIG_ENCRYPTION_KEY: ""
LLM_API_KEY: ci-test-key

steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
uv venv .venv --python ${{ env.PYTHON_VERSION }}
uv pip install --python .venv/bin/python -e ".[dev]"
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH

- name: Run migrations
run: alembic upgrade head

- name: Run tests
run: pytest tests/ -v --cov=app --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
175 changes: 0 additions & 175 deletions .github/workflows/ci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions app/agents/deep_research/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def build(self, checkpointer=None) -> CompiledStateGraph:
# Build the main agent graph
main_graph = StateGraph(
DeepResearchAgentState,
config_schema=DeepResearchConfig,
context_schema=DeepResearchConfig,
)

# Add main workflow nodes
Expand Down Expand Up @@ -98,7 +98,7 @@ def _build_supervisor_subgraph(self) -> CompiledStateGraph:
"""
supervisor_graph = StateGraph(
SupervisorState,
config_schema=DeepResearchConfig,
context_schema=DeepResearchConfig,
)

supervisor_graph.add_node("supervisor", self.nodes.supervisor)
Expand Down
12 changes: 7 additions & 5 deletions app/agents/deep_research/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import re
from typing import Any, Optional

from langgraph.types import RunnableConfig

from langchain_core.messages import (
AIMessage,
HumanMessage,
Expand Down Expand Up @@ -496,7 +498,7 @@ async def _generate_completion(
async def clarify_with_user(
self,
state: DeepResearchAgentState,
config: Optional[dict] = None,
config: Optional[RunnableConfig] = None,
) -> dict[str, Any]:
"""Analyze user messages and ask clarifying questions if needed."""
from langgraph.types import Command
Expand Down Expand Up @@ -538,7 +540,7 @@ async def clarify_with_user(
async def write_research_brief(
self,
state: DeepResearchAgentState,
config: Optional[dict] = None,
config: Optional[RunnableConfig] = None,
) -> dict[str, Any]:
"""Transform user messages into a structured research brief."""
from langgraph.types import Command
Expand Down Expand Up @@ -584,7 +586,7 @@ async def write_research_brief(
async def supervisor(
self,
state: SupervisorState,
config: Optional[dict] = None,
config: Optional[RunnableConfig] = None,
) -> dict[str, Any]:
"""Lead research supervisor that plans and delegates research."""
from langgraph.types import Command
Expand Down Expand Up @@ -652,7 +654,7 @@ class SupervisorDecision(BaseModel):
async def supervisor_tools(
self,
state: SupervisorState,
config: Optional[dict] = None,
config: Optional[RunnableConfig] = None,
) -> dict[str, Any]:
"""Execute supervisor tools (research delegation)."""
from langgraph.types import Command
Expand Down Expand Up @@ -862,7 +864,7 @@ async def merge_results(
async def final_report_generation(
self,
state: DeepResearchAgentState,
config: Optional[dict] = None,
config: Optional[RunnableConfig] = None,
) -> dict[str, Any]:
"""Generate the final research report."""
research_brief = state.get("research_brief", "")
Expand Down
Loading
Loading