Skip to content

Feat/datainfra refactor tracker#76

Merged
jerry609 merged 22 commits into
masterfrom
feat/datainfra-refactor-tracker
Feb 12, 2026
Merged

Feat/datainfra refactor tracker#76
jerry609 merged 22 commits into
masterfrom
feat/datainfra-refactor-tracker

Conversation

@jerry609

@jerry609 jerry609 commented Feb 12, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added model endpoint management with CRUD operations, testing, and activation
    • Introduced LLM usage tracking and analytics dashboard
    • Implemented long-running daily pipeline with session resumption and approval workflows
    • Added deadline radar showing upcoming conference deadlines
    • Launched track-based feed for personalized content discovery
    • Created settings interface for managing LLM provider configurations
  • Bug Fixes

    • Improved paper identity resolution matching accuracy

Copilot AI review requested due to automatic review settings February 12, 2026 11:34
@jerry609
jerry609 merged commit 80caab3 into master Feb 12, 2026
5 of 6 checks passed
@coderabbitai

coderabbitai Bot commented Feb 12, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces a comprehensive set of features for LLM provider management, long-running pipeline session handling with approval workflows, unified topic search, and enhanced research/daily paper capabilities. It includes multiple database migrations, new REST API endpoints for managing model endpoints, persistent session and LLM usage tracking stores, refined frontend components for deadline radar and approval queues, and streaming-based daily paper workflows with resume support.

Changes

Cohort / File(s) Summary
Alembic Migrations
alembic/versions/000[7-9]_*.py, alembic/versions/00[10-15]_*.py
Six new migrations: 0007 adds index creation guards; 0010 backfills canonical_paper_id and manages indexes; 0011 creates model_endpoints table; 0012 reconciles papers schema with new columns; 0013 adds api_key_value to model_endpoints; 0014 creates llm_usage table; 0015 creates pipeline_sessions table. All include offline-safe helpers and schema guards.
Model Endpoint Stores & ORM
src/paperbot/infrastructure/stores/model_endpoint_store.py, src/paperbot/infrastructure/stores/models.py
New ModelEndpointStore with CRUD, activation, and validation; new ORM models ModelEndpointModel, LLMUsageModel, PipelineSessionModel; secret masking and default routing logic.
LLM Usage & Pipeline Session Stores
src/paperbot/infrastructure/stores/llm_usage_store.py, src/paperbot/infrastructure/stores/pipeline_session_store.py
New LLMUsageStore for recording usage metrics and aggregating summaries; new PipelineSessionStore for session lifecycle, checkpointing, and result persistence with JSON state management.
Model Endpoint API Routes
src/paperbot/api/routes/model_endpoints.py, src/paperbot/api/main.py, src/paperbot/api/routes/__init__.py
New router with endpoints for list, create, update, delete, activate, test, and capabilities; request/response models; validation and error handling; ModelEndpointStore and ModelRouter integration.
PapersCool/Daily Routes Enhancement
src/paperbot/api/routes/paperscool.py
Major refactor: adds session-based long-running workflows with checkpointing; introduces approval workflow for pending daily reports; extends streaming support with session state preservation; integrates unified topic search and LLMEnrichmentStep; adds endpoints for session queries and approval decisions.
Research Routes Enhancement
src/paperbot/api/routes/research.py
New endpoints for deadline radar, track feed; adds PaperSearchService injection; extends ContextRequest with sources; adds pagination and track-based filtering to saved papers.
Enrichment Pipeline & Services
src/paperbot/application/services/enrichment_pipeline.py, src/paperbot/application/services/provider_resolver.py, src/paperbot/application/services/llm_service.py, src/paperbot/application/services/identity_resolver.py
New LLMEnrichmentStep, JudgeStep, FilterStep for pipeline composition; new ProviderResolver protocol and RouterBackedProviderResolver; LLMService extended with provider resolver, usage tracking, token/cost estimation; identity_resolver refines URL matching by removing external_url check.
Unified Topic Search Workflow
src/paperbot/application/workflows/unified_topic_search.py
New comprehensive async workflow with query normalization, tokenization, paper scoring, deduplication, and result aggregation; includes per-query and cross-source views with summary metrics.
Infrastructure Router & Identity
src/paperbot/infrastructure/llm/router.py, src/paperbot/infrastructure/stores/research_store.py
ModelRouter extended with registry-based auto-configuration and api_key field; ResearchStore integrated with IdentityResolver for paper identity resolution; new list_track_feed method.
Paper Store & Context Engine
src/paperbot/infrastructure/stores/paper_store.py, src/paperbot/context_engine/engine.py
PaperStore adds get_latest_judge_scores and adjusts get_user_library to support track filtering and judge data attachment; ContextEngine adds judge score and feedback flag attachment with safe error handling.
Queue Worker & CLI
src/paperbot/infrastructure/queue/arq_worker.py, src/paperbot/presentation/cli/main.py
Queue worker refactored to use unified_topic_search; CLI extended with session management (--session-id, --resume) and PipelineSessionStore integration.
Streaming & Events
src/paperbot/api/streaming.py, web/src/lib/sse.ts
Backend streaming adds StandardEvent enum, event field propagation, and canonical event kind normalization; frontend SSE types updated to include event metadata and normalization logic.
Next.js API Routes
web/src/app/api/model-endpoints/*, web/src/app/api/research/deadlines/radar/route.ts, web/src/app/api/research/paperscool/approvals/route.ts, web/src/app/api/research/paperscool/sessions/[sessionId]/*/route.ts, web/src/app/api/research/tracks/[trackId]/feed/route.ts
New proxy routes for model endpoints CRUD, test, activate; new routes for deadline radar, approvals, session management, and track feeds.
Frontend Components – Layout & Research
web/src/components/layout/SplitPanels.tsx, web/src/components/research/ResearchSplitWorkspace.tsx, web/src/components/research/ResearchPageNew.tsx, web/src/components/research/SearchResults.tsx, web/src/components/research/FeedTab.tsx, web/src/components/research/SavedTab.tsx, web/src/components/research/MemoryTab.tsx, web/src/components/research/ApprovalQueuePanel.tsx
New SplitPanels responsive layout component; ResearchSplitWorkspace composition; ResearchPageNew extended with tabs (search, feed, saved, memory) and source filtering; new FeedTab, SavedTab, MemoryTab, ApprovalQueuePanel components.
Frontend Components – AI Elements
web/src/components/ai-elements/code-block.tsx, web/src/components/ai-elements/reasoning-block.tsx, web/src/components/ai-elements/tool-actions-group.tsx, web/src/components/ai-elements/index.ts
New CodeBlock, ReasoningBlock, ToolActionsGroup components for rendering AI-generated content and actions; barrel index for consolidated exports.
Frontend Components – Dashboard & Paper
web/src/components/dashboard/DeadlineRadar.tsx, web/src/components/dashboard/LLMUsageChart.tsx, web/src/components/research/PaperCard.tsx
New DeadlineRadar component for showing upcoming conference deadlines; LLMUsageChart refactored to consume aggregated LLMUsageSummary; PaperCard extended with judge scores, reasoning, and ToolActionsGroup.
Frontend Pages & Settings
web/src/app/page.tsx, web/src/app/research/page.tsx, web/src/app/dashboard/page.tsx, web/src/app/settings/page.tsx, web/src/app/workflows/page.tsx
Home page redirects to dashboard; research page wrapped in Suspense; dashboard enhanced with deadline radar and refactored LLM usage metrics; settings page completely redesigned for model endpoint management; workflows page accepts initialQueries from searchParams.
Frontend Utilities & Routing
web/src/lib/api.ts, web/src/lib/sse.ts, web/src/lib/types.ts, web/src/components/layout/Sidebar.tsx
API utilities refactored to fetch real LLM usage and deadline radar data; SSE types extended with event metadata; new types for LLMUsageSummary, DeadlineRadarItem, and provider/model records; sidebar route updated to /research.
Tests
tests/unit/test_context_engine_enrichment.py, tests/unit/test_llm_service.py, tests/unit/test_llm_usage_store.py, tests/unit/test_model_endpoint_store.py, tests/unit/test_model_endpoints_gateway.py, tests/unit/test_paper_judge_persistence.py, tests/unit/test_paperscool_route.py, tests/unit/test_pipeline_session_store.py, tests/unit/test_research_paper_registry_routes.py, tests/unit/test_streaming_envelope.py
New test coverage for enrichment pipeline utilities, LLM service dependency injection, usage/endpoint/session stores, API gateway behavior, judge persistence, streaming envelopes, and approval workflows.
Backfill Script
scripts/backfill_identifiers.py
Enhanced backfill_canonical_paper_id to accept db_url and use IdentityResolver for paper identity resolution; tracks resolved_from_ref and resolved_from_identity_resolver counters.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Client as Client Browser
    participant API as FastAPI Server
    participant SessionStore as PipelineSessionStore
    participant SearchService as UnifiedTopicSearch
    participant LLMService as LLMService
    participant EnrichmentPipeline as EnrichmentPipeline
    participant DB as Database

    User->>Client: Initiate daily paper search
    Client->>API: POST /daily with session_id, resume flag
    
    alt Session exists and resuming
        API->>SessionStore: get_session(session_id)
        SessionStore->>DB: query pipeline_sessions
        DB-->>SessionStore: return saved state & checkpoint
        SessionStore-->>API: return session data
        API->>SearchService: skip search, restore cached results
    else New session or no resume
        API->>SessionStore: start_session(workflow, payload)
        SessionStore->>DB: create pipeline_sessions row
        DB-->>SessionStore: return session_id
        SessionStore-->>API: return session data
        
        API->>SearchService: run_unified_topic_search(queries)
        SearchService-->>API: return search results
        API->>SessionStore: save_checkpoint(session_id, "search_done", state)
        SessionStore->>DB: update checkpoint & state_json
    end
    
    API->>EnrichmentPipeline: process papers
    EnrichmentPipeline->>LLMService: summary, relevance, judge
    LLMService-->>EnrichmentPipeline: enriched papers with judge
    EnrichmentPipeline-->>API: return filtered papers
    
    API->>SessionStore: save_checkpoint(session_id, "enriched", state)
    SessionStore->>DB: update state
    
    alt Approval required
        API-->>Client: SSE stream with "approval_pending"
        Client-->>User: Display approval queue
        User->>Client: Approve or reject
        Client->>API: POST /sessions/{id}/approve
        API->>SessionStore: save_result & update_status
        SessionStore->>DB: mark approved, persist result
        API-->>Client: SSE "result" event
    else Auto-finalize
        API->>SessionStore: save_result(session_id, final_result)
        SessionStore->>DB: update result_json, status
        API-->>Client: SSE "result" event
    end
    
    Client-->>User: Display daily report
Loading
sequenceDiagram
    actor User
    participant Client as Settings UI
    participant API as FastAPI Server
    participant EndpointStore as ModelEndpointStore
    participant ModelRouter as ModelRouter
    participant Provider as LLM Provider
    participant DB as Database

    User->>Client: Open Settings / Model Providers
    Client->>API: GET /api/model-endpoints
    API->>EndpointStore: list_endpoints()
    EndpointStore->>DB: query model_endpoints (masked secrets)
    DB-->>EndpointStore: return endpoints
    EndpointStore-->>API: return list
    API-->>Client: return ModelEndpointListResponse

    Client-->>User: Render endpoint list + form

    User->>Client: Create or update endpoint
    Client->>API: POST/PATCH /api/model-endpoints/{id}
    API->>EndpointStore: upsert_endpoint(payload)
    EndpointStore->>DB: insert/update model_endpoints row
    DB-->>EndpointStore: return updated row
    EndpointStore-->>API: return endpoint
    API-->>Client: return response

    Client-->>User: Show success/updated endpoint

    User->>Client: Click "Test" button on endpoint
    Client->>API: POST /api/model-endpoints/{id}/test with remote=true
    API->>EndpointStore: get_endpoint(endpoint_id, include_secrets=true)
    EndpointStore->>DB: query with api_key_value
    DB-->>EndpointStore: return endpoint + secret
    
    API->>ModelRouter: from_registry() load provider
    ModelRouter->>DB: query model_endpoints for config
    API->>Provider: invoke remote health check
    Provider-->>API: return provider info & status
    API-->>Client: return EndpointTestResponse (ok, provider metadata)

    Client-->>User: Show test result & provider info
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

  • Issue #62: Implements the Research feed tabs (Search/Feed/Saved/Memory) with FeedTab, SavedTab, MemoryTab components and SearchResults source selector, directly addressing the same feature set.

Possibly related PRs

  • PR #50: Changes build upon the IdentityResolver and paper identity backfill logic introduced in that PR; both modify backfill_identifiers and identity resolution paths.
  • PR #49: Both work on the Research page feature set redesign and new research endpoints/store methods.
  • PR #27: Main PR modifies alembic/versions/0007_paper_harvest_tables.py with column-inspection guards, building on the harvest migrations from that PR.

Suggested reviewers

  • ThankUYou
  • wen-placeholder

Poem

🐰 whiskers twitching with joy

Sessions that remember, approvals that flow,
Deadlines light up like stars row by row,
Papers enriched with AI's keen eye,
A unified search that reaches so high!
From model endpoints to streaming delight,
This PR brings research into the light! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/datainfra-refactor-tracker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @jerry609, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the application's data infrastructure and user interface, particularly focusing on LLM integration and research workflows. It introduces new database schemas for managing LLM providers, tracking usage, and persisting pipeline states. The LLM service is refactored for better extensibility and cost management. The user interface for research has been overhauled with a more organized layout, new features like a personalized paper feed, and a conference deadline tracker, alongside a dedicated UI for managing LLM model configurations.

Highlights

  • Database Schema Migrations: Introduced several new Alembic migrations to support new features, including a model_endpoints table for LLM provider configurations, an llm_usage table for tracking token and cost, and a pipeline_sessions table for managing long-running workflow checkpoints. Existing tables like paper_feedback and papers were also updated for canonical foreign keys and schema reconciliation.
  • LLM Service Refactoring and Usage Tracking: Refactored the LLM service to utilize a ProviderResolver for dynamic model routing and integrated LLMUsageStore to record and summarize LLM token and cost usage. This allows for better observability and management of LLM interactions.
  • Pipeline Session Management: Implemented a robust pipeline session tracking mechanism using PipelineSessionStore. This enables long-running workflows, such as daily paper generation, to be paused, resumed, and require manual approval at various checkpoints, improving reliability and control.
  • Unified Topic Search Workflow: Introduced a new unified_topic_search workflow that consolidates paper search logic, offering improved flexibility and integration with various data sources and scoring mechanisms.
  • Enhanced Research UI and API Endpoints: Expanded the research interface with new UI components and corresponding API endpoints. This includes a split-panel layout for the research workspace, dedicated tabs for 'Feed', 'Saved Papers', and 'Memory', and a 'Deadline Radar' to track upcoming conference deadlines relevant to user interests.
  • Model Provider Management UI: Added a new settings page in the web UI for managing LLM model providers. Users can now configure, test, activate, and delete custom LLM endpoints, including API keys and task routing, directly from the interface.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • alembic/versions/0007_paper_harvest_tables.py
    • Modified _create_index to include a check for column existence before creating an index.
  • alembic/versions/0010_contract_feedback_fk.py
    • Added a new migration to backfill canonical_paper_id in paper_feedback from paper_ref_id or IdentityResolver.
    • Added an optimized index for library reads by canonical FK and dropped a legacy paper_id index.
  • alembic/versions/0011_model_endpoints.py
    • Added a new migration to create the model_endpoints table for managing LLM provider configurations.
  • alembic/versions/0012_reconcile_papers_schema.py
    • Added a new migration to reconcile the papers table schema by adding missing columns and indexes.
  • alembic/versions/0013_model_endpoint_api_key.py
    • Added a new migration to add an api_key_value column to the model_endpoints table for direct API key storage.
  • alembic/versions/0014_llm_usage.py
    • Added a new migration to create the llm_usage table for tracking LLM token and cost usage.
  • alembic/versions/0015_pipeline_sessions.py
    • Added a new migration to create the pipeline_sessions table for managing long-running workflow checkpoints.
  • scripts/backfill_identifiers.py
    • Updated backfill_canonical_paper_id to use IdentityResolver for more robust ID resolution.
    • Imported the json module.
  • src/paperbot/api/main.py
    • Imported and included the new model_endpoints router in the FastAPI application.
  • src/paperbot/api/routes/init.py
    • Added 'model_endpoints' to the all list for API route exposure.
  • src/paperbot/api/routes/model_endpoints.py
    • Added a new file defining API endpoints for CRUD operations on LLM model endpoints, testing connectivity, and summarizing LLM usage.
  • src/paperbot/api/routes/paperscool.py
    • Refactored daily paper generation to integrate with PipelineSessionStore for checkpointing and resume functionality.
    • Introduced EnrichmentPipeline steps (LLMEnrichmentStep, JudgeStep, FilterStep) for modular processing.
    • Added API endpoints for managing pending approval sessions (list, approve, reject).
  • src/paperbot/api/routes/research.py
    • Added a new /research/deadlines/radar endpoint to fetch conference deadline information.
    • Updated context engine initialization to support new search service and paper store components.
    • Introduced a /research/tracks/{track_id}/feed endpoint for personalized paper feeds.
  • src/paperbot/api/streaming.py
    • Enhanced StreamEvent with a canonical 'event' field for unified frontend handling.
    • Added _canonical_event_kind helper function to normalize event types.
  • src/paperbot/application/services/enrichment_pipeline.py
    • Modified docstring to reflect new filtering capabilities.
    • Added LLMEnrichmentStep for LLM-based summary and relevance features.
    • Added JudgeStep for attaching judge scores to papers.
    • Added FilterStep to mark papers for filtering based on recommendations.
  • src/paperbot/application/services/identity_resolver.py
    • Removed PaperModel.external_url from URL candidates during identity resolution.
  • src/paperbot/application/services/llm_service.py
    • Refactored LLMService to use a ProviderResolver for obtaining LLM providers.
    • Integrated LLMUsageStore to record token and cost usage for each LLM call.
    • Added token and cost estimation logic for various LLM providers.
  • src/paperbot/application/services/provider_resolver.py
    • Added a new file defining the ProviderResolver Protocol and RouterBackedProviderResolver implementation.
  • src/paperbot/application/workflows/unified_topic_search.py
    • Added a new file implementing a unified topic search workflow for consistent paper retrieval and scoring.
  • src/paperbot/context_engine/engine.py
    • Added search_sources to ContextEngineConfig for specifying search data sources.
    • Included paper_store and search_service in ContextEngine initialization.
    • Added _attach_latest_judge and _attach_feedback_flags methods for enriching paper data with feedback and judge scores.
  • src/paperbot/infrastructure/llm/router.py
    • Modified ModelConfig to include an optional api_key field for direct key storage.
    • Added _normalize_provider and _from_model_registry methods to build the model router from the new model_endpoints registry.
    • Updated _create_provider to prioritize api_key from ModelConfig over environment variables.
  • src/paperbot/infrastructure/queue/arq_worker.py
    • Updated daily_papers_job to use the new run_unified_topic_search workflow and make_default_search_service.
  • src/paperbot/infrastructure/stores/llm_usage_store.py
    • Added a new file defining LLMUsageStore for persisting and summarizing LLM token and cost usage records.
  • src/paperbot/infrastructure/stores/model_endpoint_store.py
    • Added a new file defining ModelEndpointStore for managing LLM model endpoint configurations in the database.
  • src/paperbot/infrastructure/stores/models.py
    • Added ModelEndpointModel, LLMUsageModel, and PipelineSessionModel ORM models.
    • Adjusted PaperFeedbackModel to simplify canonical_paper_id mapping.
    • Updated PaperModel relationships for cascade delete on identifiers.
  • src/paperbot/infrastructure/stores/paper_store.py
    • Modified get_user_library to retrieve additional feedback details (ts, track_id, action).
    • Added get_latest_judge_scores method to fetch the most recent judge score for given paper IDs.
  • src/paperbot/infrastructure/stores/pipeline_session_store.py
    • Added a new file defining PipelineSessionStore for managing long-running pipeline session checkpoints.
  • src/paperbot/infrastructure/stores/research_store.py
    • Initialized IdentityResolver for consistent paper ID resolution.
    • Added track_id filter to list_saved_papers for track-specific saved items.
    • Introduced list_track_feed method to generate a personalized paper feed for a given track.
  • src/paperbot/presentation/cli/main.py
    • Updated CLI daily paper workflow to integrate with PipelineSessionStore for resume functionality.
    • Switched CLI topic search to use the new run_unified_topic_search workflow.
  • tests/unit/test_context_engine_enrichment.py
    • Added new tests for _attach_latest_judge to ensure correct judge score attachment.
    • Added new tests for _attach_feedback_flags to verify saved and liked status marking.
  • tests/unit/test_llm_service.py
    • Added tests for injecting a custom ProviderResolver into LLMService.
    • Added tests to verify LLM usage recording functionality.
  • tests/unit/test_llm_usage_store.py
    • Added new tests for LLMUsageStore to record and summarize LLM usage data.
  • tests/unit/test_model_endpoint_store.py
    • Added new tests for ModelEndpointStore covering endpoint activation, default reassignment on deletion, and API key masking behavior.
  • tests/unit/test_model_endpoints_gateway.py
    • Added new API gateway tests for model endpoint CRUD operations.
    • Verified model router integration with the new registry-based configuration.
    • Tested LLM usage summary route functionality.
  • tests/unit/test_paper_judge_persistence.py
    • Added tests for feedback resolution via identity store mapping.
    • Added tests for get_latest_judge_scores to ensure the latest judge score is returned per paper.
  • tests/unit/test_paperscool_route.py
    • Added tests for daily paper session resume functionality.
    • Added tests for the pending approval workflow and approval decisions (approve/reject).
  • tests/unit/test_pipeline_session_store.py
    • Added new tests for PipelineSessionStore covering session start, checkpointing, result saving, and listing.
  • tests/unit/test_research_paper_registry_routes.py
    • Added new tests for the track feed route, including pagination and feedback boosting.
    • Added new tests for the deadline radar route, verifying workflow query and track matching.
  • tests/unit/test_streaming_envelope.py
    • Modified _simple_stream to include a 'search_done' event.
    • Updated assertions to check for canonical event types in the streaming envelope.
  • web/src/app/api/model-endpoints/[id]/activate/route.ts
    • Added new API route for activating a specific model endpoint.
  • web/src/app/api/model-endpoints/[id]/route.ts
    • Added new API routes for patching and deleting a specific model endpoint.
  • web/src/app/api/model-endpoints/[id]/test/route.ts
    • Added new API route for testing a specific model endpoint's connectivity.
  • web/src/app/api/model-endpoints/route.ts
    • Added new API routes for listing and creating model endpoints.
  • web/src/app/api/research/deadlines/radar/route.ts
    • Added new API route for fetching conference deadline radar data.
  • web/src/app/api/research/paperscool/approvals/route.ts
    • Added new API route for listing pending approval sessions.
  • web/src/app/api/research/paperscool/sessions/[sessionId]/approve/route.ts
    • Added new API route for approving a specific pipeline session.
  • web/src/app/api/research/paperscool/sessions/[sessionId]/reject/route.ts
    • Added new API route for rejecting a specific pipeline session.
  • web/src/app/api/research/paperscool/sessions/[sessionId]/route.ts
    • Added new API route for retrieving details of a specific pipeline session.
  • web/src/app/api/research/tracks/[trackId]/feed/route.ts
    • Added new API route for fetching a paper feed for a specific track.
  • web/src/app/dashboard/page.tsx
    • Updated dashboard page to fetch and display LLM usage summary and deadline radar data.
    • Adjusted LLM usage stats card description.
  • web/src/app/page.tsx
    • Redirected the root path (/) to the /dashboard page.
  • web/src/app/research/page.tsx
    • Switched the research page to use the new ResearchSplitWorkspace component for a multi-panel layout.
  • web/src/app/settings/page.tsx
    • Replaced static LLM configuration with a dynamic UI for managing LLM model providers, including presets, CRUD operations, and testing.
  • web/src/app/workflows/page.tsx
    • Updated the workflows page to accept initial queries from URL search parameters.
  • web/src/components/ai-elements/code-block.tsx
    • Added a new React component for displaying formatted code blocks with copy functionality.
  • web/src/components/ai-elements/index.ts
    • Exported new AI-related components: CodeBlock, ReasoningBlock, and ToolActionsGroup.
  • web/src/components/ai-elements/reasoning-block.tsx
    • Added a new React component for displaying lists of reasoning points or tags.
  • web/src/components/ai-elements/tool-actions-group.tsx
    • Added a new React component for grouping and rendering tool action buttons.
  • web/src/components/dashboard/DeadlineRadar.tsx
    • Added a new React component to display upcoming conference deadlines, including track matching and workflow links.
  • web/src/components/dashboard/LLMUsageChart.tsx
    • Updated LLM usage chart to consume the new LLMUsageSummary data structure and dynamically render provider bars.
  • web/src/components/layout/Sidebar.tsx
    • Updated sidebar navigation routes to reflect the new dashboard and research page structure.
  • web/src/components/layout/SplitPanels.tsx
    • Added a new React component for creating resizable and collapsible split panel layouts, with mobile responsiveness and state persistence.
  • web/src/components/research/ApprovalQueuePanel.tsx
    • Added a new React component for displaying and managing pending approval sessions for workflows.
  • web/src/components/research/FeedTab.tsx
    • Added a new React component for displaying a personalized paper feed for the active research track.
  • web/src/components/research/MemoryTab.tsx
    • Added a new React component for displaying memory inbox items associated with the active research track.
  • web/src/components/research/PaperCard.tsx
    • Updated PaperCard to display latest judge scores and use the new ToolActionsGroup component for actions.
    • Added is_saved property to Paper type.
  • web/src/components/research/ResearchPageNew.tsx
    • Integrated new tabs (Search, Feed, Saved, Memory) into the research page.
    • Updated search functionality to include source filtering and activate track from URL parameters.
  • web/src/components/research/ResearchSplitWorkspace.tsx
    • Added a new React component that defines the overall layout of the research workspace using SplitPanels, including rail, list, and detail views.
  • web/src/components/research/SavedTab.tsx
    • Added a new React component for displaying saved papers, filterable by the active research track.
  • web/src/components/research/SearchResults.tsx
    • Added source filtering options to the search results display.
  • web/src/components/research/TopicWorkflowDashboard.tsx
    • Updated TopicWorkflowDashboard to accept initial queries via props.
  • web/src/components/studio/ExecutionLog.tsx
    • Updated ExecutionLog to use the new CodeBlock component for displaying arguments and results.
  • web/src/lib/api.ts
    • Updated fetchStats to dynamically retrieve LLM usage data.
    • Modified fetchLLMUsage to call the new API endpoint and provide a static fallback.
    • Added fetchDeadlineRadar to retrieve conference deadline information.
  • web/src/lib/sse.ts
    • Enhanced SSE message normalization to include a canonical 'event' field, improving event type handling.
  • web/src/lib/types.ts
    • Updated types to include LLMUsageDailyRecord, LLMUsageProviderModelRecord, and LLMUsageSummary interfaces.
    • Added DeadlineRadarItem interface for conference deadline data.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors “tracker”/research UX and backend infra by introducing a split research workspace (rail/list/detail), adding model endpoint management + LLM usage tracking, normalizing SSE events with canonical event kinds, and expanding research APIs (track feed, saved-by-track, deadline radar) to support the new UI.

Changes:

  • Add model endpoint registry + CRUD/test/activate APIs, plus LLM usage persistence/aggregation and dashboard UI updates.
  • Introduce research workspace + tabs (Search/Feed/Saved/Memory), source toggles for search, and an approvals side panel.
  • Add pipeline session checkpointing/resume support and unify topic search workflow integration (CLI + worker).

Reviewed changes

Copilot reviewed 75 out of 75 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web/src/lib/types.ts Replace old LLM usage record types with usage summary + deadline radar types.
web/src/lib/sse.ts Add canonical event field and normalize event kinds for UI handling.
web/src/lib/api.ts Fetch LLM usage summary + deadline radar from backend (with local fallback).
web/src/app/dashboard/page.tsx + components/dashboard/* Render usage summary + deadline radar on dashboard.
web/src/app/research/page.tsx + components/research/* New split workspace, tabs, feed/saved/memory panels, source toggle chips.
src/paperbot/api/routes/* Add model endpoints + deadline radar + track feed routes and context sources wiring.
src/paperbot/infrastructure/stores/* Add PipelineSessionStore, ModelEndpointStore, LLMUsageStore, track feed query, judge score lookup.
tests/unit/* Add/extend unit tests for new stores, routes, SSE envelope, resume/approval flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/src/lib/api.ts
Comment on lines 41 to +46
export async function fetchStats(): Promise<Stats> {
// TODO: Replace with real API call
// const res = await fetch(`${API_BASE_URL}/stats`)
// return res.json()
try {
const usage = await fetchLLMUsage()
const tokenCount = usage.totals.total_tokens
const prettyTokens = tokenCount >= 1000 ? `${Math.round(tokenCount / 1000)}k` : `${tokenCount}`
return {

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetchStats() calls fetchLLMUsage() internally, but the dashboard page also calls fetchLLMUsage() separately. This results in two identical network requests per dashboard render. Consider either (a) removing the internal fetchLLMUsage() call from fetchStats() and letting the caller format llm_usage, or (b) changing fetchStats() to accept an optional pre-fetched usage summary to avoid duplicate fetches.

Copilot uses AI. Check for mistakes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is a substantial pull request that introduces significant features and refactors core parts of the application. The introduction of a dynamic model provider gateway, LLM usage tracking, and a resumable pipeline for daily paper generation are excellent additions that greatly enhance the system's capabilities and robustness. The refactoring of workflows into modular enrichment pipelines is a particularly strong design choice.

However, there is a critical security vulnerability in how API keys are stored for the new model provider gateway. Storing secrets in plaintext in the database is a major risk and must be addressed. I've also included a couple of medium-severity comments regarding database portability and maintainability. Overall, this is a very impressive set of changes, but the security issue is paramount.

Comment on lines +46 to +49
if "api_key_value" not in _columns("model_endpoints"):
op.add_column(
"model_endpoints", sa.Column("api_key_value", sa.String(length=512), nullable=True)
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Storing API keys, even if nullable, directly in the database in plaintext is a critical security vulnerability. If the database is compromised, all these secrets will be exposed.

Secrets should be stored in a dedicated secret manager (like HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault) and accessed at runtime. At a minimum, these values should be encrypted at the application layer before being stored in the database, and decrypted only when needed. Please reconsider this approach to secret management.

Comment on lines +103 to +111
op.execute(
sa.text(
"""
UPDATE papers
SET title_hash = lower(hex(randomblob(16)))
WHERE title_hash IS NULL OR title_hash = ''
"""
)
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of randomblob is specific to SQLite and will cause this migration to fail on other database systems like PostgreSQL. For better database portability, consider using a more generic SQLAlchemy function or dialect-specific conditional execution.

For example, you could use sqlalchemy.func.random() and then format it as a hex string within your application logic if the format is important, or use different functions based on the database dialect.

Comment on lines +333 to +353
def _estimate_cost_usd(
*, provider_name: str, model_name: str, prompt_tokens: int, completion_tokens: int
) -> float:
provider = (provider_name or "").lower()
model = (model_name or "").lower()

in_price = 0.0
out_price = 0.0

if provider == "openai" and "gpt-4o-mini" in model:
in_price, out_price = 0.15, 0.60
elif provider == "openai" and "gpt-4o" in model:
in_price, out_price = 2.50, 10.00
elif provider == "anthropic" and "claude-3-5-sonnet" in model:
in_price, out_price = 3.00, 15.00
elif provider == "deepseek":
in_price, out_price = 0.55, 2.19
elif provider == "ollama":
in_price, out_price = 0.0, 0.0

return ((prompt_tokens * in_price) + (completion_tokens * out_price)) / 1_000_000

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding model pricing in the _estimate_cost_usd function makes it difficult to maintain. As pricing changes or new models are added, this code will need to be constantly updated.

Consider moving this pricing information into a configuration file or, even better, storing it as part of the model's configuration in the model_endpoints table. This would make the system more flexible and easier to manage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants