You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: First user message missing from session JSONL history (Telegram) #620
Description:
Session history files (.jsonl) are missing the initial user message. The history starts with cwd followed by the assistant's response, skipping the first user input that triggered the conversation.
Steps to Reproduce:
Start a new conversation via Telegram
Send a message
Check the session JSONL file
Observe that the first user message is not recorded
**Expected
Behavior:
Session history should include all messages, including the first user message.
Actual Behavior:
First user message is missing. History begins with cwd and assistant response.
Provider: Telegram (confirmed)
Other providers:** Unknown / needs testing
Root cause: we pre-created session.jsonl in the embedded Pi runner, so Pi’s SessionManager marked the file flushed and skipped persisting the initial user message until after the assistant. Fix: stop pre-creating the transcript in embedded runs; add a regression test that asserts the first user message persists and precedes assistant output. Commit: cc8a245. Full gate: pnpm lint && pnpm build && pnpm test && pnpm docs:build.
Activity
w-winter commentedon Jan 12, 2026
Confirmed the same issue with JSONL produced by Telegram and Slack providers, as well as by the TUI.
steipete commentedon Jan 12, 2026
Hope someone can dig in - I tried with codex but it can't find a bug.
steipete commentedon Jan 12, 2026
Root cause: we pre-created session.jsonl in the embedded Pi runner, so Pi’s SessionManager marked the file flushed and skipped persisting the initial user message until after the assistant. Fix: stop pre-creating the transcript in embedded runs; add a regression test that asserts the first user message persists and precedes assistant output. Commit: cc8a245. Full gate: pnpm lint && pnpm build && pnpm test && pnpm docs:build.