fix: complete B-03/B-08/B-09 and add OMBRE_*_MODEL env vars
- decay_engine: keep activation_count as float (B-03); refresh local meta after auto_resolve so resolved_factor applies in the same cycle (B-08) - server.hold(): user-supplied valence/arousal now takes priority over analyze() output (B-09) - utils.load_config: support OMBRE_DEHYDRATION_MODEL (with OMBRE_MODEL alias) and OMBRE_EMBEDDING_MODEL - ENV_VARS.md: document new model env vars - tests/conftest.py: align fixture with spec-correct weights (time_proximity=1.5, content_weight=1.0) and feel subdir layout
This commit is contained in:
17
server.py
17
server.py
@@ -790,11 +790,16 @@ async def hold(
|
||||
}
|
||||
|
||||
domain = analysis["domain"]
|
||||
valence = analysis["valence"]
|
||||
arousal = analysis["arousal"]
|
||||
auto_valence = analysis["valence"]
|
||||
auto_arousal = analysis["arousal"]
|
||||
auto_tags = analysis["tags"]
|
||||
suggested_name = analysis.get("suggested_name", "")
|
||||
|
||||
# --- User-supplied valence/arousal takes priority over analyze() result ---
|
||||
# --- 用户显式传入的 valence/arousal 优先,analyze() 结果作为 fallback ---
|
||||
final_valence = valence if 0 <= valence <= 1 else auto_valence
|
||||
final_arousal = arousal if 0 <= arousal <= 1 else auto_arousal
|
||||
|
||||
all_tags = list(dict.fromkeys(auto_tags + extra_tags))
|
||||
|
||||
# --- Pinned buckets bypass merge and are created directly in permanent dir ---
|
||||
@@ -805,8 +810,8 @@ async def hold(
|
||||
tags=all_tags,
|
||||
importance=10,
|
||||
domain=domain,
|
||||
valence=valence,
|
||||
arousal=arousal,
|
||||
valence=final_valence,
|
||||
arousal=final_arousal,
|
||||
name=suggested_name or None,
|
||||
bucket_type="permanent",
|
||||
pinned=True,
|
||||
@@ -823,8 +828,8 @@ async def hold(
|
||||
tags=all_tags,
|
||||
importance=importance,
|
||||
domain=domain,
|
||||
valence=valence,
|
||||
arousal=arousal,
|
||||
valence=final_valence,
|
||||
arousal=final_arousal,
|
||||
name=suggested_name,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user