docs: sync README files with latest repo state#139
Conversation
📝 WalkthroughWalkthroughDocumentation updates across server README files clarify embedding provider routing through shared daemon services with fallback, per-interaction content slicing with token limits, and tool-usage prefixing behavior in interaction history formatting. ChangesServer and service documentation updates
🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@reflexio/server/README.md`:
- Line 226: The README description is inaccurate: update the bullet for
service_utils.py to state that format_interactions_to_history_string() slices
interaction.content using REFLEXIO_MAX_INTERACTION_CONTENT_TOKENS via
_resolve_max_interaction_content_tokens() and inserts a truncation marker when
content is sliced, and clarify that the “[used tool: ...]” prefix is conditional
(added only when interaction.content is truthy and interaction.tools_used
exists) rather than always prepended; mention that tool-only turns in tests
include non-empty placeholder content so the marker line still appears.
In `@reflexio/server/services/README.md`:
- Around line 45-46: Update the README paragraph to reflect the actual routing
logic: state that LiteLLMClient.get_embedding() chooses between calling
embedding_service_provider.get_service_embeddings() (HTTP/shared daemon) and the
in-process LocalEmbedder based on
embedding_provider_mode()/should_use_embedding_service(); clarify that daemon
selection requires the daemon /health probe to report a matching active_model
and healthy status, and that setting CLAUDE_SMART_USE_LOCAL_EMBEDDING=1 or
REFLEXIO_EMBEDDING_PROVIDER=local_service|internal_service bypasses the
probe—when bypassed the code may raise EmbeddingUnavailableError instead of
falling back to the in-process embedder.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2e6207c4-fdb2-404b-aff4-f25c342bb48c
📒 Files selected for processing (2)
reflexio/server/README.mdreflexio/server/services/README.md
| - `operation_state_utils.py`: Centralized `OperationStateManager` for all `_operation_state` table interactions (progress tracking, concurrency locks, extractor/aggregator bookmarks, simple locks) | ||
| - `deduplication_utils.py`: Shared utilities for LLM-based deduplication (used by ProfileDeduplicator and PlaybookConsolidator) | ||
| - `service_utils.py`: Utilities (`construct_messages_from_interactions()`, `format_interactions_to_history_string()` (prepends tool usage info when `tools_used` is present), `extract_json_from_string()`, `log_model_response()` for colored LLM response logging) | ||
| - `service_utils.py`: Utilities (`construct_messages_from_interactions()`, `format_interactions_to_history_string()` (prepends tool usage info and slices long interaction content via `REFLEXIO_MAX_INTERACTION_CONTENT_TOKENS`), `extract_json_from_string()`, `log_model_response()` for colored LLM response logging) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify format_interactions_to_history_string implementation
# Find the function definition
ast-grep --pattern $'def format_interactions_to_history_string($$$) {
$$$
}'
# Search for tool usage prepending logic
rg -nP 'format_interactions_to_history_string|tool.?usage.*prepend|prepend.*tool' --type=py -C5
# Verify REFLEXIO_MAX_INTERACTION_CONTENT_TOKENS usage
rg -nP 'REFLEXIO_MAX_INTERACTION_CONTENT_TOKENS' --type=py -C3
# Check service_utils.py specifically
fd -t f 'service_utils.py' reflexio/server/services --exec cat {}Repository: ReflexioAI/reflexio
Length of output: 50377
Fix the README behavioral wording for tool prefixes and confirm slicing.
format_interactions_to_history_string() slices interaction.content using REFLEXIO_MAX_INTERACTION_CONTENT_TOKENS via _resolve_max_interaction_content_tokens() (and inserts the truncation marker when over budget); this matches the slicing claim.
Tool-usage “prepending” is conditional: the [used tool: ...] prefix is added only when interaction.content is truthy and interaction.tools_used is present. The tests show tool-only turns are expected to carry non-empty placeholder content (e.g., "(tool call)") so the marker line is still emitted—so the “always prepends” phrasing in the description should be qualified.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@reflexio/server/README.md` at line 226, The README description is inaccurate:
update the bullet for service_utils.py to state that
format_interactions_to_history_string() slices interaction.content using
REFLEXIO_MAX_INTERACTION_CONTENT_TOKENS via
_resolve_max_interaction_content_tokens() and inserts a truncation marker when
content is sliced, and clarify that the “[used tool: ...]” prefix is conditional
(added only when interaction.content is truthy and interaction.tools_used
exists) rather than always prepended; mention that tool-only turns in tests
include non-empty placeholder content so the marker line still appears.
| Embedding requests leave the service layer through `llm/litellm_client.py`; local models (`local/minilm-l6-v2`, `local/nomic-embed-v1.5`) are routed by `llm/providers/embedding_service_provider.py` to the shared embedding daemon when reachable, otherwise to the in-process embedder. | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify embedding routing from service layer through LiteLLM client
# Check litellm_client.py for embedding delegation
fd -t f 'litellm_client.py' reflexio/server/llm --exec rg -nP 'get_embedding|embed' {} -C5
# Verify embedding_service_provider.py routing logic
fd -t f 'embedding_service_provider.py' --exec cat {}
# Confirm model name examples are documented or used
rg -nP 'minilm-l6-v2|nomic-embed-v1\.5|local/minilm|local/nomic' --type=py -C2
# Check daemon fallback logic
rg -nP 'daemon.*reachable|embedding.*daemon.*fall|in-process.*embedder' --type=py -C3Repository: ReflexioAI/reflexio
Length of output: 50375
Align README embedding routing paragraph with actual provider mode logic
- The routing described is consistent with the implementation:
LiteLLMClient.get_embedding()decides between the HTTP embedding service (embedding_service_provider.get_service_embeddings()) and the in-process local embedder (LocalEmbedder) based onembedding_provider_mode()/should_use_embedding_service(). - The model examples
local/minilm-l6-v2andlocal/nomic-embed-v1.5are valid (they’re referenced by the provider-mode logic and covered by tests). - The daemon/fallback behavior in the README is accurate for the default “model-driven” routing, but the docs should also mention that daemon selection depends on the daemon health probe’s
/healthresponse (includingactive_modelmatch), and that settingCLAUDE_SMART_USE_LOCAL_EMBEDDING=1orREFLEXIO_EMBEDDING_PROVIDER=local_service/internal_servicebypasses the probe and can raiseEmbeddingUnavailableErrorinstead of falling back to in-process.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@reflexio/server/services/README.md` around lines 45 - 46, Update the README
paragraph to reflect the actual routing logic: state that
LiteLLMClient.get_embedding() chooses between calling
embedding_service_provider.get_service_embeddings() (HTTP/shared daemon) and the
in-process LocalEmbedder based on
embedding_provider_mode()/should_use_embedding_service(); clarify that daemon
selection requires the daemon /health probe to report a matching active_model
and healthy status, and that setting CLAUDE_SMART_USE_LOCAL_EMBEDDING=1 or
REFLEXIO_EMBEDDING_PROVIDER=local_service|internal_service bypasses the
probe—when bypassed the code may raise EmbeddingUnavailableError instead of
falling back to the in-process embedder.
Summary
REFLEXIO_MAX_INTERACTION_CONTENT_TOKENSin the service-layer maps.Repositories/submodules reviewed
yyiilluu/reflexio-enterpriseReflexioAI/reflexioREADME files updated
reflexio/server/README.mdreflexio/server/services/README.mdValidation
git diff --checkNotes/Risks
/root/reflexio-enterprise/how_to_write_readme.mdand are limited to model-facing code-map README files.Summary by CodeRabbit
Documentation
cloud,local_service,internal_service,inprocess, andoff.