Skip to content

The agent that grows with you

test: record live Desktop Markdown hard-break reproduction

Teknium0ec65ee51417
diff --git a/evals/desktop_bug_campaign/navigation-markdown-README.md b/evals/desktop_bug_campaign/navigation-markdown-README.md
new file mode 100644
index 00000000000..3956e55e693
--- /dev/null
+++ b/evals/desktop_bug_campaign/navigation-markdown-README.md
@@ -0,0 +1,14 @@
+# Navigation / Markdown campaign probe
+
+This fixture mounts the production `MarkdownTextContent` component in Chromium and records its DOM, preprocessed text, screenshot and renderer errors. It is **component-level live renderer evidence**, not a full Desktop navigation or backend test. Global Desktop CSS is intentionally not loaded; hard versus soft break assertions inspect emitted `<br>` elements, not CSS wrapping. No backend or model request is made.
+
+From the repository root, with the locked Desktop dependencies available:
+
+```sh
+node evals/desktop_bug_campaign/navigation-vite.mjs
+DISPLAY=:208 PLAYWRIGHT_BROWSERS_PATH=/home/teknium/.hermes/cache/desktop-bugs-74848ed3/navigation-markdown/browsers node evals/desktop_bug_campaign/navigation-markdown-live.mjs before
+```
+
+The server uses port 18160. The campaign artifact directory is currently explicit in the runner; it is outside the source tree. Use a dedicated Xvfb display and isolated browser process. Vite's unique cache directory must include a `node_modules` segment: otherwise the React Compiler processes optimized dependency bundles and startup can stall.
+
+Baseline source: `08b140d14e6c1d49f9b7ad02c9437fe940d54d65`. Observed two-space hard break loses both spaces and emits zero `<br>`; ordinary soft break also emits zero `<br>`; fenced code loses trailing spaces. This is a reproduction only, not a fix or a passing regression test.
diff --git a/evals/desktop_bug_campaign/navigation-markdown-live.mjs b/evals/desktop_bug_campaign/navigation-markdown-live.mjs
new file mode 100644
index 00000000000..14fe96984d4
--- /dev/null
+++ b/evals/desktop_bug_campaign/navigation-markdown-live.mjs
@@ -0,0 +1,16 @@
+import { chromium } from '../../node_modules/playwright/index.mjs'
+import fs from 'node:fs'
+const a='/home/teknium/.hermes/cache/desktop-bugs-74848ed3/navigation-markdown'
+const tag=process.argv[2]??'before'
+const browser=await chromium.launch({headless:false,args:['--no-sandbox']})
+const page=await browser.newPage({viewport:{width:1400,height:1000}})
+const errors=[];page.on('pageerror',e=>errors.push(String(e)))
+await page.goto('http://127.0.0.1:18160/navigation-markdown-probe.html',{waitUntil:'domcontentloaded',timeout:120000})
+await page.waitForSelector('#hard p',{timeout:90000})
+await page.waitForTimeout(6000)
+await page.waitForSelector('#hard p',{timeout:90000})
+const result=await page.evaluate(()=>({inputs:window.probeInputs,outputs:window.probeOutputs,hardBr:document.querySelectorAll('#hard br').length,softBr:document.querySelectorAll('#soft br').length,text:document.body.innerText,html:document.querySelector('main').innerHTML}))
+result.errors=errors
+await page.screenshot({path:`${a}/markdown-${tag}.png`,fullPage:true})
+fs.writeFileSync(`${a}/markdown-${tag}.json`,JSON.stringify(result,null,2));console.log(JSON.stringify(result,null,2))
+await browser.close()
diff --git a/evals/desktop_bug_campaign/navigation-markdown-probe.html b/evals/desktop_bug_campaign/navigation-markdown-probe.html
new file mode 100644
index 00000000000..897ce5155e9
--- /dev/null
+++ b/evals/desktop_bug_campaign/navigation-markdown-probe.html
@@ -0,0 +1 @@
+<!doctype html><html><head><meta charset="utf-8"></head><body><div id="root"></div><script type="module" src="FIXTURE_ENTRY"></script></body></html>
\ No newline at end of file
diff --git a/evals/desktop_bug_campaign/navigation-markdown-probe.tsx b/evals/desktop_bug_campaign/navigation-markdown-probe.tsx
new file mode 100644
index 00000000000..ab7b27746b3
--- /dev/null
+++ b/evals/desktop_bug_campaign/navigation-markdown-probe.tsx
@@ -0,0 +1,13 @@
+import { createRoot } from 'react-dom/client'
+import { QueryClientProvider } from '@tanstack/react-query'
+import { queryClient } from '@/lib/query-client'
+import { I18nProvider } from '@/i18n'
+import { ThemeProvider } from '@/themes/context'
+import { RootTooltipProvider } from '@/components/ui/tooltip'
+import { MarkdownTextContent } from '@/components/assistant-ui/markdown-text'
+import { preprocessMarkdown } from '@/lib/markdown-preprocess'
+const hard = 'First line \nSecond line'
+const soft = 'Soft first\nSoft second'
+const code = '```python\nvalue = 1 \nvalue = 2 \n```'
+Object.assign(window, {probeInputs:{hard,soft,code}, probeOutputs:{hard:preprocessMarkdown(hard),soft:preprocessMarkdown(soft),code:preprocessMarkdown(code)}})
+createRoot(document.getElementById('root')!).render(<QueryClientProvider client={queryClient}><I18nProvider><ThemeProvider><RootTooltipProvider><main style={{padding:40}}><h1>Production Markdown renderer probe</h1>{Object.entries({hard,soft,code}).map(([id,text])=><section id={id} key={id}><h2>{id}</h2><MarkdownTextContent text={text} isRunning={false}/></section>)}</main></RootTooltipProvider></ThemeProvider></I18nProvider></QueryClientProvider>)
diff --git a/evals/desktop_bug_campaign/navigation-vite.mjs b/evals/desktop_bug_campaign/navigation-vite.mjs
new file mode 100644
index 00000000000..9fff1bfbd62
--- /dev/null
+++ b/evals/desktop_bug_campaign/navigation-vite.mjs
@@ -0,0 +1,28 @@
+import { createServer } from '../../node_modules/vite/dist/node/index.js'
+import fs from 'node:fs'
+import path from 'node:path'
+const root = path.resolve(import.meta.dirname, '../../apps/desktop')
+const artifactDir = process.env.NAVIGATION_ARTIFACT_DIR ?? '/home/teknium/.hermes/cache/desktop-bugs-74848ed3/navigation-markdown'
+const fixture = path.join(import.meta.dirname, 'navigation-markdown-probe.tsx')
+const server = await createServer({
+ root,
+ configFile: path.join(root, 'vite.config.ts'),
+ // Keep the node_modules segment: Babel must not compile optimized deps.
+ cacheDir: path.join(artifactDir, 'node_modules/.vite'),
+ plugins: [{
+ name: 'navigation-markdown-probe',
+ configureServer(server) {
+ server.middlewares.use('/navigation-markdown-probe.html', async (_req, res, next) => {
+ try {
+ const source = fs.readFileSync(path.join(import.meta.dirname, 'navigation-markdown-probe.html'), 'utf8')
+ const html = await server.transformIndexHtml('/navigation-markdown-probe.html', source.replace('FIXTURE_ENTRY', `/@fs/${fixture}`))
+ res.setHeader('Content-Type', 'text/html')
+ res.end(html)
+ } catch (error) { next(error) }
+ })
+ }
+ }],
+ server: {host: '127.0.0.1', port: 18160, strictPort: true}
+})
+await server.listen()
+server.printUrls()