Skip to content

/export shows duplicate "Session Started (codex)" entries #218

@nathanschram

Description

Bug

/export after a Codex run produces markdown with two consecutive "Session Started (codex)" sections, suggesting a duplicate StartedEvent is being recorded.

Reproduction

  1. Send a prompt to the Codex engine chat (e.g. read /nonexistent/file)
  2. Wait for completion
  3. Send /export
  4. Export output:
# Session Export: 019d186d-1db3-7d81-8ff6-6d9868b0e942
Exported: 2026-03-23 02:03 UTC

**Usage:** 9229 in / 187 out tokens

---

## Session Started (codex)
Model: Codex

- ▸ turn started
## Session Started (codex)
Model: Codex

- ▸ turn started

## ✓ Completed
...

Expected

Only one "Session Started" section per session in the export.

Context

  • This may be caused by the Codex runner emitting two StartedEvents — one from thread.started and another from resume token matching
  • Or the export recorder may be capturing events from multiple runs in the same thread without deduplication
  • The duplicate appears to be an exact copy (same model, same "turn started" action)

Affected files

  • src/untether/runners/codex.py — may emit duplicate StartedEvent on resume
  • src/untether/telegram/commands/export.py — session event recording / deduplication

Version

v0.35.0rc11 — found during Codex integration testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions