fix(cli): replace markdown headings with XML tags in thread read output #460

Merged
xiaoju merged 1 commits from fix/459-xml-tag-isolation into main 2026-05-24 08:44:48 +00:00
Owner

What

Changed uwf thread read to wrap role prompts and agent outputs in XML tags (<prompt> and <output>) instead of markdown headings (### Prompt, ### Content).

Why

Claude Code was treating step outputs as structural headings, which interfered with proper context interpretation. XML tags provide clear semantic boundaries without conflicting with markdown structure.

Changes

  • Updated formatStepPrompt to use <prompt>...</prompt> tags
  • Updated formatStepContent to use <output>...</output> tags
  • Added comprehensive test suite in thread-read-xml-tags.test.ts covering 10 scenarios
  • Updated existing tests in thread.test.ts to verify XML tag behavior

Ref

Fixes #459

## What Changed `uwf thread read` to wrap role prompts and agent outputs in XML tags (`<prompt>` and `<output>`) instead of markdown headings (`### Prompt`, `### Content`). ## Why Claude Code was treating step outputs as structural headings, which interfered with proper context interpretation. XML tags provide clear semantic boundaries without conflicting with markdown structure. ## Changes - Updated `formatStepPrompt` to use `<prompt>...</prompt>` tags - Updated `formatStepContent` to use `<output>...</output>` tags - Added comprehensive test suite in `thread-read-xml-tags.test.ts` covering 10 scenarios - Updated existing tests in `thread.test.ts` to verify XML tag behavior ## Ref Fixes #459
xiaoju added 1 commit 2026-05-24 08:05:37 +00:00
Changed uwf thread read to wrap role prompts and agent outputs in XML tags
(<prompt> and <output>) instead of markdown headings (### Prompt, ### Content).
This prevents Claude Code from treating step outputs as structural headings.

- Updated formatStepPrompt to use <prompt>...</prompt> tags
- Updated formatStepContent to use <output>...</output> tags
- Added comprehensive test suite in thread-read-xml-tags.test.ts
- Updated existing tests to verify XML tag behavior

Fixes #459

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xiaoju merged commit 6e3b32ca34 into main 2026-05-24 08:44:48 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#460