honcho/src
TcDrozd 70ce692079
fix(agent_tools): strip display-format "id:" prefix from source_ids and get_reasoning_chain lookups (#795)
* fix(agent_tools): strip display-format "id:" prefix from model-supplied observation IDs

Observations are presented to agents as [id:xxx], and models sometimes
copy the prefix verbatim despite tool-schema instructions to pass the
bare ID. This silently corrupts source_ids provenance on
create_observations_* (broken links stored in document metadata) and
breaks get_reasoning_chain lookups.

Normalize at both entry points. delete_observations is intentionally
not touched here since #746 already covers it.

Only the "id:" prefix is stripped: document IDs are nanoids whose
alphabet includes "-" and "_", so more aggressive cleanup could mangle
legitimate IDs.

Related to #719.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(agent_tools): strip whitespace remaining after "id:" prefix removal

Addresses CodeRabbit review: defends against "id: xxx" with a space
after the colon, and matches the docstring, which already promised
surrounding-whitespace stripping.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-23 16:49:17 -04:00
..
cache perf: add redis caching and reduce embedding API calls (#372) 2026-02-13 00:53:46 -05:00
crud fix: compact honcho logging (#836) 2026-06-23 15:55:03 -04:00
deriver fix: compact honcho logging (#836) 2026-06-23 15:55:03 -04:00
dialectic Track user and session ID on Langfuse traces (#814) 2026-06-23 00:03:21 -04:00
dreamer fix: compact honcho logging (#836) 2026-06-23 15:55:03 -04:00
llm feat: send OpenRouter app-attribution headers on OpenAI-compatible clients (#805) 2026-06-23 16:11:36 -04:00
reconciler fix: compact honcho logging (#836) 2026-06-23 15:55:03 -04:00
routers Fix scoped JWTs (#679) 2026-06-22 17:30:00 -04:00
schemas fix: private ip address check for webhook creation (#793) 2026-06-11 10:35:20 -04:00
startup Make embeddings configurable (#678) 2026-05-14 15:03:35 -04:00
telemetry fix: compact honcho logging (#836) 2026-06-23 15:55:03 -04:00
utils fix(agent_tools): strip display-format "id:" prefix from source_ids and get_reasoning_chain lookups (#795) 2026-06-23 16:49:17 -04:00
vector_store feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
webhooks Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
__init__.py v0.0.8 Documentation Updates (#55) 2024-05-15 00:07:25 -04:00
_version.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
config.py fix: compact honcho logging (#836) 2026-06-23 15:55:03 -04:00
db.py add read db (#773) 2026-06-10 13:28:36 -04:00
dependencies.py add read db (#773) 2026-06-10 13:28:36 -04:00
embedding_client.py feat: defer embedding messages (#704) 2026-06-11 10:31:04 -04:00
exceptions.py Turbopuffer and LanceDB Integration (#287) 2026-01-16 17:04:01 -05:00
main.py feat: add route-level latency metrics (#837) 2026-06-23 14:41:33 -04:00
models.py Make embeddings configurable (#678) 2026-05-14 15:03:35 -04:00
security.py Fix scoped JWTs (#679) 2026-06-22 17:30:00 -04:00