Skip to content

Commit 4d03070

Browse files
authored
feat: enable bank config API by default (#426)
Change DEFAULT_ENABLE_BANK_CONFIG_API from false to true, update all docs, error messages, and client docstrings to reflect the new default. Remove explicit env var overrides in CI and tests that are no longer needed.
1 parent 5fef54d commit 4d03070

File tree

14 files changed

+15
-39
lines changed

14 files changed

+15
-39
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,6 @@ jobs:
13321332
HINDSIGHT_API_LLM_MODEL=${{ env.HINDSIGHT_API_LLM_MODEL }}
13331333
HINDSIGHT_API_LLM_VERTEXAI_SERVICE_ACCOUNT_KEY=/tmp/gcp-credentials.json
13341334
HINDSIGHT_API_LLM_VERTEXAI_PROJECT_ID=$HINDSIGHT_API_LLM_VERTEXAI_PROJECT_ID
1335-
HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true
13361335
EOF
13371336
13381337
- name: Start API server

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,4 @@ Optional (uses local models by default):
323323
- `HINDSIGHT_API_EMBEDDINGS_PROVIDER`: local (default) or tei
324324
- `HINDSIGHT_API_RERANKER_PROVIDER`: local (default) or tei
325325
- `HINDSIGHT_API_DATABASE_URL`: External PostgreSQL (uses embedded pg0 by default)
326-
- `HINDSIGHT_API_ENABLE_BANK_CONFIG_API`: Enable per-bank config API (default: false, disabled for security)
326+
- `HINDSIGHT_API_ENABLE_BANK_CONFIG_API`: Enable per-bank config API (default: true)

hindsight-api/hindsight_api/api/http.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3563,7 +3563,7 @@ async def api_get_bank_config(bank_id: str, request_context: RequestContext = De
35633563
if not get_config().enable_bank_config_api:
35643564
raise HTTPException(
35653565
status_code=404,
3566-
detail="Bank configuration API is disabled. Set HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true to enable.",
3566+
detail="Bank configuration API is disabled. Set HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true to re-enable.",
35673567
)
35683568
try:
35693569
# Authenticate and set schema context for multi-tenant DB queries
@@ -3601,7 +3601,7 @@ async def api_update_bank_config(
36013601
if not get_config().enable_bank_config_api:
36023602
raise HTTPException(
36033603
status_code=404,
3604-
detail="Bank configuration API is disabled. Set HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true to enable.",
3604+
detail="Bank configuration API is disabled. Set HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true to re-enable.",
36053605
)
36063606
try:
36073607
# Authenticate and set schema context for multi-tenant DB queries
@@ -3641,7 +3641,7 @@ async def api_reset_bank_config(bank_id: str, request_context: RequestContext =
36413641
if not get_config().enable_bank_config_api:
36423642
raise HTTPException(
36433643
status_code=404,
3644-
detail="Bank configuration API is disabled. Set HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true to enable.",
3644+
detail="Bank configuration API is disabled. Set HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true to re-enable.",
36453645
)
36463646
try:
36473647
# Authenticate and set schema context for multi-tenant DB queries

hindsight-api/hindsight_api/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def normalize_config_dict(config: dict[str, Any]) -> dict[str, Any]:
396396
DEFAULT_LOG_FORMAT = "text" # Options: "text", "json"
397397
DEFAULT_WORKERS = 1
398398
DEFAULT_MCP_ENABLED = True
399-
DEFAULT_ENABLE_BANK_CONFIG_API = False # Disabled by default for security
399+
DEFAULT_ENABLE_BANK_CONFIG_API = True
400400
DEFAULT_GRAPH_RETRIEVER = "link_expansion" # Options: "link_expansion", "mpfp", "bfs"
401401
DEFAULT_MPFP_TOP_K_NEIGHBORS = 20 # Fan-out limit per node in MPFP graph traversal
402402
DEFAULT_RECALL_MAX_CONCURRENT = 32 # Max concurrent recall operations per worker

hindsight-api/tests/test_hierarchical_config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
from hindsight_api.extensions.tenant import TenantExtension
1616
from hindsight_api.models import RequestContext
1717

18-
# Enable bank config API for all tests in this module
19-
os.environ["HINDSIGHT_API_ENABLE_BANK_CONFIG_API"] = "true"
20-
2118

2219
class MockTenantExtension(TenantExtension):
2320
"""Mock tenant extension for testing tenant-level config."""

hindsight-cli/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn format_error_message(err: &anyhow::Error, api_url: &str) -> String {
6767
"Bank configuration API is disabled".bright_red().bold(),
6868
"API URL:".bright_yellow(),
6969
api_url.bright_white(),
70-
"This feature is disabled by default for security.".bright_yellow(),
70+
"This feature has been disabled on the server.".bright_yellow(),
7171
"To enable, set HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true on the API server".bright_white(),
7272
"Note:".bright_cyan(),
7373
"This allows per-bank LLM configuration overrides via API".bright_white()

hindsight-clients/python/hindsight_client/hindsight_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def get_bank_config(self, bank_id: str) -> dict[str, Any]:
10211021
"""
10221022
Get the resolved configuration for a bank, including any bank-level overrides.
10231023
1024-
Requires ``HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true`` on the server.
1024+
Can be disabled on the server by setting ``HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false``.
10251025
10261026
Args:
10271027
bank_id: The memory bank ID
@@ -1059,7 +1059,7 @@ def update_bank_config(
10591059
"""
10601060
Update configuration overrides for a bank.
10611061
1062-
Requires ``HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true`` on the server.
1062+
Can be disabled on the server by setting ``HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false``.
10631063
10641064
Args:
10651065
bank_id: The memory bank ID
@@ -1111,7 +1111,7 @@ def reset_bank_config(self, bank_id: str) -> dict[str, Any]:
11111111
"""
11121112
Reset all bank-level configuration overrides, reverting to server defaults.
11131113
1114-
Requires ``HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true`` on the server.
1114+
Can be disabled on the server by setting ``HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false``.
11151115
11161116
Args:
11171117
bank_id: The memory bank ID

hindsight-clients/typescript/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ export class HindsightClient {
431431
/**
432432
* Get the resolved configuration for a bank, including any bank-level overrides.
433433
*
434-
* Requires `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true` on the server.
434+
* Can be disabled on the server by setting `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false`.
435435
*/
436436
async getBankConfig(bankId: string): Promise<BankConfigResponse> {
437437
const response = await sdk.getBankConfig({
@@ -445,7 +445,7 @@ export class HindsightClient {
445445
/**
446446
* Update configuration overrides for a bank.
447447
*
448-
* Requires `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true` on the server.
448+
* Can be disabled on the server by setting `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false`.
449449
*
450450
* @param bankId - The memory bank ID
451451
* @param options - Fields to override
@@ -493,7 +493,7 @@ export class HindsightClient {
493493
/**
494494
* Reset all bank-level configuration overrides, reverting to server defaults.
495495
*
496-
* Requires `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true` on the server.
496+
* Can be disabled on the server by setting `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false`.
497497
*/
498498
async resetBankConfig(bankId: string): Promise<BankConfigResponse> {
499499
const response = await sdk.resetBankConfig({

hindsight-docs/blog/2026-02-13-version-0-4-11.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ curl -X PATCH http://localhost:8888/v1/default/banks/my-bank/config \
4343
}'
4444
```
4545

46-
Configuration cascades from system defaults (env vars) → tenant overrides → bank-specific settings. The bank config API is disabled by default for security—enable it with `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true`.
46+
Configuration cascades from system defaults (env vars) → tenant overrides → bank-specific settings. The bank config API is enabled by default and can be disabled with `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=false`.
4747

4848
Type-safe access prevents accidentally using global defaults when bank overrides exist. See the Configuration Guide for details on hierarchical configuration.
4949

hindsight-docs/docs/developer/api/memory-banks.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ Disposition traits and `mission` only affect the `reflect` operation. `retain_mi
158158

159159
Bank configuration fields (retain mission, extraction mode, observations mission, etc.) are managed via a **separate config API**, not the `create_bank` call. This lets you change operational settings independently from the bank's identity and disposition.
160160

161-
:::note
162-
The bank config API must be enabled on the server with `HINDSIGHT_API_ENABLE_BANK_CONFIG_API=true`.
163-
:::
164-
165161
### Setting Configuration Overrides
166162

167163
<Tabs>

0 commit comments

Comments
 (0)