Teknium
5127567d5d
perf(ttft): cache skills prompt with shared skill_utils module (salvage #3366) (#3421)
Two-layer caching for build_skills_system_prompt():
1. In-process LRU (OrderedDict, max 8) — same-process: 546ms → <1ms
2. Disk snapshot (.skills_prompt_snapshot.json) — cold start: 297ms → 103ms
Key improvements over original PR #3366:
- Extract shared logic into agent/skill_utils.py (parse_frontmatter,
skill_matches_platform, get_disabled_skill_names, extract_skill_conditions,
extract_skill_description, iter_skill_index_files)
- tools/skills_tool.py delegates to shared module — zero code duplication
- Proper LRU eviction via OrderedDict.move_to_end + popitem(last=False)
- Cache invalidation on all skill mutation paths:
- skill_manage tool (in-conversation writes)
- hermes skills install (CLI hub)
- hermes skills uninstall (CLI hub)
- Automatic via mtime/size manifest on cold start
prompt_builder.py no longer imports tools.skills_tool (avoids pulling
in the entire tool registry chain at prompt build time).
6301 tests pass, 0 failures.
Co-authored-by: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com>
2026-03-27 10:54:02 -07:00
..
2026-02-26 03:20:08 +03:00
2026-03-23 07:43:12 -07:00
2026-03-26 14:33:18 -07:00
2026-03-19 10:17:03 -07:00
2026-03-14 11:28:26 -07:00
2026-03-17 02:02:57 -07:00
2026-03-23 22:45:55 -07:00
2026-03-13 22:14:00 -07:00
2026-02-27 03:29:26 -05:00
2026-03-13 21:32:53 -07:00
2026-03-24 07:30:25 -07:00
2026-03-14 00:17:04 -07:00
2026-03-27 04:03:00 -07:00
2026-02-26 13:55:54 +03:00
2026-03-17 01:40:02 -07:00
2026-03-19 17:54:46 +01:00
2026-03-02 04:34:21 -08:00
2026-03-26 14:50:26 -07:00
2026-03-19 09:26:05 -07:00
2026-03-24 07:30:25 -07:00
2026-03-10 20:45:13 -07:00
2026-03-24 08:19:34 -07:00
2026-03-08 16:47:20 -07:00
2026-03-12 01:23:28 -07:00
2026-03-23 07:43:12 -07:00
2026-03-17 02:22:12 -07:00
2026-03-14 11:27:02 -07:00
2026-02-26 03:20:08 +03:00
2026-03-04 18:34:16 +03:00
2026-03-01 11:53:50 +03:00
2026-03-16 00:23:47 -07:00
2026-03-13 02:51:51 -07:00
2026-03-23 22:45:55 -07:00
2026-03-15 01:20:42 +05:30
2026-03-22 15:02:26 -07:00
2026-03-17 03:48:44 -07:00
2026-03-14 05:44:00 -07:00
2026-03-25 16:52:04 -07:00
2026-03-14 11:36:47 -07:00
2026-03-14 07:53:56 -07:00
2026-03-24 07:30:25 -07:00
2026-03-17 02:34:35 -07:00
2026-03-26 19:38:04 -07:00
2026-03-17 03:52:15 -07:00
2026-03-20 14:54:25 -07:00
2026-03-27 07:49:44 -07:00
2026-03-10 17:09:51 -07:00
2026-03-17 02:02:57 -07:00
2026-03-17 15:38:37 +00:00
2026-03-26 14:35:31 -07:00
2026-03-16 19:01:39 +03:00
2026-03-24 08:19:34 -07:00
2026-03-05 18:51:43 -08:00
2026-03-04 05:30:43 -08:00
2026-03-02 02:00:09 -08:00
2026-03-26 13:40:21 -07:00
2026-03-14 23:15:04 -07:00
2026-03-26 13:40:21 -07:00
2026-03-26 01:08:02 +05:30
2026-03-27 10:54:02 -07:00
2026-03-15 21:13:40 -07:00
2026-03-04 17:23:23 +03:00
2026-03-21 17:10:17 -07:00
2026-03-24 07:30:25 -07:00
2026-03-24 07:30:25 -07:00
2026-03-16 23:39:41 -07:00
2026-03-08 23:07:38 +03:00
2026-03-17 10:30:58 -07:00
2026-03-17 10:30:58 -07:00
2026-03-23 15:40:42 -07:00
2026-03-23 15:40:42 -07:00
2026-03-14 14:27:21 +03:00
2026-03-14 14:27:21 +03:00
2026-03-17 04:28:03 -07:00
2026-03-17 04:28:03 -07:00
2026-03-25 15:16:57 -07:00
2026-03-01 01:54:27 +03:00
2026-02-26 13:30:55 +03:00
2026-03-17 02:22:12 -07:00