Skip to content

Development#56

Merged
ChrisCoder9000 merged 19 commits intomainfrom
development
Apr 18, 2026
Merged

Development#56
ChrisCoder9000 merged 19 commits intomainfrom
development

Conversation

@ChrisCoder9000
Copy link
Copy Markdown
Contributor

@ChrisCoder9000 ChrisCoder9000 commented Apr 18, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added multi-language spaCy model support (English, Spanish, French, German, Chinese)
    • Enhanced plugin discovery system with validation capabilities
  • Bug Fixes

    • Improved spaCy model download reliability and error messaging
    • Enhanced serialization of graph operation results with truncation support
  • Improvements

    • Unified vector search API with simplified method calls
    • Updated API routing to disable automatic trailing-slash redirects

cursoragent and others added 19 commits March 27, 2026 08:10
Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
…tools

Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
…rovements-ab8a

Refactor agent configuration patterns and harden entity status handling
…rovements-baa3

Refactor graph operation handling and deduplicate Janitor graph tool
…uality-8861

Harden vector search usage and reduce retrieval duplication
…rovements-763e

Refactor plugin loading with reusable manifest catalog and safer entrypoint resolution
Kombu treats Redis ResponseError from BRPOP as fatal; when the broker
sends UNBLOCKED after a role change or failover, the worker crashed.
Monkey-patch Channel._brpop_read to disconnect and raise Empty so the
async hub can retry with a fresh connection.

Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
- Centralize supported model names in src/constants/spacy_models.py
- Dockerfile: download all distinct models during build so appuser can load
  languages (e.g. it) without writing to the venv
- Replace spacy.cli.download with subprocess so failed installs raise OSError
  instead of calling sys.exit
- FastAPI: set redirect_slashes=False to avoid 307 on /retrieve/context/

Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
…handling

Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
…ment

Co-authored-by: Christian <ChrisCoder9000@users.noreply.github.com>
@ChrisCoder9000 ChrisCoder9000 merged commit 12954cb into main Apr 18, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f04db5eb-b56c-4d89-93a2-b5619ddab49b

📥 Commits

Reviewing files that changed from the base of the PR and between 3c6c872 and e70342c.

📒 Files selected for processing (40)
  • Dockerfile
  • README.md
  • pyproject.toml
  • src/adapters/graph.py
  • src/adapters/graph_operation_result_serializer.py
  • src/adapters/interfaces/graph.py
  • src/constants/spacy_models.py
  • src/core/agents/architect_agent.py
  • src/core/agents/janitor_agent.py
  • src/core/agents/kg_agent.py
  • src/core/agents/tools/janitor_agent/JanitorAgentExecuteGraphOperationTool.py
  • src/core/agents/tools/janitor_agent/__init__.py
  • src/core/agents/tools/kg_agent/KGAgentAddTripletsTool.py
  • src/core/agents/tools/kg_agent/KGAgentExecuteGraphOperationTool.py
  • src/core/agents/tools/kg_agent/KGAgentSearchGraphTool.py
  • src/core/plugins/__init__.py
  • src/core/plugins/catalog.py
  • src/core/plugins/entrypoints.py
  • src/core/plugins/loader.py
  • src/core/plugins/manager.py
  • src/core/search/entity_context.py
  • src/core/search/entity_info.py
  • src/core/search/entity_sibilings.py
  • src/lib/neo4j/client.py
  • src/services/api/app.py
  • src/services/api/constants/requests.py
  • src/services/api/controllers/entities.py
  • src/services/api/controllers/kg.py
  • src/services/api/controllers/retrieve.py
  • src/services/mcp/main.py
  • src/utils/nlp/spacy.py
  • src/utils/vector_search.py
  • src/workers/app.py
  • src/workers/kombu_redis_patch.py
  • tests/test_agent_configuration_patterns.py
  • tests/test_architecture_refactors.py
  • tests/test_kombu_redis_patch.py
  • tests/test_plugin_refactors.py
  • tests/test_spacy_fixes_verification.py
  • tests/test_static_hardening_refactors.py

📝 Walkthrough

Walkthrough

This PR refactors core architectural components including graph operation result serialization, agent system prompt resolution, plugin discovery/loading infrastructure, and introduces a vector search facade abstraction. It also updates project version to 2.11.5-dev, dynamizes Docker spaCy model downloads, adds Redis patch for Celery workers, and configures FastAPI to disable automatic slash redirection.

Changes

Cohort / File(s) Summary
Version Management
README.md, pyproject.toml, Dockerfile
Updated package version from 2.10.4-dev to 2.11.5-dev across metadata files; Docker now dynamically downloads spaCy models via SPACY_MODEL_NAMES constant instead of hardcoded en_core_web_sm.
Graph Operation Result Serialization
src/adapters/graph.py, src/adapters/graph_operation_result_serializer.py, src/adapters/interfaces/graph.py, src/lib/neo4j/client.py
Introduced GraphOperationResultSerializer chain-of-responsibility pattern to normalize diverse graph operation results (None, strings, Neo4j records, JSON) into serialized strings; updated GraphAdapter.execute_operation() and abstract interface to return Any instead of str and apply serialization post-processing.
Agent System Prompt Resolution
src/core/agents/architect_agent.py, src/core/agents/janitor_agent.py, src/core/agents/kg_agent.py
Refactored inline system-prompt branching into _SYSTEM_PROMPT_BUILDERS dispatch mappings; introduced validation/normalization helpers (_resolve_system_prompt, _resolve_response_format, _normalize_schema) to centralize prompt/format selection logic across all agents.
Janitor Tool Consolidation
src/core/agents/tools/janitor_agent/JanitorAgentExecuteGraphOperationTool.py, src/core/agents/tools/janitor_agent/__init__.py
Made JanitorAgentExecuteGraphOperationTool inherit from JanitorAgentExecuteGraphReadOperationTool (empty subclass); removed duplicate tool definition and export from public API.
Plugin Discovery & Loading Refactoring
src/core/plugins/catalog.py, src/core/plugins/entrypoints.py, src/core/plugins/loader.py, src/core/plugins/manager.py, src/core/plugins/__init__.py
Extracted manifest discovery into PluginManifestCatalog, entry-point resolution into PluginEntryPointResolver; consolidated PluginLoader and PluginManager to use these new components, reducing duplication and improving testability.
Vector Search Facade Introduction
src/utils/vector_search.py
Introduced VectorSearchFacade providing search_nodes/search_triplets/search_relationships/search_data convenience methods wrapping VectorStoreAdapter.search_vectors with named parameters to reduce call-site complexity.
Vector Search Facade Integration
src/core/search/entity_context.py, src/core/search/entity_info.py, src/core/search/entity_sibilings.py, src/services/api/controllers/entities.py, src/services/api/controllers/kg.py, src/services/api/controllers/retrieve.py, src/services/mcp/main.py, src/core/agents/tools/kg_agent/KGAgentAddTripletsTool.py, src/core/agents/tools/kg_agent/KGAgentSearchGraphTool.py
Updated all vector search call sites to route through VectorSearchFacade methods (e.g., search_nodes(...) instead of search_vectors(..., store="nodes", ...)), normalizing parameter passing and decoupling store-selection logic.
spaCy Model Management
src/constants/spacy_models.py, src/utils/nlp/spacy.py
Moved language-to-model mappings into SPACY_MODEL_NAMES constant; refactored SpacyManager to always use subprocess-based python -m spacy download with explicit error handling, removing conditional dynamic import fallback.
Graph Operation Tool Refactoring
src/core/agents/tools/kg_agent/KGAgentExecuteGraphOperationTool.py
Removed _serialize_response method; updated _run to return raw result from execute_operation instead of applying custom serialization (delegated to adapter layer via new GraphOperationResultSerializer).
API Configuration & Response Models
src/services/api/app.py, src/services/api/constants/requests.py
Added redirect_slashes=False to FastAPI initialization; made GetEntityStatusResponse.node optional (Optional[Node] = None).
Worker Redis Patch
src/workers/kombu_redis_patch.py, src/workers/app.py
Introduced patch for Kombu Redis channel to handle forced unblock errors by converting UNBLOCKED response errors to queue.Empty exceptions with connection cleanup; applied patch at worker app startup.
Architecture & Verification Tests
tests/test_agent_configuration_patterns.py, tests/test_architecture_refactors.py, tests/test_kombu_redis_patch.py, tests/test_plugin_refactors.py, tests/test_spacy_fixes_verification.py, tests/test_static_hardening_refactors.py
Added comprehensive static/unit tests validating agent prompt builders, graph result serialization behavior, vector facade routing, plugin discovery/loading, spaCy integration, and architecture compliance across the refactored components.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • Development #40 — Both PRs refactor plugin discovery and loading infrastructure, introducing PluginManifestCatalog, PluginEntryPointResolver, and updating PluginLoader/PluginManager with the same new components.
  • Development #23 — Both PRs modify agent implementation files (architect_agent.py, janitor_agent.py, kg_agent.py) to add system-prompt resolution and mode-driven prompt/tool handling.
  • Featured graph consolidation layer (5th agent) #6 — Both PRs introduce graph operation result serialization, update graph adapter/Neo4j client return types to Any, and implement vector search facade abstraction across multiple controller/service modules.

Poem

🐰 With prompts now mapped and plugins refined,
Graph results serialized, facades aligned,
The vector search glides through each refactored hall,
A spaCy hop, a janitor's unification call—
Version 2.11.5 hops forward, fresh and bright! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch development

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Pylint (4.0.5)
src/constants/spacy_models.py

************* Module .pylintrc
.pylintrc:1:0: F0011: error while parsing the configuration: Source contains parsing errors: '.pylintrc'
[line 18]: 'C0103' (config-parse-error)
[
{
"type": "convention",
"module": "src.constants.spacy_models",
"obj": "",
"line": 1,
"column": 0,
"endLine": null,
"endColumn": null,
"path": "src/constants/spacy_models.py",
"symbol": "missing-module-docstring",
"message": "Missing module docstring",
"message-id": "C0114"
}
]

src/adapters/graph_operation_result_serializer.py

************* Module .pylintrc
.pylintrc:1:0: F0011: error while parsing the configuration: Source contains parsing errors: '.pylintrc'
[line 18]: 'C0103' (config-parse-error)
[
{
"type": "convention",
"module": "src.adapters.graph_operation_result_serializer",
"obj": "",
"line": 1,
"column": 0,
"endLine": null,
"endColumn": null,
"path": "src/adapters/graph_operation_result_serializer.py",
"symbol": "missing-module-docstring",
"message": "Missing module docstring",
"message-id": "C0114"
},
{
"type": "convention",
"module": "src.adapters.graph_operation_result_serializer",
"obj": "GraphOperationResultSerializer",
"line": 6,
"column": 0,
"endLine": 6,
"endColumn": 36,
"path": "src/adapters/graph_operation_result_serializer.py",
"symbol": "missing-class-docstring",
"message": "Missing class docstring",

... [truncated 5492 characters] ...

 "obj": "GraphOperationResultSerializerChain",
    "line": 81,
    "column": 0,
    "endLine": 81,
    "endColumn": 41,
    "path": "src/adapters/graph_operation_result_serializer.py",
    "symbol": "too-few-public-methods",
    "message": "Too few public methods (1/2)",
    "message-id": "R0903"
},
{
    "type": "convention",
    "module": "src.adapters.graph_operation_result_serializer",
    "obj": "serialize_graph_operation_result",
    "line": 106,
    "column": 0,
    "endLine": 106,
    "endColumn": 36,
    "path": "src/adapters/graph_operation_result_serializer.py",
    "symbol": "missing-function-docstring",
    "message": "Missing function or method docstring",
    "message-id": "C0116"
}

]

src/adapters/interfaces/graph.py

************* Module .pylintrc
.pylintrc:1:0: F0011: error while parsing the configuration: Source contains parsing errors: '.pylintrc'
[line 18]: 'C0103' (config-parse-error)
[
{
"type": "convention",
"module": "src.adapters.interfaces.graph",
"obj": "",
"line": 309,
"column": 0,
"endLine": null,
"endColumn": null,
"path": "src/adapters/interfaces/graph.py",
"symbol": "line-too-long",
"message": "Line too long (152/100)",
"message-id": "C0301"
},
{
"type": "convention",
"module": "src.adapters.interfaces.graph",
"obj": "",
"line": 399,
"column": 0,
"endLine": null,
"endColumn": null,
"path": "src/adapters/interfaces/graph.py",
"symbol": "line-too-long",
"message": "Line too long (106/100)",
"message-id": "C0301"
},
{
"type": "convention",
"module": "src.adapters.interfaces.gr

... [truncated 9788 characters] ...

},
{
"type": "warning",
"module": "src.adapters.interfaces.graph",
"obj": "GraphClient.list_relationships",
"line": 500,
"column": 8,
"endLine": 500,
"endColumn": 19,
"path": "src/adapters/interfaces/graph.py",
"symbol": "redefined-builtin",
"message": "Redefining built-in 'object'",
"message-id": "W0622"
},
{
"type": "refactor",
"module": "src.adapters.interfaces.graph",
"obj": "GraphClient",
"line": 31,
"column": 0,
"endLine": 31,
"endColumn": 17,
"path": "src/adapters/interfaces/graph.py",
"symbol": "too-many-public-methods",
"message": "Too many public methods (35/20)",
"message-id": "R0904"
}
]

  • 33 others

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.

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