Skip to content

fix(site): drop content_block messages, drop branches, CSV injection, heading escape #475

Closed

Description

@Sinity

Problems

Messages with content_blocks but empty text silently dropped

site/conversation_pages.py:44 — if not msg.text: continue drops messages that have tool_use, tool_result, or thinking blocks but no text field. The standalone HTML renderer correctly checks not text and not content_blocks.

Branch/alternative messages silently dropped

site/conversation_pages.py:43-45 — no attach_rendered_message_branches() call. Branching conversations (common in Claude Code, ChatGPT) render only the selected branch; alternatives are invisible on site pages.

CSV export drops content blocks + injection risk

rendering/formatting.py:142-159 — only writes msg.text to CSV. Messages whose content lives in content_blocks produce empty cells. Text beginning with =, +, -, @ creates CSV injection when opened in Excel/LibreOffice.

Markdown heading escape only handles ##

rendering/core_markdown.py:55-57 — _escape_message_section_markers only escapes ## (H2). Lines starting with # (H1) or ### (H3+) become document headings, breaking structure.

create_renderer() supports 2 formats; CLI advertises 8

rendering/renderers/__init__.py:31-34 — OutputRenderer protocol supports only markdown and HTML. JSON, YAML, CSV, plaintext, obsidian, org handled by parallel format_conversation() code path.

Affected code

  • site/conversation_pages.py:43-45 — drops content_block msgs and branches
  • rendering/formatting.py:142-159 — CSV gaps
  • rendering/core_markdown.py:55-57 — heading escape
  • rendering/renderers/__init__.py:31-34 — renderer gap

Discovered during adversarial audit 2026-04-26.

Activity

  1. Sinity commented on Apr 26, 2026

    @Sinity
    OwnerAuthor

    Partially addressed by #489. Remaining items tracked in this issue.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions