Skip to content

Turn-end check writes a link in its replacement words as escaped text #5935

Closed

Description

@max-sixty

What happens. In Claude Code, the turn-end check found a few stale words on a page and swapped in new ones. Where the new words contained a link (<a href="…">label</a>), it wrote them into index.html escaped, as &lt;a href="…"&gt;label&lt;/a&gt;, so the page shows the tag as text where the link should be.

The message the check sends the agent afterwards quotes the new words with the tag unescaped, so nothing in it says the page shows markup. The agent finds out only by reading the page source.

It happened for both replacements in one pass that contained a link, one inside a table cell and one in a paragraph. Replacements of plain words in the same pass were written correctly.

What I expected. The new words to appear on the page as the check reported them, with a working link. Or, if the check swaps plain text only, for it not to compose a replacement that contains markup.

Smallest repro. I have not re-run these steps on a fresh page; they are the shape of what happened twice on a longer page.

  1. A page whose index.html holds <p id="status">The follow-up is built and not merged yet.</p>.
  2. In the session that owns the page, end a turn whose final message says the follow-up is now open as a pull request, and links it: [#12, the follow-up](https://example.com/pull/12).
  3. The turn-end check reports that it changed follow-up is built to follow-up, <a href="https://example.com/pull/12">#12</a>, is open.
  4. The page source now holds follow-up, &lt;a href="https://example.com/pull/12"&gt;#12&lt;/a&gt;, is open, and the browser shows the tag as text.

Seen on leaf a9e4d3e, installed 2026-11-13T13:19:04-08:00.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    bug
    on Nov 14, 2026
  2. leaf-agent commented on Nov 14, 2026

    @leaf-agent
    Collaborator

    Reproduced and fix opened in #5936. The check writes replacement words into index.html as escaped text, and its check that the page still reads right passed, because escaped markup reads as exactly the words the fork gave. Now a fix whose new words contain a tag is refused, and the finding reaches the agent alone, so the agent adds the link in its own revision. A link and a code-span replacement are now regression tests: before the change both wrote escaped markup into the page, and after it both leave the page untouched.

    The fork wrote markup partly because turn-end-check.md asks for replacement words "written as the page writes". Asking for plain words instead would keep these fixes from being dropped. That needs an eval run in a Claude Code harness, so it's left out of #5936. CI and landing for #5936 are still pending.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions