Skip to content

Fix access tracking: migration + tokenizer truncation#3

Open
kensave wants to merge 3 commits intomainfrom
fix/access-tracking-mcp-path
Open

Fix access tracking: migration + tokenizer truncation#3
kensave wants to merge 3 commits intomainfrom
fix/access-tracking-mcp-path

Conversation

@kensave
Copy link
Copy Markdown
Owner

@kensave kensave commented Apr 16, 2026

Changes

  • Add auto-migration for episodes access tracking columns (last_accessed_at, access_count)
  • Include access tracking columns in CREATE TABLE for fresh installs
  • Fix index-select 512 error: add tokenizer truncation to prevent panics on long inputs

Rebased on main after PR #2 merge.

kensave added 3 commits April 15, 2026 17:46
- Migration v2: adds access_count + last_accessed to episodes table
- Safe for existing DBs (checks if columns exist before ALTER)
- Updates schema_version test to validate migration v2
New DBs get the columns from the start. Existing DBs get them via migration v2.
Tokenizer had padding but no truncation — text >512 tokens overflowed
the position embeddings tensor causing 'index-select invalid index 512
with dim size 512'. Added TruncationParams with max_length matching
max_position_embeddings from the model config.

Applied to both load_model() and load_model_sync().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant