Skip to content

Commit 68d88bd

Browse files
2 parents 2b6035c + e487358 commit 68d88bd

77 files changed

Lines changed: 3682 additions & 3468 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/honcho-integration/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ response = peer.chat("What does this user prefer?")
139139
# Async usage (FastAPI, Starlette)
140140
from honcho import Honcho
141141
honcho = Honcho(workspace_id="my-app", api_key=os.environ["HONCHO_API_KEY"])
142-
peer = honcho.aio.peer("user-123")
143-
response = await peer.chat("What does this user prefer?")
142+
peer = await honcho.aio.peer("user-123")
143+
response = await peer.aio.chat("What does this user prefer?")
144144
```
145145

146146
Match the client to the framework — check whether the codebase uses `async def` handlers or sync `def` handlers and choose accordingly. The rest of this skill shows sync Python examples; swap to `.aio` equivalents for async codebases.
@@ -188,7 +188,7 @@ Create peers for **every entity** in your business logic - users AND AI assistan
188188
**Python:**
189189

190190
```python
191-
from honcho import PeerConfig
191+
from honcho.api_types import PeerConfig
192192

193193
# Human users
194194
user = honcho.peer("user-123")

.claude/skills/honcho-integration/references/bot-frameworks/nanobot/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
if TYPE_CHECKING:
1515
from honcho import Honcho
16-
from honcho.session import SessionPeerConfig
16+
from honcho.api_types import SessionPeerConfig
1717

1818

1919
@dataclass
@@ -101,7 +101,7 @@ def _get_or_create_peer(self, peer_id: str) -> Any:
101101
"""
102102
Get or create a Honcho peer.
103103
104-
Peers are lazy -- no API call until first use.
104+
As of v2.1.0, peer() always makes a get-or-create API call.
105105
Observation settings are controlled per-session via SessionPeerConfig.
106106
107107
Args:
@@ -138,7 +138,7 @@ def _get_or_create_honcho_session(
138138
session = self.honcho.session(session_id)
139139

140140
# Configure peer observation settings
141-
from honcho.session import SessionPeerConfig
141+
from honcho.api_types import SessionPeerConfig
142142
user_config = SessionPeerConfig(observe_me=True, observe_others=True)
143143
ai_config = SessionPeerConfig(observe_me=False, observe_others=True)
144144

.claude/skills/migrate-honcho-py/DETAILED-CHANGES.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,3 +476,132 @@ from honcho.api_types import SessionPeerConfig
476476
```
477477

478478
**Note:** `MessageCreateParam` (singular) is now `MessageCreateParams` (plural).
479+
480+
---
481+
482+
## 14. Card Method Deprecation and set_card (v2.0.1)
483+
484+
### Before (v2.0.0)
485+
486+
```python
487+
card: list[str] | None = peer.card()
488+
```
489+
490+
### After (v2.0.1+)
491+
492+
```python
493+
# get_card() is the preferred method
494+
card: list[str] | None = peer.get_card()
495+
496+
# card() still works but emits a deprecation warning
497+
card = peer.card() # Deprecated
498+
499+
# New: set_card()
500+
updated = peer.set_card(["Fact 1", "Fact 2"])
501+
updated = peer.set_card(["Fact 1"], target="other-peer")
502+
503+
# Async variants
504+
card = await peer.aio.get_card()
505+
await peer.aio.set_card(["Fact 1"])
506+
```
507+
508+
---
509+
510+
## 15. Strict Input Validation (v2.0.2)
511+
512+
All Pydantic input models now use `extra="forbid"`, raising `ValidationError` for unknown fields.
513+
514+
```python
515+
from honcho.api_types import PeerConfig
516+
517+
# This now raises ValidationError instead of silently ignoring the typo
518+
PeerConfig(observe_mee=True) # ValidationError: extra fields not permitted
519+
```
520+
521+
---
522+
523+
## 16. peer() and session() Always Make API Calls (v2.1.0)
524+
525+
### Before (v2.0.x)
526+
527+
```python
528+
# Without options: lazy object, no API call
529+
peer = client.peer("user-123")
530+
# peer.created_at was None
531+
532+
# With options: made API call
533+
peer = client.peer("user-123", metadata={"key": "value"})
534+
```
535+
536+
### After (v2.1.0+)
537+
538+
```python
539+
# Always makes a get-or-create API call
540+
peer = client.peer("user-123")
541+
# peer.created_at is now always populated
542+
543+
# Async
544+
peer = await client.aio.peer("user-123")
545+
```
546+
547+
All Peer/Session objects now have `created_at` populated immediately after construction.
548+
549+
---
550+
551+
## 17. New Properties: created_at, is_active (v2.1.0)
552+
553+
```python
554+
# Peer
555+
peer = client.peer("user-123")
556+
print(peer.created_at) # datetime | None
557+
558+
# Session
559+
session = client.session("sess-1")
560+
print(session.created_at) # datetime | None
561+
print(session.is_active) # bool | None
562+
563+
# These are refreshed by get_metadata(), get_configuration(), and refresh()
564+
peer.refresh()
565+
session.refresh()
566+
```
567+
568+
---
569+
570+
## 18. get_message() on Session (v2.1.0)
571+
572+
```python
573+
# Fetch a single message by ID
574+
msg = session.get_message("msg-abc123")
575+
print(msg.content, msg.created_at)
576+
577+
# Async
578+
msg = await session.aio.get_message("msg-abc123")
579+
```
580+
581+
---
582+
583+
## 19. Pagination Parameters (v2.1.0)
584+
585+
All list methods now accept `page`, `size`, and `reverse`:
586+
587+
```python
588+
# Defaults: page=1, size=50, reverse=False
589+
peers_page = client.peers(page=2, size=25, reverse=True)
590+
591+
# Returns SyncPage / AsyncPage with:
592+
print(peers_page.total) # Total items
593+
print(peers_page.pages) # Total pages
594+
print(peers_page.has_next_page())
595+
596+
# Works on:
597+
# client.peers(), client.sessions()
598+
# peer.sessions()
599+
# session.messages()
600+
# scope.list()
601+
```
602+
603+
---
604+
605+
## 20. Broader HTTP Retry Logic (v2.1.1)
606+
607+
The SDK now catches `httpx.NetworkError` and `httpx.RemoteProtocolError` for retry in addition to `httpx.TimeoutException` and `httpx.ConnectError`. This is transparent — no code changes needed.

.claude/skills/migrate-honcho-py/MIGRATION-CHECKLIST.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Use this checklist to track migration progress. Copy into your working notes and
44

55
## Dependencies
66

7-
- [ ] Update `honcho` package to v2.0.0
7+
- [ ] Update `honcho` package to v2.1.1
88
- [ ] Remove any `honcho-core` imports
99

1010
## Async Architecture Changes
@@ -113,6 +113,39 @@ Use this checklist to track migration progress. Copy into your working notes and
113113
- `UnprocessableEntityError`, `RateLimitError`, `ServerError`
114114
- `TimeoutError`, `ConnectionError`
115115

116+
## Card Method Updates (v2.0.1)
117+
118+
- [ ] Replace `peer.card()` with `peer.get_card()` (card() is deprecated)
119+
- [ ] Use `peer.set_card(list[str])` if setting peer cards
120+
121+
## Strict Validation (v2.0.2)
122+
123+
- [ ] Verify no input models pass unknown/misspelled fields (now raises `ValidationError`)
124+
- [ ] Check for typos in `PeerConfig`, `SessionConfiguration`, `WorkspaceConfiguration` fields
125+
126+
## peer() / session() API Call Change (v2.1.0)
127+
128+
- [ ] Update code that relied on lazy `peer()` / `session()` — they now always make API calls
129+
- [ ] Add `await` if using async and previously didn't need it for lazy construction
130+
131+
## New Properties (v2.1.0)
132+
133+
- [ ] Use `peer.created_at` / `session.created_at` where creation time is needed
134+
- [ ] Use `session.is_active` where session active status is needed
135+
136+
## New Methods (v2.1.0)
137+
138+
- [ ] Use `session.get_message(message_id)` to fetch single messages by ID
139+
140+
## Pagination Parameters (v2.1.0)
141+
142+
- [ ] Add `page`, `size`, `reverse` parameters to list calls where needed:
143+
- [ ] `client.peers()`
144+
- [ ] `client.sessions()`
145+
- [ ] `peer.sessions()`
146+
- [ ] `session.messages()`
147+
- [ ] `scope.list()`
148+
116149
## Final Verification
117150

118151
- [ ] Run type checker (mypy/pyright) with no errors

.claude/skills/migrate-honcho-py/SKILL.md

Lines changed: 86 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
name: migrate-honcho
3-
description: Migrates Honcho Python SDK code from v1.6.0 to v2.0.0. Use when upgrading honcho package, fixing breaking changes after upgrade, or when errors mention AsyncHoncho, observations, Representation class, .core property, or get_config methods.
3+
description: Migrates Honcho Python SDK code from v1.6.0 to v2.1.1. Use when upgrading honcho package, fixing breaking changes after upgrade, or when errors mention AsyncHoncho, observations, Representation class, .core property, or get_config methods.
44
---
55

6-
# Honcho Python SDK Migration (v1.6.0 → v2.0.0)
6+
# Honcho Python SDK Migration (v1.6.0 → v2.1.1)
77

88
## Overview
99

10-
This skill migrates code from `honcho` Python SDK v1.6.0 to v2.0.0 (required for Honcho 3.0.0+).
10+
This skill migrates code from `honcho` Python SDK v1.6.0 to v2.1.1 (required for Honcho 3.0.0+).
1111

1212
**Key breaking changes:**
1313

@@ -184,18 +184,92 @@ updated = client.update_message(message=msg, metadata={"key": "value"}, session=
184184
updated = session.update_message(message=msg, metadata={"key": "value"})
185185
```
186186

187-
### 10. Update card() return type
187+
### 10. Update card() return type and method name
188188

189189
```python
190190
# Before
191191
card: str = peer.card() # Returns str
192192

193-
# After
194-
card: list[str] | None = peer.card() # Returns list[str] | None
193+
# After (v2.0.0+)
194+
card: list[str] | None = peer.get_card() # Returns list[str] | None
195195
if card:
196196
print("\n".join(card))
197+
198+
# peer.card() still works but is deprecated — use get_card()
199+
200+
# New in v2.0.1: set_card()
201+
peer.set_card(["Prefers dark mode", "Located in US"])
202+
```
203+
204+
### 11. Strict input validation (v2.0.2+)
205+
206+
All input models now reject unknown fields via `extra="forbid"` Pydantic validation. Previously, misspelled or extraneous fields were silently ignored.
207+
208+
```python
209+
# Before (v2.0.1 and earlier) — silently ignored
210+
peer = client.peer("user-1", configuration=PeerConfig(observe_mee=True)) # typo silently ignored
211+
212+
# After (v2.0.2+) — raises ValidationError
213+
peer = client.peer("user-1", configuration=PeerConfig(observe_mee=True)) # ValidationError!
214+
```
215+
216+
### 12. peer() and session() always make API calls (v2.1.0+)
217+
218+
**Breaking**: `peer()` and `session()` now always make a get-or-create API call. Previously, calling without metadata/configuration returned a lazy object with no API call.
219+
220+
```python
221+
# Before (v2.0.x) — no API call without options
222+
peer = client.peer("user-123") # Lazy, no network request
223+
224+
# After (v2.1.0+) — always hits the API
225+
peer = client.peer("user-123") # Makes POST to /peers (get-or-create)
226+
227+
# Async
228+
peer = await client.aio.peer("user-123") # Also always hits API
197229
```
198230

231+
### 13. New properties and methods (v2.1.0+)
232+
233+
```python
234+
# created_at on Peer and Session
235+
peer = client.peer("user-123")
236+
print(peer.created_at) # datetime | None
237+
238+
session = client.session("sess-1")
239+
print(session.created_at) # datetime | None
240+
241+
# is_active on Session
242+
print(session.is_active) # bool | None
243+
244+
# get_message() on Session
245+
msg = session.get_message("msg-id")
246+
# Async: msg = await session.aio.get_message("msg-id")
247+
```
248+
249+
### 14. Pagination parameters on list methods (v2.1.0+)
250+
251+
All list methods now accept `page`, `size`, and `reverse` parameters:
252+
253+
```python
254+
# Before (v2.0.x) — only filters
255+
peers_page = client.peers(filters={"metadata": {"role": "admin"}})
256+
257+
# After (v2.1.0+) — pagination controls
258+
peers_page = client.peers(
259+
filters={"metadata": {"role": "admin"}},
260+
page=2,
261+
size=25,
262+
reverse=True
263+
)
264+
265+
# Works on: client.peers(), client.sessions(), peer.sessions(),
266+
# session.messages(), scope.list()
267+
```
268+
269+
### 15. Broader HTTP retry logic (v2.1.1+)
270+
271+
The SDK now retries on `httpx.TimeoutException`, `httpx.NetworkError`, and `httpx.RemoteProtocolError` (previously only `httpx.TimeoutException` and `httpx.ConnectError`). These are mapped to the SDK's `TimeoutError` and `ConnectionError` respectively. No code changes needed — this is transparent.
272+
199273
## Quick Reference Table
200274

201275
| v1.6.0 | v2.0.0 |
@@ -222,6 +296,8 @@ if card:
222296
| `.get_peer_config()` | `.get_peer_configuration()` |
223297
| `.set_peer_config()` | `.set_peer_configuration()` |
224298
| `client.update_message()` | `session.update_message()` |
299+
| `peer.card()` | `peer.get_card()` *(card() deprecated)* |
300+
| *(new)* | `peer.set_card(list[str])` |
225301
| `chat(stream=True)` | `chat_stream()` |
226302
| `include_most_derived=` | `include_most_frequent=` |
227303
| `max_observations=` | `max_conclusions=` |
@@ -230,6 +306,10 @@ if card:
230306
| `PeerContext` | `PeerContextResponse` |
231307
| `DeriverStatus` | `QueueStatusResponse` |
232308
| `client.core` | *(removed)* |
309+
| *(new v2.1.0)* | `peer.created_at` / `session.created_at` |
310+
| *(new v2.1.0)* | `session.is_active` |
311+
| *(new v2.1.0)* | `session.get_message(id)` |
312+
| *(new v2.1.0)* | `page=`, `size=`, `reverse=` on list methods |
233313

234314
## Detailed Reference
235315

0 commit comments

Comments
 (0)