Skip to content

fix(session): reject stale sqlite molt boundaries - #885

Merged
huangzesen merged 1 commit into
Lingtai-AI:mainfrom
TZZheng:fix/issue-757-sqlite-molt-boundary-telegrambot
Jul 24, 2026
Merged

fix(session): reject stale sqlite molt boundaries#885
huangzesen merged 1 commit into
Lingtai-AI:mainfrom
TZZheng:fix/issue-757-sqlite-molt-boundary-telegrambot

Conversation

@TZZheng

@TZZheng TZZheng commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • validate the selected SQLite psyche_molt boundary's fields_json.molt_count against the requested generation
  • treat missing, malformed, boolean, or mismatched boundary metadata as a fast-path miss
  • preserve the existing authoritative JSONL fallback and valid-boundary behavior

Validation

  • PYTHONPATH=src python -m pytest -q tests/test_agent_session.py17 passed
  • git diff --check canonical/main...HEAD — passed
  • independent read-only review — PASS, no blockers

Risk

Invalid or stale sidecar metadata now takes the slower authoritative fallback instead of injecting totals from the wrong molt generation. The SQLite tier contract and generation-zero/no-boundary behavior remain intact.

Fixes #757

@huangzesen
huangzesen force-pushed the fix/issue-757-sqlite-molt-boundary-telegrambot branch from c4962d9 to 5c41b7d Compare July 22, 2026 06:49
@huangzesen
huangzesen force-pushed the fix/issue-757-sqlite-molt-boundary-telegrambot branch from 5c41b7d to 61759bd Compare July 23, 2026 08:30
@huangzesen
huangzesen merged commit 12b23cc into Lingtai-AI:main Jul 24, 2026
1 check passed
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.

Sqlite rebuild tier does not cross-check molt_count, so a stale sidecar silently seeds wrong session token totals

2 participants