consciousness/src
Kent Overstreet 72f4f1b617 context: cache role header token lengths
Branch::tokens() was calling tokenizer::encode() on every call for
the role header ("system\n", "user\n", "assistant\n") and trailing
newline. In trim_conversation(), this meant hundreds of encode calls
per trim cycle.

These are fixed strings - cache them with OnceLock on first use.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-12 20:47:36 -04:00
..
agent context: cache role header token lengths 2026-04-12 20:47:36 -04:00
bin enable short backtraces by default 2026-04-12 20:11:27 -04:00
cli journal tail: use query engine instead of manual filtering 2026-04-12 02:29:52 -04:00
hippocampus locks: add process-wide lock hold time tracking 2026-04-12 20:27:42 -04:00
learn rust edition 2024 2026-04-05 06:20:16 -04:00
mind unconscious: move health refresh outside lock too 2026-04-12 20:37:54 -04:00
subconscious prompts: remove unused replay_queue import 2026-04-12 16:21:54 -04:00
thalamus kill MIN_NUDGE_INTERVAL 2026-04-11 16:45:33 -04:00
user selectable: silence unused method warning 2026-04-12 16:10:58 -04:00
config.rs Drop redundant system prompt — all info is in memory nodes 2026-04-12 01:36:59 -04:00
lib.rs locks: add process-wide lock hold time tracking 2026-04-12 20:27:42 -04:00
locks.rs locks: add process-wide lock hold time tracking 2026-04-12 20:27:42 -04:00
main.rs enable short backtraces by default 2026-04-12 20:11:27 -04:00
session.rs delete claude code integration 2026-04-09 19:58:07 -04:00
util.rs delete 20 dead public functions across 12 files 2026-04-02 16:21:01 -04:00