Skip to content

bug: multi-line GitHub issue bodies break blockquote rendering in context bombs #321

@claude

Description

@claude

Problem

When a GitHub issue body contains newlines (which virtually all real issues do), the context bomb renders only the first line with the Markdown blockquote > prefix. Subsequent lines appear as plain text, breaking the visual grouping.

Affected locations

1. internal/template/render.go:388buildWorkingMemorySection:

issueBodySection = fmt.Sprintf("> %s\n", wm.IssueBody)

A body of "Line 1\nLine 2\nLine 3" renders as:

> Line 1
Line 2
Line 3

2. internal/template/render.go:73 — main template string:

> {{.WorkingMemory.IssueBody}}

Same problem: only the first line of a multi-line body gets the > prefix.

Fix

Replace newlines in the issue body with \n> before rendering, so all lines are part of the blockquote. This can be done either:

  • As a template function (e.g., blockquote) applied in the template
  • In buildWorkingMemorySection using strings.ReplaceAll(wm.IssueBody, "\n", "\n> ")

Both the main template and the truncated-path buildWorkingMemorySection helper need to be updated.

@claude please implement this

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