Skip to content

feat(reflect): make source facts in search_observations configurable#688

Merged
nicoloboschi merged 3 commits intomainfrom
feat/reflect-source-facts-config
Mar 25, 2026
Merged

feat(reflect): make source facts in search_observations configurable#688
nicoloboschi merged 3 commits intomainfrom
feat/reflect-source-facts-config

Conversation

@nicoloboschi
Copy link
Collaborator

Summary

  • PR fix(reflect): disable source facts in search_observations to prevent context overflow #669 hardcoded include_source_facts=False in search_observations to prevent context overflow during reflect. This makes it configurable via HINDSIGHT_API_REFLECT_SOURCE_FACTS_MAX_TOKENS (env/tenant/bank hierarchical config), defaulting to -1 (disabled, preserving current behavior).
  • Values: -1 = disabled (default), 0 = enabled unlimited, >0 = enabled with token budget
  • Adds the config field as a configurable (per-bank overridable) setting

Test plan

  • Unit tests for tool_search_observations with all three modes (-1, 0, >0)
  • Config field existence, configurability, env var parsing tests
  • All 9 tests passing
  • Lint passes

The recent fix (#669) hardcoded include_source_facts=False in
search_observations to prevent context overflow. This makes it
configurable via HINDSIGHT_API_REFLECT_SOURCE_FACTS_MAX_TOKENS
(env/tenant/bank), defaulting to -1 (disabled).

- -1: source facts disabled (current behavior, default)
- 0: source facts enabled with no token limit
- >0: source facts enabled with a token budget
@nicoloboschi nicoloboschi merged commit 5095d5e into main Mar 25, 2026
43 checks passed
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.

1 participant