Skip to content

memory_save.py writes to non-existent column #2

@arrra

Description

@arrra

Title: memory_save.py writes to non-existent created_at column — every save fails

Labels: bug, memory-system, good-first-issue

Description

memory_save.py fails on every invocation with:

sqlite3.OperationalError: table memories has no column named created_at

This breaks the memory_save.py skill script entirely — no memories can be saved via the script.

Steps to reproduce

python3 ~/.hex/skills/memory/scripts/memory_save.py "test memory" --tags "test" --source "repro"

Expected: memory saved, id printed.
Actual: sqlite3.OperationalError: table memories has no column named created_at.

Root cause

Schema/script drift. The memories table schema is:

CREATE TABLE memories (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    content TEXT NOT NULL,
    tags TEXT DEFAULT '',
    source TEXT DEFAULT '',
    timestamp TEXT NOT NULL
);

But the INSERT at .hex/skills/memory/scripts/memory_save.py:54 targets created_at:

conn.execute(
    "INSERT INTO memories (content, tags, source, created_at) VALUES (?, ?, ?, ?)",
    (content, tags, source, ts),
)

Looks like a column rename (created_attimestamp) landed in the schema but the save script wasn't
updated in the same change.

Fix

One-line change at memory_save.py:54:

-        "INSERT INTO memories (content, tags, source, created_at) VALUES (?, ?, ?, ?)",
+        "INSERT INTO memories (content, tags, source, timestamp) VALUES (?, ?, ?, ?)",

Scope check

grep -rn "created_at" .hex/ returns only this one line — no other code references the wrong column name,
so no other files need updating.

Environment

  • hex version: v0.3.0 (hex vv0.3.0 initial install @ 733fb3f)
  • Platform: macOS (Darwin arm64)
  • Python: 3.x (system)
  • SQLite: via stdlib sqlite3

Verification after fix

$ python3 .hex/skills/memory/scripts/memory_save.py "fix verification" --tags "test"
Saved memory #116: fix verification
  (116 memories total)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions