Skip to content

[Bug]: First user message missing from session JSONL history (Telegram) #620

Closed

Description

@parubets

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

Activity

  1. added
    bug
    on Jan 9, 2026
  2. w-winter commented on Jan 12, 2026

    @w-winter

    Confirmed the same issue with JSONL produced by Telegram and Slack providers, as well as by the TUI.

  3. steipete commented on Jan 12, 2026

    @steipete
    Contributor

    Hope someone can dig in - I tried with codex but it can't find a bug.

  4. steipete commented on Jan 12, 2026

    @steipete
    Contributor

    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.

  5. locked as resolved and limited conversation to collaborators on Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions