Skip to content

expose core client in TS and Python SDKs#150

Merged
dr-frmr merged 6 commits into
ben/search-rrffrom
rajat/expose-core-client-in-SDKs
Aug 6, 2025
Merged

expose core client in TS and Python SDKs#150
dr-frmr merged 6 commits into
ben/search-rrffrom
rajat/expose-core-client-in-SDKs

Conversation

@Rajat-Ahuja1997

@Rajat-Ahuja1997 Rajat-Ahuja1997 commented Jun 30, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added a new property to the Python and TypeScript SDK clients that allows advanced users to access the underlying core client directly for extended functionality.
  • Documentation
    • Enhanced class documentation and property descriptions with usage examples for the new core client access.
  • Style
    • Reordered dependencies in the TypeScript SDK package configuration (no impact on functionality).

@coderabbitai

coderabbitai Bot commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Read-only core properties were added to the main SDK client classes in both Python and TypeScript, exposing access to the underlying core client for advanced use cases. Documentation and usage examples were updated accordingly. Additionally, the TypeScript package.json dependencies were reordered by moving @honcho-ai/core to the first position without functional changes.

Changes

Cohort / File(s) Change Summary
Python SDK Client: Add core Property
sdks/python/src/honcho/async_client/client.py, sdks/python/src/honcho/client.py
Added a read-only core property to both AsyncHoncho and Honcho classes, exposing the underlying core client. Updated class docstrings and added usage examples.
TypeScript SDK Client: Add core Getter
sdks/typescript/src/client.ts
Added a public core getter to the Honcho class, exposing the raw core client. Enhanced documentation and included usage examples.
TypeScript Package Dependency Reordering
sdks/typescript/package.json
Reordered dependencies: moved @honcho-ai/core to the first position. No functional impact.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

In the warren where code bunnies dwell,
We’ve tunneled a shortcut, a secret as well—
Now “core” is exposed for the clever and bold,
Advanced tricks await, just as foretold!
With docs and examples, your journey’s a breeze,
Hop on, dear devs, and code as you please!
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rajat/expose-core-client-in-SDKs

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

_client: AsyncHonchoCore = PrivateAttr()

@property
def core(self) -> AsyncHonchoCore:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open to renaming this. alternatives could be raw, client, native

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2e6ed9 and 39b7dcb.

📒 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 core property 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 core property.

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 core property.


17-34: Excellent TypeScript implementation.

The core getter 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

Comment thread sdks/python/src/honcho/async_client/client.py
Comment thread sdks/python/src/honcho/client.py
@dr-frmr dr-frmr reopened this Aug 4, 2025
dr-frmr added 2 commits August 5, 2025 13:44
…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
dr-frmr previously approved these changes Aug 5, 2025

@dr-frmr dr-frmr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like core. Resolved conflicts, LGTM. Already bumped library versions in my PR

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
sdks/python/src/honcho/client.py (1)

47-65: LGTM! Well-implemented core property exposure.

The core property 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 core property 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

📥 Commits

Reviewing files that changed from the base of the PR and between 39b7dcb and 21e0c77.

📒 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 core getter 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.

Comment thread sdks/typescript/package.json Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21e0c77 and b0f2385.

📒 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.

Comment on lines 24 to 25
"@types/node": "^24.0.1",
"@honcho-ai/core": "1.2.0"
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
"@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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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.

@dr-frmr dr-frmr changed the base branch from main to ben/search-rrf August 6, 2025 17:18
@dr-frmr dr-frmr merged commit 84f7b15 into ben/search-rrf Aug 6, 2025
3 checks passed
@dr-frmr dr-frmr deleted the rajat/expose-core-client-in-SDKs branch August 6, 2025 17:19
@coderabbitai coderabbitai Bot mentioned this pull request Aug 6, 2025
VVoruganti pushed a commit that referenced this pull request Aug 6, 2025
* 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>
VVoruganti pushed a commit that referenced this pull request Aug 12, 2025
* 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>
ranc1 pushed a commit to ranc1/honcho that referenced this pull request Apr 16, 2026
* 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>
ranc1 pushed a commit to ranc1/honcho that referenced this pull request Apr 16, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants