fleet-memory/hindsight-clients/python/hindsight_client_api/models
Nicolò Boschi ea662d062e
feat: fact_types and mental model exclusion filters for reflect (#615)
* feat: add fact_types and mental model exclusion filters to reflect and mental models

Adds three new filtering options to both the reflect endpoint and mental model creation/refresh:

- `fact_types`: restrict which fact types (world, experience, observation) are retrieved.
  Disables irrelevant agent tools entirely (no wasted tokens).
- `exclude_mental_models`: skip the search_mental_models tool altogether.
- `exclude_mental_model_ids`: exclude specific mental models by ID (merged with the
  existing self-exclusion logic during mental model refresh).

For mental models, options are persisted in the existing `trigger` JSONB column so they
are automatically applied on every refresh. The `UpdateMentalModelRequest` already
proxies `trigger`, so no extra endpoint changes are needed.

Also fixes the test fixture (`pg0_db_url` in conftest.py) to correctly resolve pg0://
URLs and run migrations before tests, which was causing all DB-dependent tests to fail
with "relation public.banks does not exist" when HINDSIGHT_API_DATABASE_URL=pg0://uuuu.

* fix: guard against disabled-tool hallucination and regenerate clients

- Add enabled_tools guard in reflect agent: if an LLM calls a tool that
  was excluded (e.g. recall when fact_types=["observation"]), return an
  error result instead of executing it
- Regenerate OpenAPI spec and all SDK clients (Go, Python, TypeScript)
  to include new fact_types / exclude_mental_models fields

* fix: add missing ReflectRequest fields in Rust CLI struct initializers

* fix: filter hallucinated tool calls before trace to prevent disabled tools appearing in results

* chore: merge main, fix lint formatting and update skills openapi.json

* feat: expose fact_types, exclude_mental_models, exclude_mental_model_ids in control plane UI

* fix: add missing trigger fields to MentalModel type in control plane api.ts

* fix: add missing trigger fields to local MentalModel interface in mental-models-view

* feat: tabbed mental model dialogs (Basic / Options tabs)

* refactor: shared FactTypeFilter component, tabbed mental model dialogs use General tab, clean up labels

* feat: pill-style toggle buttons for fact type filter (blue/emerald/amber per type)

* fix: add spacing between Fact Types label and pills, rename to Exclude all mental models
2026-03-19 17:03:41 +01:00
..
__init__.py Release v0.4.19 2026-03-18 14:29:15 +01:00
add_background_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
async_operation_submit_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
background_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
bank_config_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
bank_config_update.py Release v0.4.19 2026-03-18 14:29:15 +01:00
bank_list_item.py Release v0.4.19 2026-03-18 14:29:15 +01:00
bank_list_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
bank_profile_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
bank_stats_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
budget.py Release v0.4.19 2026-03-18 14:29:15 +01:00
cancel_operation_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
child_operation_status.py Release v0.4.19 2026-03-18 14:29:15 +01:00
chunk_data.py Release v0.4.19 2026-03-18 14:29:15 +01:00
chunk_include_options.py Release v0.4.19 2026-03-18 14:29:15 +01:00
chunk_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
clear_memory_observations_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
consolidation_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
create_bank_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
create_directive_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
create_mental_model_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
create_mental_model_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
create_webhook_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
delete_document_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
delete_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
directive_list_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
directive_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
disposition_traits.py Release v0.4.19 2026-03-18 14:29:15 +01:00
document_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
entity_detail_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
entity_include_options.py Release v0.4.19 2026-03-18 14:29:15 +01:00
entity_input.py Release v0.4.19 2026-03-18 14:29:15 +01:00
entity_list_item.py Release v0.4.19 2026-03-18 14:29:15 +01:00
entity_list_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
entity_observation_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
entity_state_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
features_info.py Release v0.4.19 2026-03-18 14:29:15 +01:00
file_retain_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
graph_data_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
http_validation_error.py Release v0.4.19 2026-03-18 14:29:15 +01:00
include_options.py Release v0.4.19 2026-03-18 14:29:15 +01:00
list_documents_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
list_memory_units_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
list_tags_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
memory_item.py Release v0.4.19 2026-03-18 14:29:15 +01:00
mental_model_list_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
mental_model_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
mental_model_trigger.py feat: fact_types and mental model exclusion filters for reflect (#615) 2026-03-19 17:03:41 +01:00
model_not.py Release v0.4.19 2026-03-18 14:29:15 +01:00
observation_scopes.py Release v0.4.19 2026-03-18 14:29:15 +01:00
operation_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
operation_status_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
operations_list_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
recall_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
recall_request_tag_groups_inner.py Release v0.4.19 2026-03-18 14:29:15 +01:00
recall_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
recall_result.py Release v0.4.19 2026-03-18 14:29:15 +01:00
recover_consolidation_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_based_on.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_directive.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_fact.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_include_options.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_llm_call.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_mental_model.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_request.py feat: fact_types and mental model exclusion filters for reflect (#615) 2026-03-19 17:03:41 +01:00
reflect_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_tool_call.py Release v0.4.19 2026-03-18 14:29:15 +01:00
reflect_trace.py Release v0.4.19 2026-03-18 14:29:15 +01:00
retain_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
retain_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
retry_operation_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
source_facts_include_options.py Release v0.4.19 2026-03-18 14:29:15 +01:00
tag_group_and.py Release v0.4.19 2026-03-18 14:29:15 +01:00
tag_group_leaf.py Release v0.4.19 2026-03-18 14:29:15 +01:00
tag_group_not.py Release v0.4.19 2026-03-18 14:29:15 +01:00
tag_group_or.py Release v0.4.19 2026-03-18 14:29:15 +01:00
tag_item.py Release v0.4.19 2026-03-18 14:29:15 +01:00
timestamp.py Release v0.4.19 2026-03-18 14:29:15 +01:00
token_usage.py Release v0.4.19 2026-03-18 14:29:15 +01:00
tool_calls_include_options.py Release v0.4.19 2026-03-18 14:29:15 +01:00
update_directive_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
update_disposition_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
update_document_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
update_document_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
update_mental_model_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
update_webhook_request.py Release v0.4.19 2026-03-18 14:29:15 +01:00
validation_error.py Release v0.4.19 2026-03-18 14:29:15 +01:00
validation_error_loc_inner.py Release v0.4.19 2026-03-18 14:29:15 +01:00
version_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
webhook_delivery_list_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
webhook_delivery_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
webhook_http_config.py Release v0.4.19 2026-03-18 14:29:15 +01:00
webhook_list_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00
webhook_response.py Release v0.4.19 2026-03-18 14:29:15 +01:00