honcho/src/utils
Rajat Ahuja bf494257b8
add read db (#773)
* feat: implement read DB and fix queue stale cleanup

* fix: use read_db in internal methods

* fix: mention read db in the CLAUDE.md

* fix: make TRACING checkout hook autocommit-safe; sample cleanup-gate jitter once

The DB.TRACING checkout hook ran `SELECT set_config(...)` at pool checkout,
before the dialect applies the read engine's AUTOCOMMIT isolation level. That
statement autobegins a transaction, and psycopg then refuses to switch the
connection into AUTOCOMMIT ("can't change 'autocommit' now: connection in
transaction status INTRANS"), so every read_only session 500s under TRACING and
the INTRANS connection leaks back to poison later write checkouts. Run the hook
in autocommit and restore the prior mode so it never leaves an open transaction;
set_config(..., is_local=false) is session-scoped and survives the boundary.
Add a regression test (fails without the fix) covering read_only + TRACING.

Also sample the stale-cleanup gate's jittered interval once per attempt instead
of re-rolling it every poll, so the spacing is a fixed deadline per cycle rather
than a random walk (and is testable at non-zero jitter ratios).

* fix: reset request_context in TRACING checkout-hook test

---------

Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
2026-06-10 13:28:36 -04:00
..
__init__.py Honcho 2.1.0 "ROTE" deriver (#160) 2025-07-16 18:02:43 -04:00
agent_tools.py add read db (#773) 2026-06-10 13:28:36 -04:00
config_helpers.py feat: deriver custom instructions (#609) 2026-05-11 18:05:42 -04:00
files.py fix(files): handle empty json uploads safely (#434) 2026-03-18 18:36:34 -04:00
filter.py Sanitization and Memory Bug Fixes (#419) 2026-03-18 15:01:52 -04:00
formatting.py feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00
json_parser.py fix: Remove noisy sentry error on llm failure and upgrade deps (#396) 2026-02-23 15:53:29 -05:00
queue_payload.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
representation.py feat: make session_name nullable for documents and update related SDKs (#347) 2026-01-26 13:33:11 -05:00
search.py add read db (#773) 2026-06-10 13:28:36 -04:00
summarizer.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
tokens.py switch OTEL metrics to prometheus (#344) 2026-01-25 17:26:42 -05:00
types.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
work_unit.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00