feat: 2.1.1 release#167
Conversation
WalkthroughThis update introduces a comprehensive overhaul of Honcho's reasoning, summarization, and configuration systems. It refactors queue payloads, deriver task handling, session context retrieval, and summary management for improved modularity and accuracy. Rich console logging replaces markdown-based logs. Extensive new test harnesses and JSON-based integration tests are added, alongside new configuration options for query generation, Langfuse integration, and token limits. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
participant Deriver
participant DB
participant LLM
participant EmbeddingStore
Client->>API: POST /sessions/{session_id}/messages
API->>DB: Save message
API->>Deriver: Enqueue summary/representation tasks (payloads)
Deriver->>DB: Fetch message, session, peer info
Deriver->>LLM: Summarize if needed (if summary task)
Deriver->>EmbeddingStore: Save observations (if representation task)
Deriver->>LLM: Reason over context/history (if representation task)
Deriver->>DB: Save working representation
Deriver-->>API: Task complete
Client->>API: POST /peers/chat (query)
API->>DB: Retrieve working representation, context, recent history
API->>EmbeddingStore: Semantic search for additional context
API->>LLM: Generate response with prompt (includes context/history)
API-->>Client: Stream or return response
Estimated code review effort🎯 5 (Critical) | ⏱️ ~90+ minutes
Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation - BetaCodeRabbit's unit test generation is now available in Beta! Automatically generate comprehensive unit tests for your code changes, ensuring better test coverage and catching edge cases you might miss. Our AI analyzes your code structure and creates tests that follow best practices and your project's testing patterns. Learn more here, or just try it under ✨ Finishing Touches. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 38
🔭 Outside diff range comments (3)
src/deriver/queue_payload.py (1)
38-119: Consider extracting validation logic to reduce complexity.The
create_payloadfunction is thorough but complex. Consider extracting validation into separate methods:def _validate_base_fields(message: dict[str, Any]) -> tuple[str, str, int]: """Validate and extract base fields common to all payloads.""" workspace_name = message.get("workspace_name") session_name = message.get("session_name") message_id = message.get("message_id") if not isinstance(workspace_name, str): raise TypeError("Workspace name must be a string") if not isinstance(session_name, str): raise TypeError("Session name must be a string") if not isinstance(message_id, int): raise TypeError("Message ID must be an integer") return workspace_name, session_name, message_id def _validate_representation_fields( message: dict[str, Any], sender_name: str | None, target_name: str | None, ) -> tuple[str, datetime]: """Validate fields specific to representation tasks.""" content = message.get("content") created_at = message.get("created_at") if not isinstance(content, str): raise TypeError("Message content must be a string") if not isinstance(created_at, datetime): raise TypeError("created_at must be a datetime object") if sender_name is None: raise ValueError("sender_name is required for representation tasks") if target_name is None: raise ValueError("target_name is required for representation tasks") return content, created_atThis would make the main function more readable and testable.
src/utils/summarizer.py (1)
63-72: Add explicit return-type annotationsRuff flags ANN202 because
create_short_summary/create_long_summarylack a return type.
Even with the@honcho_llm_calldecorator, the function body still returns astr(the prompt).
Add-> str(or a dedicatedPromptalias) to silence lint and improve IDE assistance.Also applies to: 100-109
src/deriver/deriver.py (1)
489-497: Parameter type too narrow
reasoner.reason()passes aReasoningResponseWithThinkingasoriginal_context, but the annotation here isReasoningResponse.
Either widen the type hint or strip thethinkingfield beforehand to satisfy the contract:-async def _save_new_observations( - self, - original_context: ReasoningResponse, +async def _save_new_observations( + self, + original_context: ReasoningResponse | ReasoningResponseWithThinking,This keeps static type-checkers happy and avoids accidental misuse.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (50)
.env.template(2 hunks)CHANGELOG.md(1 hunks)README.md(1 hunks)config.toml.example(2 hunks)docs/changelog/compatibility-guide.mdx(2 hunks)docs/changelog/introduction.mdx(2 hunks)docs/docs.json(1 hunks)docs/v2/contributing/configuration.mdx(8 hunks)docs/v2/documentation/core-concepts/architecture.mdx(1 hunks)docs/v2/documentation/core-concepts/glossary.mdx(1 hunks)docs/v2/documentation/reference/guided-tutorial.mdx(1 hunks)docs/v2/documentation/reference/sdk.mdx(2 hunks)docs/v2/guides/file-uploads.mdx(0 hunks)docs/v2/openapi.documented.yml(56 hunks)pyproject.toml(2 hunks)scripts/update_version.py(1 hunks)src/config.py(3 hunks)src/crud/__init__.py(2 hunks)src/crud/document.py(2 hunks)src/crud/message.py(2 hunks)src/crud/session.py(2 hunks)src/deriver/__main__.py(1 hunks)src/deriver/consumer.py(1 hunks)src/deriver/deriver.py(9 hunks)src/deriver/enqueue.py(9 hunks)src/deriver/logging.py(0 hunks)src/deriver/queue_manager.py(4 hunks)src/deriver/queue_payload.py(1 hunks)src/dialectic/chat.py(6 hunks)src/dialectic/prompts.py(4 hunks)src/dialectic/utils.py(5 hunks)src/main.py(1 hunks)src/routers/messages.py(2 hunks)src/routers/sessions.py(2 hunks)src/utils/clients.py(8 hunks)src/utils/embedding_store.py(9 hunks)src/utils/filter.py(1 hunks)src/utils/formatting.py(3 hunks)src/utils/logging.py(1 hunks)src/utils/summarizer.py(9 hunks)tests/bench/README.md(1 hunks)tests/bench/harness.py(1 hunks)tests/bench/run_tests.py(1 hunks)tests/bench/tests/3player.json(1 hunks)tests/bench/tests/contradict1.json(1 hunks)tests/bench/tests/summary_and_query.json(1 hunks)tests/bench/tests/summary_trivial.json(1 hunks)tests/bench/tests/trivial.json(1 hunks)tests/bench/tests/trivial_session_scoped.json(1 hunks)tests/integration/test_enqueue.py(4 hunks)
💤 Files with no reviewable changes (2)
- docs/v2/guides/file-uploads.mdx
- src/deriver/logging.py
🧰 Additional context used
📓 Path-based instructions (5)
src/**/*.py
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/**/*.py: Follow isort conventions with absolute imports preferred
snake_case for variables/functions; PascalCase for classes
Line length: 88 chars (Black compatible)
Explicit error handling with appropriate exception types
Docstrings: Use Google style docstrings
Use environment variables via python-dotenv (.env)
Use specific exception types (ResourceNotFoundException, ValidationException, etc.)
Proper logging with context instead of print statements
Files:
src/main.pysrc/crud/__init__.pysrc/deriver/__main__.pysrc/routers/messages.pysrc/crud/session.pysrc/utils/filter.pysrc/deriver/consumer.pysrc/crud/document.pysrc/utils/formatting.pysrc/config.pysrc/routers/sessions.pysrc/deriver/queue_payload.pysrc/dialectic/prompts.pysrc/crud/message.pysrc/dialectic/utils.pysrc/deriver/queue_manager.pysrc/dialectic/chat.pysrc/utils/clients.pysrc/utils/summarizer.pysrc/deriver/enqueue.pysrc/utils/logging.pysrc/utils/embedding_store.pysrc/deriver/deriver.py
src/main.py
📄 CodeRabbit Inference Engine (CLAUDE.md)
Global exception handlers defined in main.py
Files:
src/main.py
src/routers/**/*.py
📄 CodeRabbit Inference Engine (CLAUDE.md)
API routes must follow the pattern: /v1/{resource}/{id}/{action}
Files:
src/routers/messages.pysrc/routers/sessions.py
src/routers/messages.py
📄 CodeRabbit Inference Engine (CLAUDE.md)
Batch message creation supports up to 100 messages
Files:
src/routers/messages.py
tests/**/*.py
📄 CodeRabbit Inference Engine (CLAUDE.md)
Tests in pytest with fixtures in tests/conftest.py
Files:
tests/integration/test_enqueue.pytests/bench/harness.pytests/bench/run_tests.py
🧠 Learnings (24)
📓 Common learnings
Learnt from: Rajat-Ahuja1997
PR: plastic-labs/honcho#131
File: src/crud.py:503-505
Timestamp: 2025-06-18T14:50:59.967Z
Learning: The Honcho project prefers upsert behavior for update operations across all resources (sessions, peers, workspaces). Update operations should create the resource if it doesn't exist rather than failing fast. This is an explicit design decision that differs from typical REST semantics but provides a more forgiving API experience.
README.md (2)
Learnt from: VVoruganti
PR: #115
File: README.md:393-396
Timestamp: 2025-05-29T16:27:13.808Z
Learning: CONTRIBUTING.md exists at the repository root in the Honcho project and contains a comprehensive contributing guide. Automated verification scripts can sometimes fail to detect existing files, so manual verification may be needed when users dispute automated findings.
Learnt from: Rajat-Ahuja1997
PR: #131
File: src/crud.py:503-505
Timestamp: 2025-06-18T14:50:59.967Z
Learning: The Honcho project prefers upsert behavior for update operations across all resources (sessions, peers, workspaces). Update operations should create the resource if it doesn't exist rather than failing fast. This is an explicit design decision that differs from typical REST semantics but provides a more forgiving API experience.
docs/changelog/compatibility-guide.mdx (1)
Learnt from: Rajat-Ahuja1997
PR: #131
File: src/crud.py:503-505
Timestamp: 2025-06-18T14:50:59.967Z
Learning: The Honcho project prefers upsert behavior for update operations across all resources (sessions, peers, workspaces). Update operations should create the resource if it doesn't exist rather than failing fast. This is an explicit design decision that differs from typical REST semantics but provides a more forgiving API experience.
src/crud/__init__.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/routers/messages.py : Batch message creation supports up to 100 messages
pyproject.toml (1)
Learnt from: VVoruganti
PR: #115
File: README.md:393-396
Timestamp: 2025-05-29T16:27:13.808Z
Learning: CONTRIBUTING.md exists at the repository root in the Honcho project and contains a comprehensive contributing guide. Automated verification scripts can sometimes fail to detect existing files, so manual verification may be needed when users dispute automated findings.
docs/v2/documentation/reference/sdk.mdx (2)
Learnt from: Rajat-Ahuja1997
PR: #131
File: src/crud.py:503-505
Timestamp: 2025-06-18T14:50:59.967Z
Learning: The Honcho project prefers upsert behavior for update operations across all resources (sessions, peers, workspaces). Update operations should create the resource if it doesn't exist rather than failing fast. This is an explicit design decision that differs from typical REST semantics but provides a more forgiving API experience.
Learnt from: dr-frmr
PR: #131
File: src/routers/sessions.py:206-213
Timestamp: 2025-06-18T20:42:06.458Z
Learning: The get_or_create_session function in this codebase is designed to handle both session creation and adding peers to existing sessions. When called with peers, it will add those peers to an existing session rather than creating a duplicate session.
src/deriver/__main__.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/**/*.py : Proper logging with context instead of print statements
src/routers/messages.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/routers/messages.py : Batch message creation supports up to 100 messages
src/crud/session.py (7)
Learnt from: dr-frmr
PR: #131
File: src/routers/sessions.py:206-213
Timestamp: 2025-06-18T20:42:06.458Z
Learning: The get_or_create_session function in this codebase is designed to handle both session creation and adding peers to existing sessions. When called with peers, it will add those peers to an existing session rather than creating a duplicate session.
Learnt from: Rajat-Ahuja1997
PR: #131
File: migrations/versions/d429de0e5338_adopt_peer_paradigm.py:918-942
Timestamp: 2025-06-19T14:32:02.934Z
Learning: The queue and active_queue_sessions tables in the migration script migrations/versions/d429de0e5338_adopt_peer_paradigm.py are expected to remain small, so per-row updates are acceptable and performance optimizations like set-based updates are not necessary.
Learnt from: Rajat-Ahuja1997
PR: #131
File: migrations/versions/d429de0e5338_adopt_peer_paradigm.py:36-77
Timestamp: 2025-06-19T14:07:32.309Z
Learning: The migration script migrations/versions/d429de0e5338_adopt_peer_paradigm.py properly handles foreign key constraints during table updates by explicitly dropping foreign key constraints before making schema changes, preventing constraint violations during the migration process.
Learnt from: Rajat-Ahuja1997
PR: #131
File: migrations/versions/d429de0e5338_adopt_peer_paradigm.py:188-194
Timestamp: 2025-06-18T15:58:51.202Z
Learning: In the migration file migrations/versions/d429de0e5338_adopt_peer_paradigm.py, the team has explicitly decided to accept SQL injection risks from f-string interpolation of schema names, despite the security concerns around DDL injection via the DATABASE_SCHEMA environment variable.
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/models.py : All tables use text IDs (nanoid format) as primary keys
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/models.py : Feature flags on workspace, peer, and session levels
Learnt from: Rajat-Ahuja1997
PR: #131
File: src/crud.py:503-505
Timestamp: 2025-06-18T14:50:59.967Z
Learning: The Honcho project prefers upsert behavior for update operations across all resources (sessions, peers, workspaces). Update operations should create the resource if it doesn't exist rather than failing fast. This is an explicit design decision that differs from typical REST semantics but provides a more forgiving API experience.
src/utils/filter.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/models.py : JSONB metadata fields for extensibility
tests/integration/test_enqueue.py (2)
Learnt from: Rajat-Ahuja1997
PR: #131
File: migrations/versions/d429de0e5338_adopt_peer_paradigm.py:918-942
Timestamp: 2025-06-19T14:32:02.934Z
Learning: The queue and active_queue_sessions tables in the migration script migrations/versions/d429de0e5338_adopt_peer_paradigm.py are expected to remain small, so per-row updates are acceptable and performance optimizations like set-based updates are not necessary.
Learnt from: Rajat-Ahuja1997
PR: #131
File: tests/routes/test_messages.py:7-39
Timestamp: 2025-06-18T15:47:44.327Z
Learning: In FastAPI tests, it's common to use @pytest.mark.asyncio with a synchronous TestClient. The async marker is used when tests contain async database operations (like await db_session.commit()), but the HTTP client calls (client.post(), client.get()) should NOT be awaited since TestClient is synchronous. Only the actual async operations like database commits need awaiting.
tests/bench/README.md (1)
Learnt from: VVoruganti
PR: #115
File: README.md:393-396
Timestamp: 2025-05-29T16:27:13.808Z
Learning: CONTRIBUTING.md exists at the repository root in the Honcho project and contains a comprehensive contributing guide. Automated verification scripts can sometimes fail to detect existing files, so manual verification may be needed when users dispute automated findings.
docs/changelog/introduction.mdx (1)
Learnt from: Rajat-Ahuja1997
PR: #131
File: src/crud.py:503-505
Timestamp: 2025-06-18T14:50:59.967Z
Learning: The Honcho project prefers upsert behavior for update operations across all resources (sessions, peers, workspaces). Update operations should create the resource if it doesn't exist rather than failing fast. This is an explicit design decision that differs from typical REST semantics but provides a more forgiving API experience.
src/config.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/models.py : Feature flags on workspace, peer, and session levels
src/routers/sessions.py (2)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/utils/history.py : Session history summarization: short every 20 messages, long every 60
Learnt from: Rajat-Ahuja1997
PR: #131
File: tests/routes/test_messages.py:7-39
Timestamp: 2025-06-18T15:47:44.327Z
Learning: In FastAPI tests, it's common to use @pytest.mark.asyncio with a synchronous TestClient. The async marker is used when tests contain async database operations (like await db_session.commit()), but the HTTP client calls (client.post(), client.get()) should NOT be awaited since TestClient is synchronous. Only the actual async operations like database commits need awaiting.
docs/v2/contributing/configuration.mdx (4)
Learnt from: VVoruganti
PR: #115
File: src/config.py:68-77
Timestamp: 2025-05-28T22:30:23.218Z
Learning: In the Honcho project's configuration system (src/config.py), the intended precedence order for configuration values is: Environment variables (highest) > .env files > TOML config files > Default values (lowest). Environment variables and .env files should override TOML values to allow for deployment-time configuration overrides.
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/**/*.py : Use environment variables via python-dotenv (.env)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/models.py : Feature flags on workspace, peer, and session levels
Learnt from: Rajat-Ahuja1997
PR: #166
File: migrations/versions/05486ce795d5_make_session_name_required_on_messages.py:60-114
Timestamp: 2025-07-21T20:57:42.135Z
Learning: Peer names in the Honcho codebase are restricted to the pattern r"^[a-zA-Z0-9_-]+$" (same as session names), which prevents SQL injection and JSON syntax errors when peer names are interpolated into SQL queries and JSON strings during migrations.
src/crud/message.py (4)
Learnt from: dr-frmr
PR: #131
File: src/routers/sessions.py:206-213
Timestamp: 2025-06-18T20:42:06.458Z
Learning: The get_or_create_session function in this codebase is designed to handle both session creation and adding peers to existing sessions. When called with peers, it will add those peers to an existing session rather than creating a duplicate session.
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/routers/messages.py : Batch message creation supports up to 100 messages
Learnt from: dr-frmr
PR: #131
File: tests/test_schema_validations.py:76-80
Timestamp: 2025-06-17T21:40:26.817Z
Learning: In the MessageCreate schema, peer_name is the actual field name with "peer_id" as an alias, so when constructing MessageCreate(peer_id="value"), it sets the peer_name attribute to "value".
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/models.py : Feature flags on workspace, peer, and session levels
src/dialectic/utils.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/**/*.py : Proper logging with context instead of print statements
src/deriver/queue_manager.py (1)
Learnt from: Rajat-Ahuja1997
PR: #131
File: migrations/versions/d429de0e5338_adopt_peer_paradigm.py:918-942
Timestamp: 2025-06-19T14:32:02.934Z
Learning: The queue and active_queue_sessions tables in the migration script migrations/versions/d429de0e5338_adopt_peer_paradigm.py are expected to remain small, so per-row updates are acceptable and performance optimizations like set-based updates are not necessary.
src/utils/summarizer.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/utils/history.py : Session history summarization: short every 20 messages, long every 60
src/deriver/enqueue.py (3)
Learnt from: Rajat-Ahuja1997
PR: #131
File: migrations/versions/d429de0e5338_adopt_peer_paradigm.py:918-942
Timestamp: 2025-06-19T14:32:02.934Z
Learning: The queue and active_queue_sessions tables in the migration script migrations/versions/d429de0e5338_adopt_peer_paradigm.py are expected to remain small, so per-row updates are acceptable and performance optimizations like set-based updates are not necessary.
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/routers/messages.py : Batch message creation supports up to 100 messages
Learnt from: dr-frmr
PR: #131
File: src/routers/sessions.py:206-213
Timestamp: 2025-06-18T20:42:06.458Z
Learning: The get_or_create_session function in this codebase is designed to handle both session creation and adding peers to existing sessions. When called with peers, it will add those peers to an existing session rather than creating a duplicate session.
src/utils/logging.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/**/*.py : Proper logging with context instead of print statements
docs/v2/openapi.documented.yml (7)
Learnt from: Rajat-Ahuja1997
PR: #131
File: migrations/versions/d429de0e5338_adopt_peer_paradigm.py:438-441
Timestamp: 2025-06-18T16:44:57.733Z
Learning: In the Honcho database schema, messages.app_id references workspaces.public_id (string nanoid), not workspaces.id (integer primary key). This means that during migrations when workspaces.public_id is renamed to workspaces.id, the foreign key relationship with messages.app_id remains valid.
Learnt from: Rajat-Ahuja1997
PR: #131
File: src/crud.py:503-505
Timestamp: 2025-06-18T14:50:59.967Z
Learning: The Honcho project prefers upsert behavior for update operations across all resources (sessions, peers, workspaces). Update operations should create the resource if it doesn't exist rather than failing fast. This is an explicit design decision that differs from typical REST semantics but provides a more forgiving API experience.
Learnt from: Rajat-Ahuja1997
PR: #166
File: migrations/versions/05486ce795d5_make_session_name_required_on_messages.py:60-114
Timestamp: 2025-07-21T20:57:42.135Z
Learning: Peer names in the Honcho codebase are restricted to the pattern r"^[a-zA-Z0-9_-]+$" (same as session names), which prevents SQL injection and JSON syntax errors when peer names are interpolated into SQL queries and JSON strings during migrations.
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/models.py : Feature flags on workspace, peer, and session levels
Learnt from: dr-frmr
PR: #131
File: tests/test_schema_validations.py:76-80
Timestamp: 2025-06-17T21:40:26.817Z
Learning: In the MessageCreate schema, peer_name is the actual field name with "peer_id" as an alias, so when constructing MessageCreate(peer_id="value"), it sets the peer_name attribute to "value".
Learnt from: dr-frmr
PR: #131
File: src/routers/sessions.py:206-213
Timestamp: 2025-06-18T20:42:06.458Z
Learning: The get_or_create_session function in this codebase is designed to handle both session creation and adding peers to existing sessions. When called with peers, it will add those peers to an existing session rather than creating a duplicate session.
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/routers/messages.py : Batch message creation supports up to 100 messages
src/deriver/deriver.py (1)
Learnt from: CR
PR: plastic-labs/honcho#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T14:51:09.913Z
Learning: Applies to src/**/*.py : Proper logging with context instead of print statements
🧬 Code Graph Analysis (5)
src/crud/__init__.py (1)
src/crud/message.py (1)
get_message_seq_in_session(225-250)
src/crud/session.py (1)
src/models.py (1)
SessionPeer(401-411)
src/utils/formatting.py (1)
src/utils/logging.py (1)
conditional_observe(24-41)
src/crud/message.py (2)
src/schemas.py (1)
SessionCreate(187-196)sdks/python/src/honcho/async_client/session.py (1)
AsyncSession(38-562)
src/dialectic/chat.py (7)
src/dependencies.py (1)
tracked_db(32-61)src/routers/sessions.py (1)
get_session_context(369-457)src/utils/clients.py (6)
honcho_llm_call(107-120)honcho_llm_call(125-138)honcho_llm_call(143-157)honcho_llm_call(162-176)honcho_llm_call(181-194)honcho_llm_call(197-352)src/utils/embedding_store.py (1)
EmbeddingStore(27-425)src/utils/logging.py (2)
accumulate_metric(222-235)log_performance_metrics(238-278)src/crud/representation.py (1)
construct_collection_name(231-232)src/dialectic/utils.py (1)
get_observations(25-104)
🪛 LanguageTool
docs/v2/documentation/core-concepts/architecture.mdx
[grammar] ~127-~127: There might be a problem here.
Context: ... - File uploads (PDFs, text files, JSON documents) ## Deriver At the core of developing representati...
(QB_NEW_EN_MERGED_MATCH)
docs/v2/documentation/reference/guided-tutorial.mdx
[grammar] ~127-~127: Use correct spacing
Context: ...") ``` ## Part 4: LLM Integration with Context ### Store Information in Peer Representation...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
docs/changelog/compatibility-guide.mdx
[grammar] ~11-~11: Use correct spacing
Context: ...on Compatibility ### Honcho API v2.1.1 (Current) Compatible Version: v1.2.1 Install with: bash npm install @honcho-ai/sdk@1.2.1 Compatible Version: v1.2.2 Install with: bash pip install honcho-ai==1.2.2 ## Version Compatibility Table | Honcho AP...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
tests/bench/README.md
[grammar] ~1-~1: Use correct spacing
Context: # Honcho Development Harness This directory contains a development ha...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~3-~3: Use correct spacing
Context: ...asy to run Honcho locally with a Docker database. ## Overview The harness.py script orches...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~7-~7: There might be a mistake here.
Context: ...strates the complete Honcho development environment: 1. Database Setup: Starts a PostgreSQL d...
(QB_NEW_EN_OTHER)
[grammar] ~9-~9: There might be a mistake here.
Context: ... database in Docker with a configurable port 2. Database Provisioning: Runs Alembic mi...
(QB_NEW_EN_OTHER)
[grammar] ~10-~10: There might be a mistake here.
Context: ...embic migrations to set up the database schema 3. Configuration: Uses environment variab...
(QB_NEW_EN_OTHER)
[grammar] ~11-~11: There might be a mistake here.
Context: ...ariables to configure Honcho's database connection 4. Service Startup: Starts both the FastA...
(QB_NEW_EN_OTHER)
[grammar] ~12-~12: Ensure spelling is correct
Context: ...p**: Starts both the FastAPI server and deriver process 5. Configuration Verification: Prints the...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~13-~13: There might be a mistake here.
Context: ...the actual configuration that Honcho is using 6. Monitoring: Provides real-time logs fr...
(QB_NEW_EN_OTHER)
[grammar] ~14-~14: There might be a mistake here.
Context: ...ing**: Provides real-time logs from all services 7. Cleanup: Gracefully shuts down all ser...
(QB_NEW_EN_OTHER)
[grammar] ~15-~15: There might be a problem here.
Context: ...Gracefully shuts down all services when stopped ## Prerequisites - Python 3.8+ - Docker and Docker Compose ...
(QB_NEW_EN_MERGED_MATCH)
[grammar] ~21-~21: Use correct spacing
Context: ... Honcho project dependencies installed (uv sync) ## Usage ### Basic Usage Run the harness ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~25-~25: Use correct spacing
Context: ...talled (uv sync) ## Usage ### Basic Usage Run the harness with default settings (d...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~27-~27: Use correct spacing
Context: ...with default settings (database on port 5433): bash python tests/bench/harness.py ### Custom Database Port Run with a custom ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~33-~33: Use correct spacing
Context: ...nch/harness.py ### Custom Database Port Run with a custom database port: bas...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~35-~35: There might be a mistake here.
Context: ...tabase Port Run with a custom database port: bash python tests/bench/harness.py --port 5434 ### Custom Project Root If running fro...
(QB_NEW_EN_OTHER)
[grammar] ~41-~41: Use correct spacing
Context: ....py --port 5434 ``` ### Custom Project Root If running from a different directory: ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~43-~43: There might be a mistake here.
Context: ...oject Root If running from a different directory: bash python tests/bench/harness.py --project-root /path/to/honcho ### Command Line Options - --port: P...
(QB_NEW_EN_OTHER)
[grammar] ~49-~49: Use correct spacing
Context: ...t /path/to/honcho ``` ### Command Line Options - --port: Port for the PostgreSQL database (defa...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~52-~52: Use correct spacing
Context: ...e Honcho project root (default: current directory) ## What Gets Started When you run the harn...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~54-~54: Use correct spacing
Context: ...fault: current directory) ## What Gets Started When you run the harness, it will start:...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~56-~56: There might be a problem here.
Context: ...rted When you run the harness, it will start: 1. PostgreSQL Database: Running in Docker on the sp...
(QB_NEW_EN_MERGED_MATCH)
[grammar] ~58-~58: There might be a mistake here.
Context: ...e**: Running in Docker on the specified port 2. FastAPI Server: Available at http://lo...
(QB_NEW_EN_OTHER)
[grammar] ~61-~61: Use correct spacing
Context: ...ess**: Background worker for processing messages ## Configuration The harness uses environm...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~65-~65: There might be a mistake here.
Context: ...ariables to configure Honcho's database connection: - DB_CONNECTION_URI: Set to `postgresql+psycopg://testuser...
(QB_NEW_EN_OTHER)
[grammar] ~67-~67: Use correct spacing
Context: ...connection: - DB_CONNECTION_URI: Set to postgresql+psycopg://testuser:testpwd@localhost:{port}/honcho The script will print the actual configu...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~69-~69: Use correct spacing
Context: ...nvironment variables, config files, and defaults. ## Stopping the Services Press Ctrl+C to...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~71-~71: Use correct spacing
Context: ...g files, and defaults. ## Stopping the Services Press Ctrl+C to gracefully stop all se...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~73-~73: There might be a mistake here.
Context: ...acefully stop all services. The harness will: 1. Stop the FastAPI server and deriver pro...
(QB_NEW_EN_OTHER)
[grammar] ~75-~75: Ensure spelling is correct
Context: ...s will: 1. Stop the FastAPI server and deriver processes 2. Stop the Docker database container 3. Cl...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~76-~76: There might be a mistake here.
Context: ...r processes 2. Stop the Docker database container 3. Clean up temporary files (Docker Compose...
(QB_NEW_EN_OTHER)
[grammar] ~77-~77: There might be a problem here.
Context: ...lean up temporary files (Docker Compose configuration) ## Troubleshooting ### Database Connection Issues If the datab...
(QB_NEW_EN_MERGED_MATCH)
[grammar] ~81-~81: Use correct spacing
Context: ...roubleshooting ### Database Connection Issues If the database fails to start or connec...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~83-~83: There might be a mistake here.
Context: ...sues If the database fails to start or connect: 1. Check if port 5433 (or your custom port...
(QB_NEW_EN_OTHER)
[grammar] ~85-~85: There might be a mistake here.
Context: ...433 (or your custom port) is already in use 2. Ensure Docker is running 3. Try a differ...
(QB_NEW_EN_OTHER)
[grammar] ~86-~86: There might be a mistake here.
Context: ...) is already in use 2. Ensure Docker is running 3. Try a different port: --port 5434 ###...
(QB_NEW_EN_OTHER)
[grammar] ~87-~87: There might be a problem here.
Context: ...re Docker is running 3. Try a different port: --port 5434 ### Configuration Issues The script will pr...
(QB_NEW_EN_MERGED_MATCH)
[grammar] ~89-~89: Use correct spacing
Context: ... port: --port 5434 ### Configuration Issues The script will print the actual configu...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~91-~91: There might be a mistake here.
Context: ...ation being used. If you see unexpected values: 1. Check if you have a config.toml file ...
(QB_NEW_EN_OTHER)
[grammar] ~93-~93: There might be a mistake here.
Context: ...le that might be overriding environment variables 2. Verify that the environment variables ar...
(QB_NEW_EN_OTHER)
[grammar] ~94-~94: There might be a mistake here.
Context: ...the environment variables are being set correctly 3. Check the Honcho configuration documenta...
(QB_NEW_EN_OTHER)
[grammar] ~95-~95: There might be a mistake here.
Context: ...figuration documentation for precedence rules ## Integration with CI/CD This harness can...
(QB_NEW_EN_OTHER)
[grammar] ~97-~97: Use correct spacing
Context: ...r precedence rules ## Integration with CI/CD This harness can be used in CI/CD pipeli...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~99-~99: There might be a mistake here.
Context: ...nes for integration testing. The script will: - Use temporary directories for isolation...
(QB_NEW_EN_OTHER)
[grammar] ~101-~101: There might be a mistake here.
Context: ... will: - Use temporary directories for isolation - Clean up all resources on exit - Provide...
(QB_NEW_EN_OTHER)
[grammar] ~102-~102: There might be a mistake here.
Context: ...r isolation - Clean up all resources on exit - Provide clear error messages for debuggi...
(QB_NEW_EN_OTHER)
[grammar] ~103-~103: There might be a mistake here.
Context: ...exit - Provide clear error messages for debugging - Exit with appropriate status codes - Use...
(QB_NEW_EN_OTHER)
[grammar] ~104-~104: There might be a mistake here.
Context: ...ebugging - Exit with appropriate status codes - Use environment variables for configurat...
(QB_NEW_EN_OTHER)
[grammar] ~105-~105: There might be a mistake here.
Context: ...nt variables for configuration (no file conflicts) ## Test Runner The run_tests.py script e...
(QB_NEW_EN_OTHER)
[grammar] ~107-~107: Use correct spacing
Context: ...figuration (no file conflicts) ## Test Runner The run_tests.py script executes JSON-...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~109-~109: Use correct spacing
Context: ...ng Honcho instance. The harness must be running. ### Running Tests 1. **Start Honcho using t...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~111-~111: Use correct spacing
Context: ...e harness must be running. ### Running Tests 1. Start Honcho using the harness: ```...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~113-~113: There might be a mistake here.
Context: ...ning Tests 1. Start Honcho using the harness: bash python tests/bench/harness.py 2. In another terminal, run the tests...
(QB_NEW_EN_OTHER)
[grammar] ~118-~118: There might be a mistake here.
Context: ... 2. **In another terminal, run the tests**: bash # Run all tests python tests/bench/run_tests.py # Run a specific test # Test judge uses claude 3.5 sonnet python tests/bench/run_tests.py --test 1.json ``` ### Test Workflow For each test, t...
(QB_NEW_EN_OTHER)
[grammar] ~128-~128: Use correct spacing
Context: ...tests.py --test 1.json ``` ### Test Workflow For each test, the runner: 1. **Creates...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~130-~130: There might be a mistake here.
Context: ... ### Test Workflow For each test, the runner: 1. Creates a workspace for the test 2. *...
(QB_NEW_EN_OTHER)
[grammar] ~134-~134: Insert the missing word
Context: ...** from the JSON to sessions 3. Waits for deriver queue to be empty 4. **Executes...
(QB_NEW_EN_OTHER_ERROR_IDS_32)
[grammar] ~136-~136: There might be a problem here.
Context: ...()` calls 5. Judges responses using expected_response field ### Test JSON Format Tests are defined in J...
(QB_NEW_EN_MERGED_MATCH)
[grammar] ~138-~138: Use correct spacing
Context: ... expected_response field ### Test JSON Format Tests are defined in JSON files with thi...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~140-~140: There might be a mistake here.
Context: ...sts are defined in JSON files with this structure: json { "sessions": { "session1": { "messages": [ { "peer": "alice", "content": "Hello, how are you?" }, { "peer": "bob", "content": "I'm good, thank you!" } ] } }, "queries": [ { "query": "How is Bob doing?", "expected_response": "Good", "session": "session1", // optional "peer": "alice" // optional } ] } ### Command Line...
(QB_NEW_EN_OTHER)
[grammar] ~169-~169: Use correct spacing
Context: ... } ] } ``` ### Command Line Options - --tests-dir: Directory containing JSON test files (...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~174-~174: There might be a mistake here.
Context: ...pi-key`: Anthropic API key for response judging, uses LLM_ANTHROPIC_API_KEY if not given...
(QB_NEW_EN_OTHER)
[grammar] ~175-~175: Ensure spelling is correct
Context: ...if not given - --timeout: Timeout for deriver queue to empty (default: 60 seconds)
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
docs/v2/contributing/configuration.mdx
[grammar] ~49-~49: Use correct spacing
Context: ...tings (log level, host, port, embedding settings) - [db] - Database connection and pool settings -...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~50-~50: Use correct spacing
Context: ...- [db] - Database connection and pool settings - [auth] - Authentication configuration - [llm] ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~51-~51: Use correct spacing
Context: ...ol settings - [auth] - Authentication configuration - [llm] - LLM provider API keys and general setti...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~52-~52: Use correct spacing
Context: ...m]- LLM provider API keys and general settings -[dialectic]` - Dialectic API configuration (provider, ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~53-~53: Use correct spacing
Context: ... configuration (provider, model, search settings) - [deriver] - Background worker settings and theory o...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~54-~54: Use correct spacing
Context: ...ound worker settings and theory of mind configuration - [summary] - Session summarization settings - `[sent...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~55-~55: Use correct spacing
Context: ...n - [summary] - Session summarization settings - [sentry] - Error tracking and monitoring settings ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~56-~56: Use correct spacing
Context: ...entry]` - Error tracking and monitoring settings ### Using Environment Variables All configu...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~203-~203: Use correct spacing
Context: ...ic features use their own configuration sections. ### API Keys All provider API keys use the ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~205-~205: Use correct spacing
Context: ...ir own configuration sections. ### API Keys All provider API keys use the LLM_ pre...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~207-~207: There might be a mistake here.
Context: ...s All provider API keys use the LLM_ prefix: bash # Provider API Keys LLM_ANTHROPIC_API_KEY=your-anthropic-api-key LLM_OPENAI_API_KEY=your-openai-api-key LLM_GEMINI_API_KEY=your-gemini-api-key LLM_GROQ_API_KEY=your-groq-api-key # OpenAI-compatible endpoints LLM_OPENAI_COMPATIBLE_API_KEY=your-api-key LLM_OPENAI_COMPATIBLE_BASE_URL=https://your-openai-compatible-endpoint.com ### General LLM Settings ```ba...
(QB_NEW_EN_OTHER)
[grammar] ~221-~221: Use correct spacing
Context: ...tible-endpoint.com ### General LLM Settings bash # Default settings for all LLM calls LLM_DEFAULT_MAX_TOKENS=2500 ``` ### Feature-Specific Model Configuration Di...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~228-~228: Use correct spacing
Context: ...NS=2500 ``` ### Feature-Specific Model Configuration Different features can use different pro...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~230-~230: There might be a mistake here.
Context: ...eatures can use different providers and models: Dialectic API: ```bash # Main dialect...
(QB_NEW_EN_OTHER)
[grammar] ~232-~232: There might be a mistake here.
Context: ...rent providers and models: Dialectic API: bash # Main dialectic model (default: Anthropic) DIALECTIC_PROVIDER=anthropic DIALECTIC_MODEL=claude-sonnet-4-20250514 DIALECTIC_MAX_OUTPUT_TOKENS=2500 DIALECTIC_THINKING_BUDGET_TOKENS=1024 # Query generation for dialectic (default: Groq) DIALECTIC_QUERY_GENERATION_PROVIDER=groq DIALECTIC_QUERY_GENERATION_MODEL=llama-3.1-8b-instant # Semantic search settings DIALECTIC_SEMANTIC_SEARCH_TOP_K=10 DIALECTIC_SEMANTIC_SEARCH_MAX_DISTANCE=0.85 Deriver: ```bash # Der...
(QB_NEW_EN_OTHER)
[grammar] ~249-~249: Ensure spelling is correct
Context: ...EMANTIC_SEARCH_MAX_DISTANCE=0.85 **Deriver:**bash # Deriver model (default: Goo...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~265-~265: There might be a mistake here.
Context: ...IT_OBSERVATIONS_COUNT=10 **Summary Generation:**bash # Summary model (default: Google) SUMMARY_PROVIDER=google SUMMARY_MODEL=gemini-1.5-flash-latest SUMMARY_MAX_TOKENS_SHORT=1000 SUMMARY_MAX_TOKENS_LONG=2000 SUMMARY_THINKING_BUDGET_TOKENS=512 # Summary frequency SUMMARY_MESSAGES_PER_SHORT_SUMMARY=20 SUMMARY_MESSAGES_PER_LONG_SUMMARY=60 ``` ### Default Provider Usage By ...
(QB_NEW_EN_OTHER)
[grammar] ~279-~279: Use correct spacing
Context: ...NG_SUMMARY=60 ``` ### Default Provider Usage By default, Honcho uses: - Anthropic...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~285-~285: Use correct spacing
Context: ...ization - OpenAI for embeddings (if EMBED_MESSAGES=true) You only need to set the API keys for th...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~287-~287: Use correct spacing
Context: ... API keys for the providers you plan to use. ## Monitoring Configuration ### Sentry Err...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
🪛 Ruff (0.12.2)
src/deriver/__main__.py
12-12: Missing return type annotation for public function setup_logging
Add return type annotation: None
(ANN201)
src/routers/messages.py
75-75: Consider moving this statement to an else block
(TRY300)
77-77: Logging statement uses f-string
(G004)
77-77: Use explicit conversion flag
Replace with conversion flag
(RUF010)
src/utils/filter.py
227-227: Unnecessary else after return statement
Remove unnecessary else
(RET505)
src/deriver/consumer.py
27-27: Avoid specifying long messages outside the exception class
(TRY003)
29-29: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
30-30: Avoid specifying long messages outside the exception class
(TRY003)
30-30: Use explicit conversion flag
Replace with conversion flag
(RUF010)
src/crud/document.py
53-55: Avoid specifying long messages outside the exception class
(TRY003)
54-54: Trailing comma missing
Add trailing comma
(COM812)
66-66: Trailing comma missing
Add trailing comma
(COM812)
70-70: Trailing comma missing
Add trailing comma
(COM812)
src/utils/formatting.py
197-197: Trailing comma missing
Add trailing comma
(COM812)
src/config.py
221-221: Trailing comma missing
Add trailing comma
(COM812)
src/routers/sessions.py
377-377: Boolean positional value in function call
(FBT003)
380-380: Boolean-typed positional argument in function definition
(FBT001)
381-381: Boolean positional value in function call
(FBT003)
404-404: Missing return type annotation for private function get_long_summary
(ANN202)
413-413: Missing return type annotation for private function get_short_summary
(ANN202)
451-451: Logging statement uses f-string
(G004)
src/deriver/queue_payload.py
38-38: create_payload is too complex (12 > 10)
(C901)
66-66: Avoid specifying long messages outside the exception class
(TRY003)
69-69: Avoid specifying long messages outside the exception class
(TRY003)
72-72: Avoid specifying long messages outside the exception class
(TRY003)
81-81: Abstract raise to an inner function
(TRY301)
81-81: Avoid specifying long messages outside the exception class
(TRY003)
84-84: Abstract raise to an inner function
(TRY301)
84-84: Avoid specifying long messages outside the exception class
(TRY003)
87-87: Abstract raise to an inner function
(TRY301)
87-87: Avoid specifying long messages outside the exception class
(TRY003)
90-90: Abstract raise to an inner function
(TRY301)
90-90: Avoid specifying long messages outside the exception class
(TRY003)
103-103: Abstract raise to an inner function
(TRY301)
103-103: Avoid specifying long messages outside the exception class
(TRY003)
116-116: Avoid specifying long messages outside the exception class
(TRY003)
116-116: Use explicit conversion flag
Replace with conversion flag
(RUF010)
src/dialectic/prompts.py
65-65: Trailing comma missing
Add trailing comma
(COM812)
118-118: Trailing comma missing
Add trailing comma
(COM812)
src/dialectic/utils.py
93-93: Trailing comma missing
Add trailing comma
(COM812)
238-238: Missing return type annotation for public function generate_semantic_queries
(ANN201)
src/deriver/queue_manager.py
313-313: Logging statement uses f-string
(G004)
313-313: Trailing comma missing
Add trailing comma
(COM812)
386-386: Trailing comma missing
Add trailing comma
(COM812)
388-388: Trailing comma missing
Add trailing comma
(COM812)
src/dialectic/chat.py
196-196: Trailing comma missing
Add trailing comma
(COM812)
215-215: Trailing comma missing
Add trailing comma
(COM812)
331-331: Trailing comma missing
Add trailing comma
(COM812)
src/utils/clients.py
156-156: Dynamically typed expressions (typing.Any) are disallowed in **extra_call_params
(ANN401)
208-208: Boolean-typed positional argument in function definition
(FBT001)
208-208: Boolean default positional argument in function definition
(FBT002)
208-208: Unused function argument: return_call_response
(ARG001)
src/utils/summarizer.py
165-165: Missing return type annotation for private function create_long_summary
Add return type annotation: None
(ANN202)
177-177: Missing return type annotation for private function create_short_summary
Add return type annotation: None
(ANN202)
412-412: Trailing comma missing
Add trailing comma
(COM812)
src/deriver/enqueue.py
256-256: Trailing comma missing
Add trailing comma
(COM812)
270-270: Trailing comma missing
Add trailing comma
(COM812)
293-293: Trailing comma missing
Add trailing comma
(COM812)
tests/bench/harness.py
1-1: The file is executable but no shebang is present
(EXE002)
99-99: Do not catch blind exception: Exception
(BLE001)
120-120: subprocess call: check for execution of untrusted input
(S603)
121-130: Starting a process with a partial executable path
(S607)
158-158: subprocess call: check for execution of untrusted input
(S603)
159-167: Starting a process with a partial executable path
(S607)
185-185: Trailing comma missing
Add trailing comma
(COM812)
189-189: Consider moving this statement to an else block
(TRY300)
190-191: try-except-pass detected, consider logging the exception
(S110)
190-190: Do not catch blind exception: Exception
(BLE001)
206-206: subprocess call: check for execution of untrusted input
(S603)
249-249: Trailing comma missing
Add trailing comma
(COM812)
253-253: Do not catch blind exception: Exception
(BLE001)
266-266: subprocess call: check for execution of untrusted input
(S603)
273-273: Possible binding to all interfaces
(S104)
300-300: subprocess call: check for execution of untrusted input
(S603)
342-342: Do not catch blind exception: Exception
(BLE001)
348-348: wait_for_fastapi is too complex (11 > 10)
(C901)
369-370: try-except-pass detected, consider logging the exception
(S110)
369-369: Do not catch blind exception: Exception
(BLE001)
466-466: subprocess call: check for execution of untrusted input
(S603)
495-495: Do not catch blind exception: Exception
(BLE001)
508-508: subprocess call: check for execution of untrusted input
(S603)
509-518: Starting a process with a partial executable path
(S607)
526-526: Starting a process with a partial executable path
(S607)
531-531: Do not catch blind exception: Exception
(BLE001)
541-541: Do not catch blind exception: Exception
(BLE001)
557-557: Trailing comma missing
Add trailing comma
(COM812)
604-604: Trailing comma missing
Add trailing comma
(COM812)
621-621: Do not catch blind exception: Exception
(BLE001)
627-627: Missing return type annotation for public function main
Add return type annotation: None
(ANN201)
660-660: Trailing comma missing
Add trailing comma
(COM812)
tests/bench/run_tests.py
70-70: Missing return type annotation for special method __init__
Add return type annotation: None
(ANN204)
87-87: Trailing comma missing
Add trailing comma
(COM812)
97-97: Trailing comma missing
Add trailing comma
(COM812)
102-102: Avoid specifying long messages outside the exception class
(TRY003)
129-129: Trailing comma missing
Add trailing comma
(COM812)
133-133: Trailing comma missing
Add trailing comma
(COM812)
145-145: Async functions should not call time.sleep
(ASYNC251)
154-154: Async functions should not call time.sleep
(ASYNC251)
155-155: Consider moving this statement to an else block
(TRY300)
156-156: Do not catch blind exception: Exception
(BLE001)
157-157: Logging statement uses f-string
(G004)
161-161: Trailing comma missing
Add trailing comma
(COM812)
208-208: Trailing comma missing
Add trailing comma
(COM812)
213-213: Abstract raise to an inner function
(TRY301)
213-213: Avoid specifying long messages outside the exception class
(TRY003)
218-220: Abstract raise to an inner function
(TRY301)
218-220: Avoid specifying long messages outside the exception class
(TRY003)
219-219: Trailing comma missing
Add trailing comma
(COM812)
223-223: Abstract raise to an inner function
(TRY301)
223-223: Avoid specifying long messages outside the exception class
(TRY003)
237-237: Consider moving this statement to an else block
(TRY300)
237-237: Unnecessary assignment to judgment before return statement
Remove unnecessary assignment
(RET504)
239-239: Do not catch blind exception: Exception
(BLE001)
240-240: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
240-240: Logging statement uses f-string
(G004)
248-248: execute_test is too complex (36 > 10)
(C901)
333-333: Trailing comma missing
Add trailing comma
(COM812)
339-339: Trailing comma missing
Add trailing comma
(COM812)
345-345: Trailing comma missing
Add trailing comma
(COM812)
351-351: Trailing comma missing
Add trailing comma
(COM812)
371-371: Trailing comma missing
Add trailing comma
(COM812)
375-375: Trailing comma missing
Add trailing comma
(COM812)
390-390: Trailing comma missing
Add trailing comma
(COM812)
413-413: Prefer next(iter(sessions.values())) over single element slice
Replace with next(iter(sessions.values()))
(RUF015)
420-420: Trailing comma missing
Add trailing comma
(COM812)
437-437: Trailing comma missing
Add trailing comma
(COM812)
455-455: Trailing comma missing
Add trailing comma
(COM812)
464-464: Logging statement uses f-string
(G004)
464-464: Trailing comma missing
Add trailing comma
(COM812)
466-466: Logging statement uses f-string
(G004)
473-473: Do not catch blind exception: Exception
(BLE001)
474-474: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
474-474: Logging statement uses f-string
(G004)
501-501: Trailing comma missing
Add trailing comma
(COM812)
508-508: Trailing comma missing
Add trailing comma
(COM812)
520-520: Trailing comma missing
Add trailing comma
(COM812)
531-531: Trailing comma missing
Add trailing comma
(COM812)
534-534: Do not catch blind exception: Exception
(BLE001)
535-535: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
535-535: Logging statement uses f-string
(G004)
671-671: Trailing comma missing
Add trailing comma
(COM812)
685-685: Consider moving this statement to an else block
(TRY300)
690-690: Do not catch blind exception: Exception
(BLE001)
src/utils/logging.py
39-39: Unnecessary else after return statement
Remove unnecessary else
(RET505)
136-136: Trailing comma missing
Add trailing comma
(COM812)
210-210: Trailing comma missing
Add trailing comma
(COM812)
285-285: Unnecessary elif after return statement
Remove unnecessary elif
(RET505)
291-291: Use explicit conversion flag
Replace with conversion flag
(RUF010)
303-303: Use explicit conversion flag
Replace with conversion flag
(RUF010)
307-307: Unnecessary elif after return statement
Remove unnecessary elif
(RET505)
src/utils/embedding_store.py
90-90: Trailing comma missing
Add trailing comma
(COM812)
121-121: Trailing comma missing
Add trailing comma
(COM812)
255-255: Unnecessary else after return statement
Remove unnecessary else
(RET505)
352-352: Trailing comma missing
Add trailing comma
(COM812)
394-394: Trailing comma missing
Add trailing comma
(COM812)
src/deriver/deriver.py
92-92: Trailing comma missing
Add trailing comma
(COM812)
161-161: Trailing comma missing
Add trailing comma
(COM812)
170-170: Trailing comma missing
Add trailing comma
(COM812)
189-189: Trailing comma missing
Add trailing comma
(COM812)
207-207: Trailing comma missing
Add trailing comma
(COM812)
242-242: Trailing comma missing
Add trailing comma
(COM812)
257-257: Trailing comma missing
Add trailing comma
(COM812)
352-352: Trailing comma missing
Add trailing comma
(COM812)
353-353: Trailing comma missing
Add trailing comma
(COM812)
357-357: Trailing comma missing
Add trailing comma
(COM812)
🪛 markdownlint-cli2 (0.17.2)
tests/bench/README.md
59-59: Bare URL used
(MD034, no-bare-urls)
60-60: Bare URL used
(MD034, no-bare-urls)
114-114: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
119-119: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
173-173: Bare URL used
(MD034, no-bare-urls)
175-175: Files should end with a single newline character
(MD047, single-trailing-newline)
🪛 YAMLlint (1.37.1)
docs/v2/openapi.documented.yml
[error] 2117-2117: trailing spaces
(trailing-spaces)
[error] 3172-3172: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (65)
docs/v2/documentation/core-concepts/glossary.mdx (1)
66-70: No content-level impact – safe to skipThe only modification is a soft-wrap change; no wording, formatting, or front-matter is affected.
scripts/update_version.py (1)
51-74: Comment quote-style change is fineSwitching the “Current version” comments to double quotes harmonises with surrounding text and has no functional effect. LGTM.
README.md (1)
1-5: Version badge updated correctlyThe badge now reflects
2.1.1, matchingsrc/main.pyandpyproject.toml. No further action required.docs/docs.json (1)
22-22: Version update looks correct.The version bump from "v2.1.0" to "v2.1.1" aligns with the patch release objectives and follows semantic versioning conventions.
pyproject.toml (2)
3-3: Version bump is consistent across the project.The version update from "2.1.0" to "2.1.1" correctly reflects the patch release.
35-35: New dev dependency addition supports enhanced testing capabilities.The addition of "honcho-ai>=1.2.1" aligns with the test harness improvements mentioned in the PR summary.
docs/v2/documentation/core-concepts/architecture.mdx (1)
127-127: Documentation accurately reflects new file upload capability.The addition of file upload support to the message types list properly documents the new API functionality for handling PDFs, text files, and JSON documents.
src/crud/__init__.py (1)
7-7: New function import and export properly structured.The addition of
get_message_seq_in_sessionfollows the module's existing patterns and correctly exposes the function for use in deriver enqueue logic.Also applies to: 57-57
src/utils/filter.py (1)
225-225: JSONB field extension correctly supports internal_metadata filtering.The addition of "internal_metadata" to the special JSONB field handling extends filtering capabilities as intended for the enhanced metadata processing features.
Also applies to: 230-230
docs/changelog/compatibility-guide.mdx (1)
38-40: Ensure version rows stay chronologically sorted
v2.1.0is still listed below the “(Current)” row, but oncev2.1.2ships you’ll need to append – not insert – a new row to keep the table descending by recency. Just flagging this so the next patch bump doesn’t accidentally shuffle rows.tests/bench/tests/trivial.json (1)
18-21: Confirm the expected response matcher is strict-enough
"expected_response": "Good"may be too brittle if the system returns “I’m good” or “good.” (different casing / punctuation). Double-check the harness: if it does an exact string match, consider normalising (lower-case, strip punctuation) or using a regex so the test doesn’t produce false negatives.config.toml.example (1)
12-12: Duplication vs. precedence for max-token settings
GET_CONTEXT_DEFAULT_MAX_TOKENS = 2048can silently conflict with[llm].DEFAULT_MAX_TOKENS = 2500. Clarify (in a comment or docs) which one wins at runtime; otherwise operators may tweak the wrong knob.src/crud/session.py (2)
5-5: Import addition looks good.The
caseimport is appropriately added to support the conditional configuration logic implemented in the_get_or_add_peers_to_sessionfunction.
575-586: Excellent conditional configuration logic.The implementation correctly handles two distinct scenarios:
- Rejoining peers (
left_atis not null): Apply new configuration as they're starting fresh- Active peers (
left_atis null): Preserve existing configuration to avoid disrupting ongoing sessionsThis aligns well with the upsert behavior preference in this codebase and demonstrates thoughtful session lifecycle management.
tests/bench/tests/trivial_session_scoped.json (1)
1-56: Well-designed test for session-scoped understanding.This test effectively validates that the system can:
- Distinguish between identical queries across different sessions
- Maintain session-specific context for both observer and target perspectives
- Generate appropriate responses based on session-scoped conversation history
The structure clearly demonstrates the session-aware dialectic functionality with simple but effective test cases.
tests/bench/tests/3player.json (1)
1-51: Comprehensive multi-peer interaction test.This test effectively validates complex conversational understanding:
- Intention inference: Testing understanding of Bob's sabotage plans
- Relationship dynamics: Testing Alice's commitment to help Charlie
- Emotional reasoning: Testing recognition of Alice's disapproval
The scenario provides rich context for testing sophisticated peer-aware dialectic capabilities with realistic multi-party conversation dynamics.
docs/v2/documentation/reference/sdk.mdx (1)
257-270: Documentation correctly reflects session-centric architecture.The updates appropriately shift emphasis from direct peer message addition to session-scoped message management. This aligns with:
- The API evolution removing direct peer message endpoints
- Enhanced session-aware dialectic functionality
- Better architectural separation of concerns
The examples clearly demonstrate the recommended usage patterns for both Python and TypeScript.
Also applies to: 295-307
docs/changelog/introduction.mdx (3)
31-52: LGTM! Well-structured changelog entry.The v2.1.1 changelog entry properly documents the new features, fixes, and changes in a clear, organized manner. The version labeling update correctly reflects the new current release.
54-54: Version label update is correct.Properly updated the previous current version (v2.1.0) to remove the "(Current)" label.
80-80: Version label cleanup is consistent.Correctly removed the "(Current)" tag from v2.0.5 to maintain consistency in version labeling.
src/routers/messages.py (1)
129-129: Timestamp handling simplification is correct.The removal of ISO format conversion for
created_attimestamps aligns with the broader refactoring of queue payload handling. This simplification reduces unnecessary serialization overhead..env.template (3)
14-14: Good addition for context token configuration.The
GET_CONTEXT_DEFAULT_MAX_TOKENS=2048environment variable properly supports the new dynamic context window sizing feature mentioned in the changelog.
21-23: Langfuse integration variables are well-placed.The commented-out Langfuse configuration variables (
LANGFUSE_HOSTandLANGFUSE_PUBLIC_KEY) are appropriately placed in the embedding settings section and support the new telemetry integration.
97-97: Dialectic query generation flag aligns with changelog.The
DIALECTIC_PERFORM_QUERY_GENERATION=falsesetting correctly implements the changelog note about making "query expansion in dialectic off by default."tests/bench/tests/summary_and_query.json (1)
1-221: Comprehensive test data for benchmarking dialectic and summarization features.This test file provides excellent coverage for the new v2.1.1 features:
- Realistic conversation flow with data extraction scenarios (favorite numbers)
- Multiple query types testing both peers' perspectives
- Graduated token limits (50-2500) for summarization testing
- Session-aware context that aligns with the improved dialectic system
The test data effectively validates the enhanced session- and peer-aware dialectic queries and dynamic context window sizing mentioned in the changelog.
tests/bench/tests/contradict1.json (1)
1-54: Excellent test case for contradiction handling and session-aware queries.This test file effectively validates sophisticated dialectic reasoning capabilities:
- Session-scoped information isolation - Query limited to session1 should only consider that context
- Contradiction detection - Session2 query should recognize the admission of lying
- Cross-session conflict resolution - Global query should synthesize conflicting information appropriately
The expected responses demonstrate nuanced understanding:
- Session-scoped: "pancakes and eggs and bacon"
- Contradiction-aware: "lied previously, skipped breakfast"
- Conflict resolution: "conflicting information, ultimately skipped breakfast"
This aligns perfectly with the enhanced session- and peer-aware dialectic query improvements mentioned in the v2.1.1 changelog.
src/deriver/consumer.py (3)
18-18: Function signature change looks good.The removal of the async database session parameter aligns with the broader refactoring where database access is handled elsewhere in the processing pipeline.
13-13: Console markup setting change looks appropriate.Enabling markup (
True) aligns with the shift to rich console-based logging mentioned in the AI summary.
21-27: Improve exception handling and message formatting.The current implementation has several issues flagged by static analysis:
- Long error messages should use exception class constructors
- Use f-string instead of string formatting
Apply this diff to address the issues:
- else: - raise ValueError(f"Invalid task_type: {task_type}") + else: + raise ValueError(f"Invalid task_type: {task_type!r}")⛔ Skipped due to learnings
Learnt from: CR PR: plastic-labs/honcho#0 File: CLAUDE.md:0-0 Timestamp: 2025-07-21T14:51:09.913Z Learning: Applies to src/**/*.py : Explicit error handling with appropriate exception typessrc/utils/formatting.py (4)
11-11: Import change aligns with conditional Langfuse integration.The switch from direct
langfuse.decorators.observetoconditional_observefrom the logging utility enables Langfuse tracing only when configured, which is a good architectural improvement.
179-179: Decorator change supports conditional observability.The change from
@observe()to@conditional_observeis consistent with the new conditional tracing approach mentioned in the relevant code snippets.
197-199: Direct attribute access simplifies the code.The use of
getattr(original_context, level, [])andgetattr(revised_observations, level, [])is cleaner than the previous approach and removes the need for the helper functionget_observations.
197-199: Add trailing comma for consistency.The static analysis correctly identifies a missing trailing comma that should be added for consistency with project formatting standards.
Apply this diff:
- original_observations = normalize_observations_for_comparison( - getattr(original_context, level, []) - ) + original_observations = normalize_observations_for_comparison( + getattr(original_context, level, []), + )⛔ Skipped due to learnings
Learnt from: VVoruganti PR: plastic-labs/honcho#164 File: sdks/python/src/honcho/async_client/peer.py:136-136 Timestamp: 2025-07-21T15:53:20.965Z Learning: The honcho repository should have COM812 (trailing comma missing) rule disabled in the root pyproject.toml Ruff configuration by adding it to the existing ignore list: ignore = ["E501", "B008", "COM812"]. The maintainers do not want trailing comma suggestions in code reviews.Learnt from: VVoruganti PR: plastic-labs/honcho#164 File: sdks/python/src/honcho/async_client/peer.py:136-136 Timestamp: 2025-07-21T15:53:20.965Z Learning: The honcho repository maintainers do not want trailing comma suggestions or complaints from static analysis tools like Ruff. The COM812 rule should be disabled in the Ruff configuration to avoid these suggestions in future reviews.Learnt from: Rajat-Ahuja1997 PR: plastic-labs/honcho#144 File: tests/integration/test_message_embeddings.py:128-187 Timestamp: 2025-06-26T18:35:46.478Z Learning: The honcho repository does not use trailing commas in function signatures, function calls, or object instantiation. This is consistently applied across the entire codebase including test files, and reviews should not suggest adding trailing commas.tests/integration/test_enqueue.py (4)
94-94: Test expectation correctly updated for deriver disabled case.The change from expecting no queue items to expecting no change in queue count properly reflects the updated behavior where deriver-disabled sessions should not create any queue items.
195-195: Comment accurately reflects the updated enqueue behavior.The comment correctly describes that each message now generates a representation task, which aligns with the refactored queue payload system.
273-273: Comment accurately describes observer behavior.The updated comment correctly explains that observers now receive local representations instead of summaries, consistent with the queue payload refactoring.
366-366: Comment maintains consistency with other test methods.The comment update is consistent with the pattern used in other test methods, correctly describing the expected representation tasks.
src/config.py (4)
207-207: New query generation flag provides good control.The
PERFORM_QUERY_GENERATIONboolean flag with a sensible default ofFalseallows controlled enablement of the query generation feature.
251-251: Default token limit is reasonable for context retrieval.The
GET_CONTEXT_DEFAULT_MAX_TOKENSwith a default of 2048 tokens provides a sensible limit for context retrieval operations.
258-259: Langfuse configuration fields support optional integration.The optional
LANGFUSE_HOSTandLANGFUSE_PUBLIC_KEYfields withNonedefaults properly support conditional Langfuse integration, aligning with the conditional observability pattern seen in other files.
220-222: Context window size configuration is well-constrained.The
CONTEXT_WINDOW_SIZEfield has appropriate validation (10,000 to 200,000 tokens) and a reasonable default of 100,000. However, there's a missing trailing comma.Apply this diff to fix the formatting:
- CONTEXT_WINDOW_SIZE: Annotated[ - int, Field(default=100_000, gt=10_000, le=200_000) - ] = 100_000 + CONTEXT_WINDOW_SIZE: Annotated[ + int, Field(default=100_000, gt=10_000, le=200_000), + ] = 100_000⛔ Skipped due to learnings
Learnt from: VVoruganti PR: plastic-labs/honcho#164 File: sdks/python/src/honcho/async_client/peer.py:136-136 Timestamp: 2025-07-21T15:53:20.965Z Learning: The honcho repository should have COM812 (trailing comma missing) rule disabled in the root pyproject.toml Ruff configuration by adding it to the existing ignore list: ignore = ["E501", "B008", "COM812"]. The maintainers do not want trailing comma suggestions in code reviews.Learnt from: VVoruganti PR: plastic-labs/honcho#164 File: sdks/python/src/honcho/async_client/peer.py:136-136 Timestamp: 2025-07-21T15:53:20.965Z Learning: The honcho repository maintainers do not want trailing comma suggestions or complaints from static analysis tools like Ruff. The COM812 rule should be disabled in the Ruff configuration to avoid these suggestions in future reviews.Learnt from: Rajat-Ahuja1997 PR: plastic-labs/honcho#144 File: src/embeddings.py:217-224 Timestamp: 2025-06-26T18:33:10.167Z Learning: In the plastic-labs/honcho project, the user's linter enforces spaces around colons in slice notation (e.g., `encoded_tokens[i : i + max_tokens]`), which conflicts with Flake8's E203 rule but is valid Python syntax and preferred by Black formatter.src/crud/document.py (3)
28-28: Optional embedding parameter improves efficiency.The addition of an optional
embeddingparameter allows reuse of pre-computed embeddings, avoiding redundant API calls. This is a good performance optimization.
30-46: Comprehensive docstring improves maintainability.The expanded docstring with detailed parameter descriptions and return type information significantly improves code documentation quality.
69-71: Add trailing comma for consistency.Missing trailing comma should be added for formatting consistency.
Apply this diff:
- stmt = stmt.limit(top_k).order_by( - models.Document.embedding.cosine_distance(embedding) - ) + stmt = stmt.limit(top_k).order_by( + models.Document.embedding.cosine_distance(embedding), + )⛔ Skipped due to learnings
Learnt from: VVoruganti PR: plastic-labs/honcho#164 File: sdks/python/src/honcho/async_client/peer.py:136-136 Timestamp: 2025-07-21T15:53:20.965Z Learning: The honcho repository should have COM812 (trailing comma missing) rule disabled in the root pyproject.toml Ruff configuration by adding it to the existing ignore list: ignore = ["E501", "B008", "COM812"]. The maintainers do not want trailing comma suggestions in code reviews.Learnt from: Rajat-Ahuja1997 PR: plastic-labs/honcho#144 File: tests/integration/test_message_embeddings.py:128-187 Timestamp: 2025-06-26T18:35:46.478Z Learning: The honcho repository does not use trailing commas in function signatures, function calls, or object instantiation. This is consistently applied across the entire codebase including test files, and reviews should not suggest adding trailing commas.src/crud/message.py (2)
38-43: LGTM! Proper use of SessionCreate schema.The change correctly uses the
SessionCreateschema with thenameandpeersfields, which aligns with the schema definition wherepeer_namesis aliased as"peers".
225-251: Well-implemented sequence number calculation.The function correctly computes the 1-indexed sequence number by counting messages with smaller IDs within the same workspace and session. This approach ensures consistent ordering based on the auto-incrementing primary key.
src/dialectic/prompts.py (1)
7-67: Excellent implementation of flexible prompt generation.The changes properly handle optional parameters and dynamically construct the query target description based on whether
target_nameis provided. The newrecent_conversation_historysection is appropriately wrapped in XML-like tags for clear delineation.docs/v2/contributing/configuration.mdx (1)
49-56: Excellent documentation reorganization.The new structure clearly separates LLM provider API keys from feature-specific configurations. The explicit documentation of default providers (Anthropic for dialectic, Groq for query generation, Google for deriver and summarization, OpenAI for embeddings) helps users understand which API keys they need.
Also applies to: 203-288
src/deriver/queue_manager.py (2)
29-48: Well-documented support for different task types.The WorkUnit dataclass changes properly support summary tasks that lack sender/target fields. The documentation clearly explains the rationale for making these fields optional.
370-393: Clean implementation of task-specific message filtering.The conditional filtering based on
task_typeproperly handles summary tasks that don't have sender/target fields in their payload. The logic is clear and maintainable.src/routers/sessions.py (2)
1-1: LGTM! Imports are appropriate.The new imports for
asyncio,config, andtracked_dbare necessary for the concurrent summary retrieval implementation.Also applies to: 9-10
422-439: Excellent concurrent database access pattern!The use of separate tracked database sessions for concurrent summary retrieval is a great performance optimization. The logic correctly selects the longest fitting summary within the token limit.
src/dialectic/utils.py (2)
24-31: Good use of conditional observability.The change from
@observe()to@conditional_observealigns well with the conditional Langfuse integration throughout the codebase.
27-28: Parameter rename improves clarity.The rename from
peer_nametotarget_peer_namebetter describes the parameter's purpose.src/utils/clients.py (4)
100-103: Good addition of AsyncCallResponseCallable protocol.This protocol properly types functions that return the full
llm.CallResponseobject, improving type safety.
141-158: Well-designed overload for return_call_response.The new overload correctly specifies the return type when
return_call_response=True, maintaining type safety.
208-209: The return_call_response parameter is correctly handled.The static analysis warning about unused
return_call_responseis a false positive. The parameter is properly removed fromextra_call_paramsbefore being passed to the underlying LLM call, serving its purpose for the type system.Also applies to: 306-309
336-338: Good conditional Langfuse integration.The Langfuse decorator is now correctly applied only when
LANGFUSE_PUBLIC_KEYis configured, consistent with the observability pattern across the codebase.src/deriver/queue_payload.py (1)
7-35: Excellent refactoring into specialized payload classes.The separation into
BasePayload,RepresentationPayload, andSummaryPayloadimproves type safety and makes the different task types explicit. Theextra="forbid"configuration helps catch schema violations early.tests/bench/run_tests.py (3)
174-247: Innovative semantic judgment implementation.The LLM-based judgment with detailed principles and fallback to string matching is a robust approach for evaluating test responses. The error handling ensures tests don't fail due to judgment errors.
248-542: Complex but well-structured test execution.While the
execute_testmethod is complex, it's necessarily so given the comprehensive test execution requirements. The method handles:
- Session and peer configuration
- Message addition
- Query execution with various scoping options
- Context retrieval with token counting
- Detailed progress reporting
The complexity is justified by the functionality.
695-697: LGTM! Proper async entry point.The use of
asyncio.run(main())and proper exit code handling is correct.src/dialectic/chat.py (1)
236-241: Verify helper availability for dynamic collection names
crud.construct_collection_name(...)is invoked here, but the helper lives insrc/crud/representation.py. Ensure it is re-exported fromsrc/crud/__init__.py; otherwise this will raiseAttributeErrorat runtime.src/deriver/enqueue.py (1)
248-256: Guard against double-enqueuing summary tasksIf
MESSAGES_PER_SHORT_SUMMARYdivides evenly intoMESSAGES_PER_LONG_SUMMARY, the same message will enqueue two summary jobs. Add anelifor build the conditions into one check to prevent duplicates.⛔ Skipped due to learnings
Learnt from: CR PR: plastic-labs/honcho#0 File: CLAUDE.md:0-0 Timestamp: 2025-07-21T14:51:09.913Z Learning: Applies to src/utils/history.py : Session history summarization: short every 20 messages, long every 60src/deriver/deriver.py (1)
240-246: Minor style: add trailing commasRuff flags several constructor/tuple literals missing a trailing comma (COM812). Adding them keeps Black/ruff in sync and reduces diff churn.
Also applies to: 260-266, 420-423
⛔ Skipped due to learnings
Learnt from: VVoruganti PR: plastic-labs/honcho#164 File: sdks/python/src/honcho/async_client/peer.py:136-136 Timestamp: 2025-07-21T15:53:20.965Z Learning: The honcho repository maintainers do not want trailing comma suggestions or complaints from static analysis tools like Ruff. The COM812 rule should be disabled in the Ruff configuration to avoid these suggestions in future reviews.Learnt from: VVoruganti PR: plastic-labs/honcho#164 File: sdks/python/src/honcho/async_client/peer.py:136-136 Timestamp: 2025-07-21T15:53:20.965Z Learning: The honcho repository should have COM812 (trailing comma missing) rule disabled in the root pyproject.toml Ruff configuration by adding it to the existing ignore list: ignore = ["E501", "B008", "COM812"]. The maintainers do not want trailing comma suggestions in code reviews.Learnt from: Rajat-Ahuja1997 PR: plastic-labs/honcho#144 File: tests/integration/test_message_embeddings.py:128-187 Timestamp: 2025-06-26T18:35:46.478Z Learning: The honcho repository does not use trailing commas in function signatures, function calls, or object instantiation. This is consistently applied across the entire codebase including test files, and reviews should not suggest adding trailing commas.Learnt from: Rajat-Ahuja1997 PR: plastic-labs/honcho#144 File: src/embeddings.py:217-224 Timestamp: 2025-06-26T18:33:10.167Z Learning: In the plastic-labs/honcho project, the user's linter enforces spaces around colons in slice notation (e.g., `encoded_tokens[i : i + max_tokens]`), which conflicts with Flake8's E203 rule but is valid Python syntax and preferred by Black formatter.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Documentation
Refactor
Chores