honcho/src
Vineeth Voruganti 5a42f9b3cd
Use savepoints to prevent race condition in get_or_create chain (#399)
* fix: Use savepoints to prevent race condition in get_or_create chain

Replace commit()/rollback() with begin_nested() savepoints in
get_or_create_workspace, get_or_create_peers, and get_or_create_session
so that an IntegrityError rollback in a nested call doesn't undo flushed
work from the caller. Moves transaction commit responsibility to the
outermost caller and defers cache operations to post-commit callbacks
on GetOrCreateResult.

Closes DEV-1321

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: Add missing commit and post_commit in chat endpoint

The chat() endpoint in routers/peers.py called get_or_create_peers()
but discarded the result without committing or invoking post_commit().
This meant new peers created lazily via SDK chat calls were never
persisted, and cache invalidation was skipped.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 23:28:04 -05:00
..
cache perf: add redis caching and reduce embedding API calls (#372) 2026-02-13 00:53:46 -05:00
crud Use savepoints to prevent race condition in get_or_create chain (#399) 2026-02-23 23:28:04 -05:00
deriver fix: Remove noisy sentry error on llm failure and upgrade deps (#396) 2026-02-23 15:53:29 -05:00
dialectic perf: add redis caching and reduce embedding API calls (#372) 2026-02-13 00:53:46 -05:00
dreamer sdks: add set peer card function (#371) 2026-02-09 15:35:57 -05:00
reconciler fix: use ORM mutation for re-embedded vectors in reconciler (#384) 2026-02-12 14:08:37 -05:00
routers Use savepoints to prevent race condition in get_or_create chain (#399) 2026-02-23 23:28:04 -05:00
telemetry fix: Remove noisy sentry error on llm failure and upgrade deps (#396) 2026-02-23 15:53:29 -05:00
utils Use savepoints to prevent race condition in get_or_create chain (#399) 2026-02-23 23:28:04 -05:00
vector_store chore: lazy-load imports (#345) 2026-01-26 11:35:41 -05:00
webhooks feat: codify queue columns (#254) 2025-11-07 13:22:24 -05:00
__init__.py v0.0.8 Documentation Updates (#55) 2024-05-15 00:07:25 -04:00
config.py fix: make FLUSH_ENABLED a config value (#361) 2026-02-03 10:53:14 -05:00
db.py Standardize DB Constraint Conventions (#272) 2025-11-20 11:50:54 -05:00
dependencies.py create Representation class and use it to unify all formatting (#214) 2025-10-07 15:28:44 -04:00
embedding_client.py feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00
exceptions.py Turbopuffer and LanceDB Integration (#287) 2026-01-16 17:04:01 -05:00
main.py chore: filter out GET /metrics logs (#391) 2026-02-18 11:42:05 -05:00
models.py feat: make session_name nullable for documents and update related SDKs (#347) 2026-01-26 13:33:11 -05:00
schemas.py Modify Queue Status to only relevant tasks (#398) 2026-02-23 22:54:21 -05:00
security.py fix: Various Codex Audits (#386) 2026-02-13 12:00:15 -05:00