expose core client in TS and Python SDKs#150
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughRead-only Changes
Sequence Diagram(s)sequenceDiagram
participant UserApp
participant SDKClient
participant CoreClient
UserApp->>SDKClient: Instantiate SDK client
UserApp->>SDKClient: Access .core property
SDKClient->>CoreClient: Return underlying core client instance
UserApp->>CoreClient: Call advanced/core methods directly
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
✨ 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. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| _client: AsyncHonchoCore = PrivateAttr() | ||
|
|
||
| @property | ||
| def core(self) -> AsyncHonchoCore: |
There was a problem hiding this comment.
open to renaming this. alternatives could be raw, client, native
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
sdks/python/pyproject.toml(1 hunks)sdks/python/src/honcho/async_client/client.py(2 hunks)sdks/python/src/honcho/client.py(2 hunks)sdks/typescript/package.json(3 hunks)sdks/typescript/src/client.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Rajat-Ahuja1997
PR: plastic-labs/honcho#144
File: src/crud.py:1250-1250
Timestamp: 2025-06-26T18:39:54.908Z
Learning: Rajat-Ahuja1997 is comfortable exposing token counts in MessageCreate schema as a public property when it improves code maintainability and avoids type checking errors.
sdks/python/pyproject.toml (1)
Learnt from: VVoruganti
PR: plastic-labs/honcho#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.
sdks/typescript/src/client.ts (1)
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.
🧬 Code Graph Analysis (3)
sdks/python/src/honcho/client.py (2)
sdks/typescript/src/client.ts (1)
core(32-34)sdks/python/src/honcho/async_client/client.py (1)
core(45-62)
sdks/python/src/honcho/async_client/client.py (2)
sdks/typescript/src/client.ts (1)
core(32-34)sdks/python/src/honcho/client.py (1)
core(44-61)
sdks/typescript/src/client.ts (1)
sdks/python/src/honcho/client.py (1)
Honcho(18-328)
🪛 Pylint (3.3.7)
sdks/python/src/honcho/client.py
[convention] 46-46: Line too long (111/100)
(C0301)
sdks/python/src/honcho/async_client/client.py
[convention] 47-47: Line too long (111/100)
(C0301)
🔇 Additional comments (6)
sdks/typescript/package.json (1)
3-3: Appropriate version bump for new feature.The version bump to 1.2.0 correctly reflects the addition of the new
coreproperty across the SDK clients, following semantic versioning for a minor feature addition.sdks/python/pyproject.toml (1)
3-3: Consistent version bump across SDKs.The version bump to 1.2.0 maintains consistency with the TypeScript SDK and appropriately reflects the new core property feature.
sdks/python/src/honcho/async_client/client.py (1)
27-28: Well-documented class enhancement.The class-level documentation updates clearly communicate the new advanced usage capability through the
coreproperty.Also applies to: 34-34
sdks/typescript/src/client.ts (2)
9-11: Clear documentation enhancement.The class-level documentation update effectively communicates the new advanced usage option through the
coreproperty.
17-34: Excellent TypeScript implementation.The
coregetter provides clean access to the underlying HonchoCore client with comprehensive JSDoc documentation and a practical usage example. The implementation maintains consistency with the Python SDK implementations while following TypeScript conventions appropriately.sdks/python/src/honcho/client.py (1)
26-27: Consistent class documentation.The class-level documentation updates maintain consistency with the async client and clearly communicate the advanced usage capability.
Also applies to: 33-33
…nfig (#176) * fix: resolve get_effective_observe me race condition, default peer config * fix: preserve custom config even after leaving * chore: test cases, enqueue types
dr-frmr
left a comment
There was a problem hiding this comment.
I like core. Resolved conflicts, LGTM. Already bumped library versions in my PR
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
sdks/python/src/honcho/client.py (1)
47-65: LGTM! Well-implemented core property exposure.The
coreproperty provides clean access to the underlying HonchoCore client with comprehensive documentation and a practical example. The implementation correctly exposes the raw client for advanced usage scenarios.sdks/python/src/honcho/async_client/client.py (1)
49-67: Excellent async core property implementation.The
coreproperty correctly exposes the AsyncHonchoCore client with comprehensive documentation and proper async example usage. The implementation maintains consistency with the synchronous client while providing the appropriate async interface.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
sdks/python/src/honcho/async_client/client.py(2 hunks)sdks/python/src/honcho/client.py(2 hunks)sdks/typescript/package.json(2 hunks)sdks/typescript/src/client.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Rajat-Ahuja1997
PR: plastic-labs/honcho#144
File: src/crud.py:1250-1250
Timestamp: 2025-06-26T18:39:54.942Z
Learning: Rajat-Ahuja1997 is comfortable exposing token counts in MessageCreate schema as a public property when it improves code maintainability and avoids type checking errors.
Learnt from: dr-frmr
PR: plastic-labs/honcho#160
File: sdks/typescript/package.json:21-22
Timestamp: 2025-07-16T21:28:04.503Z
Learning: The user dr-frmr prefers exact version pinning for dependencies in the TypeScript SDK package.json rather than using semver ranges, indicating they want explicit control over dependency updates.
📚 Learning: the user dr-frmr prefers exact version pinning for dependencies in the typescript sdk package.json r...
Learnt from: dr-frmr
PR: plastic-labs/honcho#160
File: sdks/typescript/package.json:21-22
Timestamp: 2025-07-16T21:28:04.503Z
Learning: The user dr-frmr prefers exact version pinning for dependencies in the TypeScript SDK package.json rather than using semver ranges, indicating they want explicit control over dependency updates.
Applied to files:
sdks/typescript/package.json
📚 Learning: the honcho project prefers upsert behavior for update operations across all resources (sessions, pee...
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.
Applied to files:
sdks/typescript/src/client.ts
🪛 GitHub Actions: FastAPI Tests with PostgreSQL and uv
sdks/typescript/package.json
[error] 24-24: ParserError parsing package.json: Expected "," but found "@types/node"; Expected string but found ":"; Expected " =" but found "^24.0.1"; Unexpected comma at line 24.
🔇 Additional comments (1)
sdks/typescript/src/client.ts (1)
17-34: Excellent TypeScript core property implementation.The
coregetter provides clean access to the underlying HonchoCore client with comprehensive JSDoc documentation and a practical example. The TypeScript implementation maintains excellent consistency with the Python SDKs while using appropriate getter syntax and correct type annotations.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
sdks/typescript/package.json(2 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Rajat-Ahuja1997
PR: plastic-labs/honcho#144
File: src/crud.py:1250-1250
Timestamp: 2025-06-26T18:39:54.942Z
Learning: Rajat-Ahuja1997 is comfortable exposing token counts in MessageCreate schema as a public property when it improves code maintainability and avoids type checking errors.
Learnt from: dr-frmr
PR: plastic-labs/honcho#160
File: sdks/typescript/package.json:21-22
Timestamp: 2025-07-16T21:28:04.503Z
Learning: The user dr-frmr prefers exact version pinning for dependencies in the TypeScript SDK package.json rather than using semver ranges, indicating they want explicit control over dependency updates.
📚 Learning: the user dr-frmr prefers exact version pinning for dependencies in the typescript sdk package.json r...
Learnt from: dr-frmr
PR: plastic-labs/honcho#160
File: sdks/typescript/package.json:21-22
Timestamp: 2025-07-16T21:28:04.503Z
Learning: The user dr-frmr prefers exact version pinning for dependencies in the TypeScript SDK package.json rather than using semver ranges, indicating they want explicit control over dependency updates.
Applied to files:
sdks/typescript/package.json
📚 Learning: the honcho repository should have com812 (trailing comma missing) rule disabled in the root pyprojec...
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.
Applied to files:
sdks/typescript/package.json
📚 Learning: the honcho repository does not use trailing commas in function signatures, function calls, or object...
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.
Applied to files:
sdks/typescript/package.json
📚 Learning: the honcho repository maintainers do not want trailing comma suggestions or complaints from static a...
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.
Applied to files:
sdks/typescript/package.json
🪛 GitHub Actions: FastAPI Tests with PostgreSQL and uv
sdks/typescript/package.json
[error] 1-1: SyntaxError: Expected double-quoted property name in JSON at position 677. JSON parsing failed preventing tests from running.
| "@types/node": "^24.0.1", | ||
| "@honcho-ai/core": "1.2.0" | ||
| }, |
There was a problem hiding this comment.
Invalid trailing comma breaks package.json parsing
package.json must be valid JSON. The comma after the last property ("@types/node") violates the JSON grammar and is the direct cause of the pipeline parse error.
- "@types/node": "^24.0.1",
+ "@types/node": "^24.0.1"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "@types/node": "^24.0.1", | |
| "@honcho-ai/core": "1.2.0" | |
| }, | |
| "@types/node": "^24.0.1" | |
| }, |
🤖 Prompt for AI Agents
In sdks/typescript/package.json at lines 24 to 25, remove the trailing comma
after the last property "@types/node" to ensure the file is valid JSON and
prevent parsing errors in the pipeline.
| }, | ||
| "dependencies": { | ||
| "@honcho-ai/core": "1.2.0", | ||
| "@types/node": "^24.0.1", |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Consider exact-version pinning for consistency with repository conventions
The project’s maintainers have previously expressed a preference for exact version pins in this file (see long-term learning from dr-frmr). To stay consistent, change the caret range to an exact version:
- "@types/node": "^24.0.1"
+ "@types/node": "24.0.1"Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In sdks/typescript/package.json at line 24, change the dependency version for
"@types/node" from a caret range "^24.0.1" to an exact version "24.0.1" to align
with the project's convention of exact-version pinning for consistency.
* chore: fill out missing metadata inputs in python sdk * feat: add get_peer_config to python sdk, thoroughly document ts sdk and remove bad client usage * feat: zod chore: update tests chore: bump version, changelog * chore: python sdk version bump and changelog * [WIP] feat: combine search methods and rework endpoint to include limit param * chore: test new stainless config with library * nits: coderabbit * Merge branch 'ben/sdk-improvements' into ben/search-rrf * chore: pre-commit hooks cleanup * feat: thoroughly document observation config * Update sdks/python/src/honcho/peer.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: v1.3.0 * feat: update version to 2.2.0 and enhance search functionality with arbitrary filters - Remove unused config variables - Added arbitrary filters to all search endpoints. - Pluralize `filters` everywhere in SDKs for consistency - Updated documentation and changelog to reflect these changes. * expose core client in TS and Python SDKs (#150) * expose core client from sdks * align text * fix: resolve get_effective_observe me race condition, default peer config (#176) * fix: resolve get_effective_observe me race condition, default peer config * fix: preserve custom config even after leaving * chore: test cases, enqueue types * Update sdks/typescript/package.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: formatting * chore: revert undesired changes to v1 spec, clean up docs, coderabbit * feat: better search docs, fix worker.ts * fix: correctly make ts params optional in cases, update docs * chore: coderabbit * chore: remove spurious package-lock * fix: asyncify examples, use limit properly in search * fix(tests): handle 4 return values in test_get_session_peer_configuration --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
* chore: fill out missing metadata inputs in python sdk * feat: add get_peer_config to python sdk, thoroughly document ts sdk and remove bad client usage * feat: zod chore: update tests chore: bump version, changelog * chore: python sdk version bump and changelog * [WIP] feat: combine search methods and rework endpoint to include limit param * chore: test new stainless config with library * nits: coderabbit * Merge branch 'ben/sdk-improvements' into ben/search-rrf * chore: pre-commit hooks cleanup * feat: thoroughly document observation config * Update sdks/python/src/honcho/peer.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: v1.3.0 * feat: update version to 2.2.0 and enhance search functionality with arbitrary filters - Remove unused config variables - Added arbitrary filters to all search endpoints. - Pluralize `filters` everywhere in SDKs for consistency - Updated documentation and changelog to reflect these changes. * expose core client in TS and Python SDKs (#150) * expose core client from sdks * align text * fix: resolve get_effective_observe me race condition, default peer config (#176) * fix: resolve get_effective_observe me race condition, default peer config * fix: preserve custom config even after leaving * chore: test cases, enqueue types * Update sdks/typescript/package.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: formatting * chore: revert undesired changes to v1 spec, clean up docs, coderabbit * feat: better search docs, fix worker.ts * fix: correctly make ts params optional in cases, update docs * chore: coderabbit * chore: remove spurious package-lock * feat: [WIP] introduce peer cards * chore: remove search.mdx * chore: clean up deriver * feat: peer cards working in deriver * feat: add basic peer_card_bench * feat: refine peer card prompt, add mini-benchmark, switch to gpt-5-nano * refactor: update peer card handling in dialectic functions and improve error handling - Enhanced `get_peer_card` function to handle `ResourceNotFoundException`. - Updated `dialectic_call` and `dialectic_stream` to accept `peer_card` and `target_peer_card` parameters. - Modified prompt generation to include peer card information. - Cleaned up whitespace in several files for consistency. * chore: update mirascope dependency version in configuration files - Bumped mirascope version from 1.25.1 to 1.25.5 in pyproject.toml and uv.lock. - Added a note in config.py regarding peer card output token handling. - Removed unnecessary comments in clients.py for clarity. * fix: [coderabbit] improve error handling in set_peer_card and enhance logging - Added a check in `set_peer_card` to raise `ResourceNotFoundException` if the peer does not exist. - Updated logging in `CertaintyReasoner` to capture exceptions with Sentry when enabled. - Refined logging messages for clarity and consistency across various functions. - Cleaned up whitespace and formatting in several files for improved readability. * refactor: update working representation handling and improve metadata key usage - Introduced constants for representation collection names to enhance clarity and maintainability. - Updated function signatures in `get_working_representation` and `set_working_representation` to require `session_name`. - Simplified metadata key determination logic by using constants instead of hardcoded strings. - Removed legacy fallback logic for working representation data retrieval. - Refactored `save_working_representation_to_peer` to utilize the new `set_working_representation` function for improved code reuse. * chore: update configuration files and enhance working representation settings - Added new peer card settings and context token limits to `.env.template`, `config.toml.example`, and documentation. - Introduced `WORKING_REPRESENTATION_MAX_OBSERVATIONS` to `DeriverSettings` for better control over observation storage. - Updated `set_working_representation` to merge new observations while respecting the maximum limit. - Improved docstrings for clarity and consistency across functions. * feat: introduce LLMError exception and enhance error handling in deriver - Added LLMError exception to handle failures in LLM calls, normalizing inputs into a JSON-serializable format. - Updated CertaintyReasoner to raise LLMError on exceptions during LLM function calls. - Enhanced QueueManager to log LLMError occurrences and re-queue messages appropriately. - Modified test runner to support asynchronous operations and improved output formatting for test results. - Updated test cases to include session information for better context. * feat: add __repr__ method to QueueItem for improved string representation - Implemented a __repr__ method in the QueueItem class to provide a clear and informative string representation of its attributes. - Updated timeout handling in TestRunner to default to 10000.0 seconds when timeout_seconds is not set, enhancing robustness in polling operations. * refactor: update peer card data structure and improve handling in related functions - Changed return type of `get_peer_card` and `set_peer_card` to use `list[str]` instead of `str | None`. - Updated `peer_card_call` and related functions to accommodate the new list structure for peer cards. - Introduced `PeerCardQuery` model to standardize responses from peer card queries. - Adjusted prompt generation in `peer_card_prompt` to reflect the new data structure. - Modified benchmark tests to align with the updated peer card handling. * refactor: adjust peer card output token settings and update related functions - Increased `PEER_CARD_MAX_OUTPUT_TOKENS` from 2000 to 4000 in `DeriverSettings`. - Updated `critical_analysis_call` to use `json_mode` and removed unused parameters. - Modified benchmark tests to utilize the new `PEER_CARD_MAX_OUTPUT_TOKENS` setting. - Removed obsolete `add_dislike.json` test file. * refactor: update peer card handling in critical analysis and dialectic prompts - Changed `peer_card` parameter type from `str | None` to `list[str] | None` in `critical_analysis_call` and related functions. - Simplified error handling in `process_representation_task` by removing redundant try-except block. - Updated prompt generation in `critical_analysis_prompt` and `dialectic_prompt` to format `peer_card` as a string with newlines. - Adjusted benchmark tests to reflect changes in peer card structure and output formatting. * refactor: update peer card test cases to use list structure - Modified test cases in `test_representation_crud.py` to reflect the change in `peer_card` parameter type from `str` to `list[str]`. - Updated assertions to accommodate the new list format for setting and retrieving peer cards. - Ensured that tests for missing peers correctly handle the list input format. * fix: improve formatting of peer card output in prompts - Updated `peer_card_prompt` to join `old_peer_card` list elements with newlines for better readability. - Removed outdated comment in `dialectic_prompt` regarding handling of non-existent cards. * chore: [coderabbit] enhance docstring and logging in prompts and queue manager - Updated the docstring in `critical_analysis_prompt` to provide detailed type annotations for parameters. - Improved logging in `chat` to differentiate between single and multiple retrieved peer cards. - Adjusted logging format in `QueueManager` to use a more structured approach for shutdown messages. --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
* chore: fill out missing metadata inputs in python sdk * feat: add get_peer_config to python sdk, thoroughly document ts sdk and remove bad client usage * feat: zod chore: update tests chore: bump version, changelog * chore: python sdk version bump and changelog * [WIP] feat: combine search methods and rework endpoint to include limit param * chore: test new stainless config with library * nits: coderabbit * Merge branch 'ben/sdk-improvements' into ben/search-rrf * chore: pre-commit hooks cleanup * feat: thoroughly document observation config * Update sdks/python/src/honcho/peer.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: v1.3.0 * feat: update version to 2.2.0 and enhance search functionality with arbitrary filters - Remove unused config variables - Added arbitrary filters to all search endpoints. - Pluralize `filters` everywhere in SDKs for consistency - Updated documentation and changelog to reflect these changes. * expose core client in TS and Python SDKs (plastic-labs#150) * expose core client from sdks * align text * fix: resolve get_effective_observe me race condition, default peer config (plastic-labs#176) * fix: resolve get_effective_observe me race condition, default peer config * fix: preserve custom config even after leaving * chore: test cases, enqueue types * Update sdks/typescript/package.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: formatting * chore: revert undesired changes to v1 spec, clean up docs, coderabbit * feat: better search docs, fix worker.ts * fix: correctly make ts params optional in cases, update docs * chore: coderabbit * chore: remove spurious package-lock * fix: asyncify examples, use limit properly in search * fix(tests): handle 4 return values in test_get_session_peer_configuration --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
* chore: fill out missing metadata inputs in python sdk * feat: add get_peer_config to python sdk, thoroughly document ts sdk and remove bad client usage * feat: zod chore: update tests chore: bump version, changelog * chore: python sdk version bump and changelog * [WIP] feat: combine search methods and rework endpoint to include limit param * chore: test new stainless config with library * nits: coderabbit * Merge branch 'ben/sdk-improvements' into ben/search-rrf * chore: pre-commit hooks cleanup * feat: thoroughly document observation config * Update sdks/python/src/honcho/peer.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: v1.3.0 * feat: update version to 2.2.0 and enhance search functionality with arbitrary filters - Remove unused config variables - Added arbitrary filters to all search endpoints. - Pluralize `filters` everywhere in SDKs for consistency - Updated documentation and changelog to reflect these changes. * expose core client in TS and Python SDKs (plastic-labs#150) * expose core client from sdks * align text * fix: resolve get_effective_observe me race condition, default peer config (plastic-labs#176) * fix: resolve get_effective_observe me race condition, default peer config * fix: preserve custom config even after leaving * chore: test cases, enqueue types * Update sdks/typescript/package.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: formatting * chore: revert undesired changes to v1 spec, clean up docs, coderabbit * feat: better search docs, fix worker.ts * fix: correctly make ts params optional in cases, update docs * chore: coderabbit * chore: remove spurious package-lock * feat: [WIP] introduce peer cards * chore: remove search.mdx * chore: clean up deriver * feat: peer cards working in deriver * feat: add basic peer_card_bench * feat: refine peer card prompt, add mini-benchmark, switch to gpt-5-nano * refactor: update peer card handling in dialectic functions and improve error handling - Enhanced `get_peer_card` function to handle `ResourceNotFoundException`. - Updated `dialectic_call` and `dialectic_stream` to accept `peer_card` and `target_peer_card` parameters. - Modified prompt generation to include peer card information. - Cleaned up whitespace in several files for consistency. * chore: update mirascope dependency version in configuration files - Bumped mirascope version from 1.25.1 to 1.25.5 in pyproject.toml and uv.lock. - Added a note in config.py regarding peer card output token handling. - Removed unnecessary comments in clients.py for clarity. * fix: [coderabbit] improve error handling in set_peer_card and enhance logging - Added a check in `set_peer_card` to raise `ResourceNotFoundException` if the peer does not exist. - Updated logging in `CertaintyReasoner` to capture exceptions with Sentry when enabled. - Refined logging messages for clarity and consistency across various functions. - Cleaned up whitespace and formatting in several files for improved readability. * refactor: update working representation handling and improve metadata key usage - Introduced constants for representation collection names to enhance clarity and maintainability. - Updated function signatures in `get_working_representation` and `set_working_representation` to require `session_name`. - Simplified metadata key determination logic by using constants instead of hardcoded strings. - Removed legacy fallback logic for working representation data retrieval. - Refactored `save_working_representation_to_peer` to utilize the new `set_working_representation` function for improved code reuse. * chore: update configuration files and enhance working representation settings - Added new peer card settings and context token limits to `.env.template`, `config.toml.example`, and documentation. - Introduced `WORKING_REPRESENTATION_MAX_OBSERVATIONS` to `DeriverSettings` for better control over observation storage. - Updated `set_working_representation` to merge new observations while respecting the maximum limit. - Improved docstrings for clarity and consistency across functions. * feat: introduce LLMError exception and enhance error handling in deriver - Added LLMError exception to handle failures in LLM calls, normalizing inputs into a JSON-serializable format. - Updated CertaintyReasoner to raise LLMError on exceptions during LLM function calls. - Enhanced QueueManager to log LLMError occurrences and re-queue messages appropriately. - Modified test runner to support asynchronous operations and improved output formatting for test results. - Updated test cases to include session information for better context. * feat: add __repr__ method to QueueItem for improved string representation - Implemented a __repr__ method in the QueueItem class to provide a clear and informative string representation of its attributes. - Updated timeout handling in TestRunner to default to 10000.0 seconds when timeout_seconds is not set, enhancing robustness in polling operations. * refactor: update peer card data structure and improve handling in related functions - Changed return type of `get_peer_card` and `set_peer_card` to use `list[str]` instead of `str | None`. - Updated `peer_card_call` and related functions to accommodate the new list structure for peer cards. - Introduced `PeerCardQuery` model to standardize responses from peer card queries. - Adjusted prompt generation in `peer_card_prompt` to reflect the new data structure. - Modified benchmark tests to align with the updated peer card handling. * refactor: adjust peer card output token settings and update related functions - Increased `PEER_CARD_MAX_OUTPUT_TOKENS` from 2000 to 4000 in `DeriverSettings`. - Updated `critical_analysis_call` to use `json_mode` and removed unused parameters. - Modified benchmark tests to utilize the new `PEER_CARD_MAX_OUTPUT_TOKENS` setting. - Removed obsolete `add_dislike.json` test file. * refactor: update peer card handling in critical analysis and dialectic prompts - Changed `peer_card` parameter type from `str | None` to `list[str] | None` in `critical_analysis_call` and related functions. - Simplified error handling in `process_representation_task` by removing redundant try-except block. - Updated prompt generation in `critical_analysis_prompt` and `dialectic_prompt` to format `peer_card` as a string with newlines. - Adjusted benchmark tests to reflect changes in peer card structure and output formatting. * refactor: update peer card test cases to use list structure - Modified test cases in `test_representation_crud.py` to reflect the change in `peer_card` parameter type from `str` to `list[str]`. - Updated assertions to accommodate the new list format for setting and retrieving peer cards. - Ensured that tests for missing peers correctly handle the list input format. * fix: improve formatting of peer card output in prompts - Updated `peer_card_prompt` to join `old_peer_card` list elements with newlines for better readability. - Removed outdated comment in `dialectic_prompt` regarding handling of non-existent cards. * chore: [coderabbit] enhance docstring and logging in prompts and queue manager - Updated the docstring in `critical_analysis_prompt` to provide detailed type annotations for parameters. - Improved logging in `chat` to differentiate between single and multiple retrieved peer cards. - Adjusted logging format in `QueueManager` to use a more structured approach for shutdown messages. --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
Summary by CodeRabbit