OpenSpace/openspace
Fabio Scarsi 37083593d6 fix(search): content-addressed SkillRanker cache key
The embedding cache was keyed by skill_id alone, so any edit to a
SKILL.md body or description produced stale embeddings that
get_or_compute_embedding kept serving until a manual invalidate_cache
call or a file deletion. Previously this was mostly invisible because
select_skills_with_llm was the only caller exercising the cache; after
the preceding commit wires search_skills through the same path the
staleness becomes observable on every MCP query.

Use "{skill_id}:{sha256(embedding_text)[:16]}" as the cache key, so
any change to the text produced by _build_embedding_text (name +
description + body, truncated to SKILL_EMBEDDING_MAX_CHARS) causes
an automatic cache miss and a fresh embedding. Both
get_or_compute_embedding and _embedding_rank are updated.

Bounded growth: on each successful new compute, older entries with
the same "{skill_id}:" prefix are pruned in the same write. Net
result: at most one cached embedding per skill_id at any time, aside
from transient migration state.

Backward compatibility: existing pickle files keyed by skill_id alone
are migrated in place on first lookup (no API call needed); the old
key is dropped after migration.

invalidate_cache(skill_id) now removes every content-addressed entry
and any legacy entry for that skill_id, so historical versions do
not leak across evolutions.

Functional benchmark on a 28-skill local registry with
text-embedding-3-small via OpenRouter: top-1 match identity preserved
on all test queries, score drift below 0.001, warm latency
~260-400ms/query (unchanged from the previous commit).
2026-04-18 12:44:47 +02:00
..
agents feat: add communication adapters and agent refactoring (#74) 2026-04-09 22:06:38 +08:00
cloud fix(search): wire search_skills to SkillRanker embedding cache 2026-04-18 11:52:15 +02:00
communication feat: add communication adapters and agent refactoring (#74) 2026-04-09 22:06:38 +08:00
config feat: add communication adapters and agent refactoring (#74) 2026-04-09 22:06:38 +08:00
grounding feat: support SSE and streamable HTTP for OpenSpace MCP 2026-04-07 20:06:01 +08:00
host_detection feat: add communication adapters and agent refactoring (#74) 2026-04-09 22:06:38 +08:00
host_skills feat: support SSE and streamable HTTP for OpenSpace MCP 2026-04-07 20:06:01 +08:00
llm fix: resolve pr-60 review regressions 2026-04-06 19:18:22 +08:00
local_server fix: separate atomacos import from AppKit to avoid disabling all macOS features 2026-04-16 20:31:26 +08:00
platforms fix: rename platform package to platforms 2026-03-26 00:09:50 +08:00
prompts initial commit 2026-03-24 16:03:22 +08:00
recording fix: address 8 runtime bugs found during code review 2026-04-06 01:02:35 +08:00
skill_engine fix(search): content-addressed SkillRanker cache key 2026-04-18 12:44:47 +02:00
skills initial commit 2026-03-24 16:03:22 +08:00
utils fix: make tool fallback conservative 2026-04-03 23:44:38 +08:00
.env.example feat: add communication adapters and agent refactoring (#74) 2026-04-09 22:06:38 +08:00
__init__.py initial commit 2026-03-24 16:03:22 +08:00
__main__.py feat: add communication adapters and agent refactoring (#74) 2026-04-09 22:06:38 +08:00
dashboard_server.py fix: use hash-based workflow ID to prevent separator collisions 2026-03-31 17:38:39 +08:00
mcp_server.py fix: CAPTURED skills write to correct host agent skill dir 2026-04-10 20:57:17 +08:00
tool_layer.py fix: CAPTURED skills write to correct host agent skill dir 2026-04-10 20:57:17 +08:00