Spaces:
Sleeping
Sleeping
Commit History
-
fix: P0 provider mismatch and code quality audit fixes (#102)β
Unverified signature* refactor: replace hacky try/except with proper pydantic validation PROBLEM: - CodeRabbit recommended try/except for ADVANCED_MAX_ROUNDS parsing - This is hacky defensive programming, not Clean Code - Silent fallbacks mask configuration errors SOLUTION (Uncle Bob approved): 1. Add advanced_max_rounds to Settings with pydantic Field validation: - ge=1, le=20 bounds checking - Fails fast at startup with clear error message 2. Add advanced_timeout to Settings (60-900 seconds) 3. Remove os.getenv + try/except hack from advanced.py - Now uses settings.advanced_max_rounds directly 4. Fix domain.py: invalid domain strings now raise ValueError - Shows valid options in error message - Previously silently fell back to default 5. Update tests: 18 tests verifying fail-fast behavior - TestSettingsValidation: type errors, bounds violations all raise - TestGetDomainConfig: invalid strings raise with helpful message PHILOSOPHY: "If someone configures your app wrong, tell tβ¦599a754 -
fix(ui): CSS autofill override and text centeringβ
- Add -webkit-autofill selectors to prevent white background on focus - Add :focus-visible for better accessibility - Split description into two centered divs with styled HR - HR element was breaking text-align inheritance Fixes issue where API key input turned white when browser autofilled and text after HR was left-aligned instead of centered.36b8ff4 -
fix(ui): resolve Gradio 6 breaking change and align text
9b8af35 -
feat(ui): force dark mode for api key input and enhance synthesis error handling
ad823e0 -
fix(SPEC_11): address CodeRabbit review feedback (#92)β
Unverified signature* fix(SPEC_11): address CodeRabbit review feedback - Update run_full.py docstring to reference sexual health pipeline (not drug repurposing) - Update run_full.py help text to use sexual health query example - Fix app.py domain display to show "Sexual Health" (not "Sexual_Health") - Update test_nodes.py mock data to use sexual health terms (Testosterone, Androgen Receptor) - Add @pytest.mark.unit markers to test_judges.py test classes - Add specific assertion for next_search_queries in test_judges.py - Add missing @pytest.mark.asyncio marker to test_mcp_tools.py - Update test_mcp_tools.py and test_clinicaltrials.py to use sexual health queries - Fix SPEC_12 markdown bare code fence (MD040) * fix(SPEC_11): comprehensive domain alignment audit Second pass of CodeRabbit review fixes - found additional domain mismatches: - examples/search_demo/run_search.py: Update docstring from "drug repurposing" to "sexual health" - examples/orchestrator_demo/run_agent.py: Update help text from "metfβ¦89f1173 -
feat(SPEC_11): finalize transition to Sexual Health Research Specialistβ
This commit completes the transition of DeepBoner to a dedicated Sexual Health Research Agent by removing all references to "general" and "drug repurposing" domains. Key changes include: - Updated domain defaults to exclusively use "sexual_health". - Replaced all example queries and documentation to reflect a focus on sexual health topics. - Removed any lingering references to non-sexual health concepts in code and tests. - Ensured all tests are aligned with the new domain focus, passing successfully. This change reinforces the project's identity and simplifies the codebase, enhancing clarity and usability for users focused on sexual health research. Closes #89.fa696e8 -
feat(SPEC_11): narrow scope to sexual health onlyβ
BREAKING CHANGE: Remove GENERAL and DRUG_REPURPOSING domains DeepBoner is now a focused Sexual Health Research Specialist, not a general-purpose research agent. Changes: - Remove ResearchDomain.GENERAL and ResearchDomain.DRUG_REPURPOSING - Remove GENERAL_CONFIG and DRUG_REPURPOSING_CONFIG from domain.py - Set DEFAULT_DOMAIN = ResearchDomain.SEXUAL_HEALTH - Update Gradio examples (remove Metformin/Alzheimer's) - New example: "Testosterone therapy for hypoactive sexual desire disorder?" - Hide domain dropdown (only one option now) - Update all domain-related tests Closes #89627c291 -
feat: SPEC_10 - Domain-Agnostic Refactor + License Fix (#87)β
Unverified signature* feat: implement SPEC_10 domain-agnostic refactor * fix: complete SPEC_10 audit - license + HierarchicalOrchestrator domain License Fixes: - LICENSE: Fix copyright "Antibody Training Pipeline ESM" β "DeepBoner Contributors" - pyproject.toml: Add missing license = "Apache-2.0" field - README.md: Fix frontmatter license: mit β apache-2.0 Domain Threading Fixes: - hierarchical.py: Add domain param to __init__ and pass to ResearchTeam - factory.py: Pass domain to HierarchicalOrchestrator All 237 tests pass. Domain now properly threaded through all orchestrators. * test: enhance domain handling in orchestrators and judges - Updated unit tests for `configure_orchestrator` to include mock mode and free tier scenarios, ensuring the domain is correctly passed to handlers. - Refactored tests for `JudgeHandler` to mock model retrieval, allowing for domain acceptance without API key requirements. - Improved `AdvancedOrchestrator` tests to mock API key validation and ensure domain handling iβ¦fd1472e
-
feat(SPEC-08): Integrate shared memory layer + CodeRabbit fixes (#74)β
Unverified signature## Summary - SPEC-08: Shared memory layer integration - CodeRabbit critical fix: async add_evidence() with proper deduplication - Security: Fixed CVEs in langgraph-checkpoint and urllib3 - CI: Hardened to fail on security vulnerabilities - Docstrings: 80%+ coverage All 178 tests pass. No known vulnerabilities.e0c585c -
feat: Integrate LangGraph for enhanced research orchestrationβ
- Added LangGraph dependencies to pyproject.toml and uv.lock for improved state management and orchestration capabilities. - Implemented LangGraph-based orchestrator in src/orchestrators/langgraph_orchestrator.py, enabling structured research workflows. - Developed graph nodes and state management in src/agents/graph, including search, judge, and synthesis functionalities. - Updated app.py to support new "god" mode for advanced orchestration. - Enhanced documentation for active bugs and architectural gaps related to LangGraph integration. - Added unit and integration tests to ensure functionality and reliability of the new features.a820b5b -
refactor: Organize orchestrators into dedicated packageβ
Claude- Create src/orchestrators/ package with proper module structure - base.py: Shared protocols (SearchHandlerProtocol, JudgeHandlerProtocol) - simple.py: Basic search-judge loop orchestrator (was orchestrator.py) - advanced.py: Multi-agent MS Agent Framework orchestrator (was orchestrator_magentic.py) - hierarchical.py: Sub-iteration middleware orchestrator - factory.py: Factory pattern for orchestrator creation - __init__.py: Clean public API with facade pattern Design principles applied: - Single Responsibility (SRP): Each file has one clear job - Interface Segregation (ISP): Protocols in base.py - Factory Pattern (GoF): Centralized creation logic - Facade Pattern: Clean public imports via __init__.py All imports updated across: - src/app.py, src/agents/ - tests/unit/, tests/e2e/, tests/integration/ - examples/orchestrator_demo/ All 147 tests pass, linting and typecheck clean.e82d9c9 -
fix: implement SPEC_04 (Magentic UX) and SPEC_05 (cleanup)β
SPEC_04: - P0: Preserve chat history on timeout (app.py) - P1: Increase default timeout to 600s - P1: Add MAGENTIC_TIMEOUT env var config SPEC_05: - Delete empty src/orchestrator/ folder - Delete unused orchestrator_hierarchical.py (0% coverage) All 162 tests pass.cb46aac -
fix: simplify HSDD example to fix Gradio click issue (P2)β
The third example wasn't filling the chat box when clicked. Likely caused by parentheses in "HSDD (Hypoactive Sexual Desire Disorder)". Fix: Remove abbreviation and parentheses - just use full name. Also more readable since HSDD was getting cut off anyway.2ea01fd -
Merge pull request #62 from The-Obstacle-Is-The-Way/devβ
Unverified signaturefix: resolve all P0-P3 bugs (termination, streaming, thinking state)153a9c0 -
fix: remove duplicate backend line (CodeRabbit feedback)
dbe535c -
fix: P0/P1/P2 - Gradio crash, UX improvements, thinking state (#61)β
Unverified signature* fix: handle None parameters from Gradio example caching (P0) Root cause: Gradio passes None for missing example columns during startup caching, overriding Python default values. Line 131 called .strip() on None, crashing the HuggingFace Space. Fix: Add defensive None handling before .strip(): api_key_str = api_key or "" api_key_state_str = api_key_state or "" Added tests to prevent regression. * fix: multiple UX improvements (P1 bugs) 1. HSDD acronym spelled out (Hypoactive Sexual Desire Disorder) 2. Added loading indicator ("Processing...") for immediate feedback 3. Removed temperature settings from magentic agents for reasoning model compatibility (o3, o1 only support temperature=1) 4. Bug report documenting remaining issues (API key persistence) 140 tests passing. * fix: enhance UX with "thinking" state and API key persistence 1. Added a "thinking" state yield before blocking calls in Magentic orchestrator to improve user feedback during long processing times. 2. Upβ¦6b5e05b -
fix: enhance UX with "thinking" state and API key persistenceβ
1. Added a "thinking" state yield before blocking calls in Magentic orchestrator to improve user feedback during long processing times. 2. Updated Gradio examples to include explicit None values for API key inputs, ensuring persistence across example clicks. 3. Set temperature explicitly to 1.0 for compatibility with reasoning models in Magentic agents. All tests passing.3599f0a -
fix: multiple UX improvements (P1 bugs)β
1. HSDD acronym spelled out (Hypoactive Sexual Desire Disorder) 2. Added loading indicator ("Processing...") for immediate feedback 3. Removed temperature settings from magentic agents for reasoning model compatibility (o3, o1 only support temperature=1) 4. Bug report documenting remaining issues (API key persistence) 140 tests passing.5441526 -
fix: handle None parameters from Gradio example caching (P0)β
Root cause: Gradio passes None for missing example columns during startup caching, overriding Python default values. Line 131 called .strip() on None, crashing the HuggingFace Space. Fix: Add defensive None handling before .strip(): api_key_str = api_key or "" api_key_state_str = api_key_state or "" Added tests to prevent regression.29a6844 -
style: integrate CodeRabbit review feedbackβ
- Add @pytest.mark.unit to streaming fix tests - Simplify API key fallback: nested ternary β (x or y) or None - Clean up commented-out event handler code in app.py - Add language specifiers to markdown code blocks (text, bash) - Remove redundant fallback in judges.py _extract_key_findings All 138 tests passing.82503b1 -
fix: resolve P1 bugs (streaming UX + api key persistence) and update tests/docs
9006d69 -
fix: resolve streaming spam and API key persistence bugsβ
Bug 1 (Streaming Spam): - Add streaming buffer in app.py to accumulate tokens - Skip yield during streaming, flush on non-streaming events - Reduces O(NΒ²) to O(N) - one message instead of hundreds Bug 2 (API Key Persistence): - Add gr.State component to persist key across example clicks - Fallback logic: use textbox value, else state value - Key survives Gradio's additional_inputs reset behavior Tests: 138 passing (136 original + 2 new validation tests)0c9be4a -
fix: replace deprecated OpenAIModel with OpenAIChatModelβ
Update pydantic-ai imports to use OpenAIChatModel instead of the deprecated OpenAIModel class. Also adds Bug 3 (deprecation) and Bug 4 (asyncio GC errors) to the integration bug documentation. Files updated: - src/app.py: Import and type annotation - src/utils/llm_factory.py: Import and usage - docs/bugs/P1_MAGENTIC_STREAMING_AND_KEY_PERSISTENCE.md: Add 2 new bugs All 136 tests pass.c881895 -
fix: resolve all P0 critical bugs blocking demoβ
Bug 1 - Free Tier Quota Loop (P0): - Detect 402/quota errors in HFInferenceJudgeHandler - Return `sufficient=True` to stop loop gracefully - Show clear "Free Tier Quota Exceeded" message to user Bug 3 - API Key Not Passed to Advanced Mode (P0): - Add `api_key` parameter to `create_orchestrator()` - Pass to `MagenticOrchestrator.__init__()` - Create `OpenAIChatClient` with user's BYOK key Bug 4 - Singleton EmbeddingService Cross-Session Pollution (P0): - Remove singleton pattern from `get_embedding_service()` - Create unique ChromaDB collection per request (uuid) - Keep `SentenceTransformer` model shared for performance Bug 2 was caused by Bug 4 (dedup on polluted collection). All 135 tests pass. Demo is now functional.d1f91a4 -
fix(ui): clarify mode compatibility in radio button infoβ
Old: "β‘ Simple: Fast (Free/Any Key) | π¬ Advanced: Deep Multi-Agent (OpenAI Key Only)" New: "β‘ Simple: Free/OpenAI/Anthropic | π¬ Advanced: OpenAI only" Explicitly lists all supported backends for Simple mode so Anthropic users know they're not locked out.87feaa7 -
fix(ui): apply CodeRabbit review suggestionsβ
- Use ConfigurationError instead of ValueError for invalid API key - Add env var override for server_name with nosec B104 commentda82e7e -
docs: add UI/UX brainstorming for mode selectionβ
Documents current state after PR #58: - Anthropic key only works for Simple mode (no AnthropicChatClient) - Advanced mode requires OpenAI key (Magentic limitation) - Screenshot analysis showing current UI issues - Decision needed: remove Anthropic or keep?b16e7a5 -
fix(ui): remove empty API key column from examples table
41f9a2b -
fix(ui): simplify BYOK settings with auto-detectionβ
Removes api_provider dropdown and auto-detects provider from key prefix (sk- vs sk-ant-). Simplifies examples table and clarifies free tier messaging. Fixes #52, Fixes #536ea5a8b -
fix: remove css param not supported by ChatInterface
b4820c9 -
style: center header text in Gradio UI
1f163b3
-
rebrand: DeepCritical β DeepBoner (sexual health research agent)β
π AI-Native Sexual Health Research Agent - Package renamed: deepcritical β deepboner - New focus: sexual wellness, ED, hormone therapy, libido, reproductive health - Exception class: DeepCriticalError β DeepBonerError (with backwards compat) - UI examples updated for sexual health queries - Modal app renamed: deepboner-code-execution - Fixed pre-existing mypy issue (Modal API: uv_pip_install β pip_install) 46 files updated across: - Core: pyproject.toml, README.md, CLAUDE.md, AGENTS.md, GEMINI.md - Source: app.py, mcp_tools.py, exceptions.py, code_execution.py - Docs: ~25 markdown files - Examples: 8 demo scripts - Tests: exception tests updated All tests passing (102 passed, 6 skipped)5d12635 -
style: auto-format 4 files (ruff)
a805769
-
feat: implement dual-mode architecture (Simple + Advanced) (#45)β
Unverified signature* docs: add dual-mode architecture specification Senior agent reviewed and approved. Key documents: - 00_SITUATION_AND_PLAN.md: Problem analysis, branch states, recommended path - 01_ARCHITECTURE_SPEC.md: Dual-mode architecture (Simple + Advanced) - 02_IMPLEMENTATION_PHASES.md: 6-phase implementation plan - 03_IMMEDIATE_ACTIONS.md: Quick reference checklist Architecture: pydantic-ai (structured outputs) + Microsoft Agent Framework (orchestration) are COMPLEMENTARY, not competing. Dual-mode allows graceful degradation to free tier when no API keys available. * docs: add follow-up review request for senior agent verification * feat: implement dual-mode architecture (Simple + Advanced) Phase 1 - Pydantic-AI Improvements (Simple Mode): - Add HuggingFace provider support in judges.py with get_model() - Add huggingface_model and hf_token config fields - Tests in test_judges_factory.py Phase 2 - Orchestrator Factory: - Implement create_orchestrator() with auto-detection logic - Simple mβ¦b2929fc -
fix: address CodeRabbit feedbackβ
- Sort .env.example model keys alphabetically. - Narrow return type of create_demo() to gr.ChatInterface. - Confirmed embedding model vars are already wired in src/utils/config.py.be7e1a2 -
fix: repair Gradio accordion bug and cleanup env varsβ
- Unwrapped ChatInterface from gr.Blocks to fix settings accordion state (fixes P1_GRADIO_SETTINGS_CLEANUP). - Updated .env.example with missing variables and removed dead ones. - Updated documentation for the fix.fcc601a -
fix(magentic): defensive text extraction & cleanup biorxiv refsβ
Add _extract_text to fix ChatMessage object output bug. Update bioRxiv strings to Europe PMC. Add regression test.3bfd42c -
fix(config): increase max iterations to 10β
Addressed P0-004 by increasing default max_iterations from 5 to 10 to allow deep search loops to complete successfully.72b2667 -
refactor(tools): replace BioRxiv with Europe PMC (Phase 01)β
Replaced broken BioRxivTool with EuropePMCTool which supports keyword search. Updated all agents, MCP tools, and examples to use the new tool. Deleted legacy BioRxiv implementation.2f8ae1f -
refactor: enhance Gradio UI for improved user experienceβ
- Updated header to include a more descriptive title and streamlined text. - Enhanced chat interface with clearer example prompts and added settings accordion for configuration. - Improved footer to clarify research tool limitations and active MCP server connection. These changes aim to provide a more intuitive and informative interface for users interacting with the drug repurposing research agent.291b9e6 -
fix: simplify Gradio UI to fit single viewportβ
- Reduce header to 2 lines (title + one-line description) - Remove MCP Tools tabs UI (MCP server still active at /gradio_api/mcp/) - Simplify examples (just questions, no extra params shown) - Minimal footer with disclaimer and MCP endpoint - Remove unused mcp_tools imports from app.py This fixes the header cutoff issue in HuggingFace Spaces iframe by reducing total content to fit within standard viewport height.8dc3e50 -
fix: address CodeRabbit feedback and P0 blockersβ
Code Fixes (HIGH priority): - Add API key/provider validation to prevent silent auth failures - Fix hardcoded manager model in orchestrator_magentic.py (now uses settings.openai_model) - Add bounds checking to JSON extraction in judges.py (prevents IndexError) - Fix fragile test assertion in test_judges_hf.py Code Quality (MEDIUM priority): - Add explicit type annotation for models_to_try: list[str] - Fix structured logging (f-string β structured params) - Align fallback query count (3 queries) between handlers Test Improvements: - Add @pytest.mark.unit decorator to TestHFInferenceJudgeHandler Documentation Sync: - Update Phase 3 docs to match actual implementation: - __init__ signature (simplified, no inline imports) - _extract_json (string split with bounds checking) - _call_with_retry (tenacity decorator, asyncio.get_running_loop()) - assess method (simplified model loop) - Update Phase 4 docs with ChatInterface additional_inputs for BYOK All 104 tests pass.f985224 -
feat: implement HFInferenceJudgeHandler for free-tier AI analysisβ
Replace MockJudgeHandler with real AI analysis using HuggingFace Inference API: - Add HFInferenceJudgeHandler with chat_completion API - Model fallback chain: Llama 3.1 β Mistral β Zephyr (ungated) - Robust JSON extraction (handles markdown blocks, nested braces) - Tenacity retry with exponential backoff for rate limits - Fix app.py to use HF Inference when no paid API keys present Priority: User API key β Env API key β HF Inference (free) Hackathon judges now get real AI analysis without needing API keys. Set HF_TOKEN as Space secret for best model (Llama 3.1).7fab6d4
-
fix: disable ssr_mode to resolve intermittent gradio hydration issues
420d8ba -
fix: resolve Gradio UI cutoff by removing fill_height=True and restructuring layout
87de5ef -
fix: correct UI layout ordering - title at top
e4a1129 -
fix: move title/description into ChatInterface for proper HF Spaces layoutβ
Root cause: gr.Markdown above gr.ChatInterface with fill_height=True causes layout competition where ChatInterface consumes all viewport space, pushing the Markdown behind the HuggingFace banner. Solution: Use ChatInterface's native title/description parameters instead of a separate gr.Markdown block. This is the Gradio-intended pattern for full-height chat layouts. Investigation documented in docs/bugs/002_gradio_ui_investigation.md998d05d -
fix: upgrade Gradio SDK to 6.0.1 and add fill_height for HF Spaces UI fixβ
Root cause: HuggingFace Spaces was deploying with sdk_version 5.33.0, but the UI cutoff bug (top content hidden beneath HF banner) was fixed in Gradio 5.36 via PR #11427. Changes: - README.md: sdk_version "5.33.0" β "6.0.1" (latest stable) - src/app.py: Added fill_height=True to gr.Blocks() for proper layout - docs/bugs/001_gradio_ui_cutoff.md: Full investigation documentation Fixes #31 References: - https://github.com/gradio-app/gradio/issues/11417 - https://github.com/gradio-app/gradio/pull/11427f236de1 -
fix: address CodeRabbit review feedbackβ
- Move network reachability check to runtime in test_clinicaltrials.py (avoids 5s delay at test collection time) - Add explicit api_provider validation in app.py (raises ValueError for unsupported providers instead of silent fallback)923641c -
fix: use config settings for model names instead of hardcoded valuesβ
ClaudeUnverified signatureModel names in app.py were hardcoded to "gpt-4o" and "claude-sonnet-4-20250514". Now uses settings.openai_model and settings.anthropic_model from config, allowing model names to be configured via environment variables.f5747b1